本文整理汇总了C#中db.Database.ChangeGuildRank方法的典型用法代码示例。如果您正苦于以下问题:C# Database.ChangeGuildRank方法的具体用法?C# Database.ChangeGuildRank怎么用?C# Database.ChangeGuildRank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db.Database
的用法示例。
在下文中一共展示了Database.ChangeGuildRank方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeRank
public void ChangeRank(GuildRankChangePacket pkt)
{
using(Database dbx = new Database())
{
if (psr.Account.Guild.Name == "")
{
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = "You don't have a guild!"
});
return;
}
switch (psr.Account.Guild.Rank)
{
case 0:
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = "Only officers, leaders and founders can promote/demote other members!"
});
return;
case 10:
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = "Only officers, leaders and founders can promote/demote other members!"
});
return;
case 20:
switch (pkt.Rank)
{
case 0:
dbx.ChangeGuildRank(pkt.Name, pkt.Rank);
foreach (var i in RealmManager.Clients.Values)
{
if (i.Account.Guild.Name == psr.Account.Guild.Name && i.Account.Guild.Id == psr.Account.Guild.Id)
{
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = dbx.ChangeRankTextBuilder(psr.Account, dbx.GetAccount(pkt.Name), pkt.Rank)
});
}
}
return;
case 10:
if (dbx.GetAccount(pkt.Name).Guild.Rank == psr.Account.Guild.Rank)
{
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = "You can't demote members with your same rank!"
});
return;
}
dbx.ChangeGuildRank(pkt.Name, pkt.Rank);
foreach (var i in RealmManager.Clients.Values)
{
if (i.Account.Guild.Name == psr.Account.Guild.Name && i.Account.Guild.Id == psr.Account.Guild.Id)
{
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = dbx.ChangeRankTextBuilder(psr.Account, dbx.GetAccount(pkt.Name), pkt.Rank)
});
}
}
return;
case 20:
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = "Only leaders and founders can promote other members to officers!"
});
return;
case 30:
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Name = "",
Stars = -1,
Text = "Only leaders and founders can promote other members to leaders!"
});
return;
case 40:
//.........这里部分代码省略.........