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


C# Database.GetGuildId方法代码示例

本文整理汇总了C#中db.Database.GetGuildId方法的典型用法代码示例。如果您正苦于以下问题:C# Database.GetGuildId方法的具体用法?C# Database.GetGuildId怎么用?C# Database.GetGuildId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在db.Database的用法示例。


在下文中一共展示了Database.GetGuildId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Level

 public int Level()
 {
     using (var dbx = new Database())
     {
         var id = dbx.GetGuildId(Guild);
         return dbx.GetGuildLevel(id);
     }
 }
开发者ID:RiiggedMPGH,项目名称:Owl-Realms-Source,代码行数:8,代码来源:GuildHall.cs

示例2: Level

 public int Level()
 {
     using (var db = new Database())
     {
         int id = db.GetGuildId(this.Guild);
         return db.GetGuildLevel(id);
     }
 }
开发者ID:BlackRayquaza,项目名称:MMOE,代码行数:8,代码来源:GuildHall.cs

示例3: 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
             });
     }
 }
开发者ID:RoxyLalonde,项目名称:Phoenix-Realms,代码行数:22,代码来源:GuildMerchant.cs

示例4: 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
             });
         }
     }
 }
开发者ID:OryxAwakening,项目名称:Fabiano_Swagger_of_Doom,代码行数:46,代码来源:GuildMerchant.cs

示例5: CreateGuild

 public void CreateGuild(RealmTime t, CreateGuildPacket pkt)
 {
     bool GuildsActive = true;
     if (GuildsActive == false)
     {
         psr.SendPacket(new CreateGuildResultPacket()
         {
             Success = false,
             ResultMessage = "Guilds currently disabled!"
         });
         return;
     }
     else
     {
         try
         {
             string name = pkt.Name.ToString();
             if (psr.Account.Stats.Fame >= 1000 || Guild != "")
             {
                 if (name != "")
                 {
                     if (new Database().GetGuild(name) != null)
                     {
                         psr.SendPacket(new CreateGuildResultPacket()
                         {
                             Success = false,
                             ResultMessage = "Guild already exists!"
                         });
                         return;
                     }
                     using (Database db1 = new Database())
                     {
                         try
                         {
                             if (Guild != "")
                             {
                                 string oldname = psr.Account.Guild.Name;
                                 Guild g = db1.ChangeGuild(psr.Account, db1.GetGuildId(psr.Account.Guild.Name), 0, true);
                                 psr.Account.Guild.Name = g.Name;
                                 psr.Account.Guild.Rank = 0;
                                 Guild = g.Name;
                                 GuildRank = 0;
                                 UpdateCount++;
                                 psr.SendPacket(new NotificationPacket()
                                 {
                                     Text = "Left guild " + oldname,
                                     Color = new ARGB(0xFF008800),
                                     ObjectId = Id
                                 });
                                 psr.SendPacket(new CreateGuildResultPacket()
                                 {
                                     Success = true
                                 });
                                 foreach (var i in RealmManager.Worlds)
                                 {
                                     if (i.Key != 0)
                                     {
                                         foreach (var e in i.Value.Players)
                                         {
                                             if (e.Value.Client.Account.Guild.Name == oldname)
                                             {
                                                 e.Value.Client.SendPacket(new TextPacket()
                                                 {
                                                     BubbleTime = 0,
                                                     Stars = -1,
                                                     Name = "",
                                                     Recipient = "*Guild*",
                                                     Text = psr.Account.Name + " has left the guild!"
                                                 });
                                             }
                                         }
                                     }
                                 }
                                 return;
                             }
                             else
                             {
                                 if (pkt.Name != "")
                                 {
                                     Guild g = db1.CreateGuild(psr.Account, pkt.Name);
                                     psr.Account.Guild.Name = g.Name;
                                     psr.Account.Guild.Rank = g.Rank;
                                     Guild = g.Name;
                                     GuildRank = g.Rank;
                                     psr.SendPacket(new NotificationPacket()
                                     {
                                         Text = "Created guild " + g.Name,
                                         Color = new ARGB(0xFF008800),
                                         ObjectId = Id
                                     });
                                     psr.SendPacket(new CreateGuildResultPacket()
                                     {
                                         Success = true,
                                         ResultMessage = "Success!"
                                     });
                                     CurrentFame = psr.Account.Stats.Fame = psr.Database.UpdateFame(psr.Account, -1000);
                                     UpdateCount++;
                                     return;
                                 }
                                 else
//.........这里部分代码省略.........
开发者ID:xzyio,项目名称:Rotmg-PServer,代码行数:101,代码来源:Player.Guilds.cs

示例6: Level

 public int Level(Database db)
 {
     return db.GetGuildLevel(db.GetGuildId(Guild));
 }
开发者ID:OryxAwakening,项目名称:Fabiano_Swagger_of_Doom,代码行数:4,代码来源:GuildHall.cs


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