当前位置: 首页>>代码示例>>C#>>正文


C# Database.ChangeGuildRank方法代码示例

本文整理汇总了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:
//.........这里部分代码省略.........
开发者ID:lcnvdl,项目名称:rotmg-server,代码行数:101,代码来源:Player.cs


注:本文中的db.Database.ChangeGuildRank方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。