本文整理汇总了C#中db.Database.GetGuild方法的典型用法代码示例。如果您正苦于以下问题:C# Database.GetGuild方法的具体用法?C# Database.GetGuild怎么用?C# Database.GetGuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db.Database
的用法示例。
在下文中一共展示了Database.GetGuild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Buy
public override void Buy(Player player)
{
if (!player.Guild.IsDefault)
{
if (player.Guild[player.AccountId].Rank >= 30)
{
using (var db = new Database())
{
if (db.GetGuild(db.GetGuildId(player.Guild[player.AccountId].Name)).GuildFame >= Price)
{
var cmd = db.CreateQuery();
cmd.CommandText = "UPDATE guilds SET level=level+1, [email protected] WHERE [email protected]";
cmd.Parameters.AddWithValue("@guildName", player.Guild.Name);
cmd.Parameters.AddWithValue("@price", Price);
if (cmd.ExecuteNonQuery() == 1)
{
player.Client.SendPacket(new BuyResultPacket
{
Message = "{\"key\":\"server.sale_succeeds\"}",
Result = -1
});
player.SendInfo("Please leave the Guild Hall, we need some minutes to update the Guild Hall.");
player.Guild.UpdateGuildHall();
}
}
else
{
player.SendHelp("FUCK");
player.Client.SendPacket(new BuyResultPacket
{
Message = "{\"key\":\"server.not_enough_fame\"}",
Result = 9
});
}
}
}
else
{
player.Client.SendPacket(new BuyResultPacket
{
Message = "Founder or Leader rank required.",
Result = 0
});
}
}
}
示例2: Buy
public override void Buy(Player player)
{
using (var dbx = new Database())
{
if (dbx.GetGuild(dbx.GetGuildId(player.Guild)).GuildFame >= Price)
{
dbx.DetractGuildFame(dbx.GetGuildId(player.Guild), Price);
dbx.ChangeGuildLevel(dbx.GetGuildId(player.Guild), nextLevel);
player.Client.SendPacket(new BuyResultPacket
{
Message = "Upgrade successful! Please leave the Guild Hall to have it upgraded",
Result = 0
});
}
else
player.Client.SendPacket(new BuyResultPacket
{
Message = "Not enough Guild Fame!",
Result = 9
});
}
}
示例3: JoinGuild
public void JoinGuild(RealmTime t, JoinGuildPacket pkt)
{
var db = new Database();
var gStruct = db.GetGuild(pkt.GuildName);
if (psr.Player.Invited == false)
{
SendInfo("You need to be invited to join a guild!");
}
if (gStruct != null)
{
var g = db.ChangeGuild(psr.Account, gStruct.Id, 0, 0, false);
if (g != null)
{
psr.Account.Guild = g;
Guild = g.Name;
GuildRank = g.Rank;
UpdateCount++;
foreach (var p in RealmManager.GuildMembersOf(g.Name))
{
p.Client.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
//Name = "@" + psr.Account.Name + " has joined the guild!"
Name = "",
Recipient = "*Guild*",
Text = psr.Account.Name + " has joined the guild!"
});
}
}
}
}