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


C# MySqlCommand.Update方法代码示例

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


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

示例1: KickClan

 public static void KickClan(string name)
 {
     MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd3.Update("entities").Set("ClanDonation", 0)
         .Set("ClanRank", 0)
         .Set("ClanID", 0).Where("Name", name).Execute();
 }
开发者ID:faresali,项目名称:co-pserver,代码行数:7,代码来源:Clans.cs

示例2: CreateArsenal

 public static void CreateArsenal(ushort gID, Game.ConquerStructures.Society.ArsenalType Type)
 {
     if (!ContainsArsenal(gID))
     {
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
         cmd.Insert("guild_arsenals").Insert("guild_uid", gID).Execute();
     }
     else
     {
         string val = "";
         switch (Type)
         {
             case ArsenalType.Headgear: val = "head_allowed"; break;
             case ArsenalType.Armor: val = "armor_allowed"; break;
             case ArsenalType.Weapon: val = "weapon_allowed"; break;
             case ArsenalType.Ring: val = "ring_allowed"; break;
             case ArsenalType.Boots: val = "boots_allowed"; break;
             case ArsenalType.Necklace: val = "neck_allowed"; break;
             case ArsenalType.Fan: val = "fan_allowed"; break;
             case ArsenalType.Tower: val = "tower_allowed"; break;
         }
         if (val != "")
         {
             MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
             cmd.Update("guild_arsenals").Set(val, 1).Execute();
         }
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:28,代码来源:ArsenalsTable.cs

示例3: SaveProficiencies

 public static void SaveProficiencies(Client.GameState client)
 {
     if (client.Entity == null)
         return;
     if (client.Proficiencies == null)
         return;
     if (client.Proficiencies.Count == 0)
         return;
     foreach (Interfaces.ISkill proficiency in client.Proficiencies.Values)
     {
         if(proficiency.Available)
         {
             MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
             cmd.Update("skills").Set("Level", proficiency.Level).Set("PreviousLevel", proficiency.PreviousLevel)
                 .Set("Experience", proficiency.Experience).Where("EntityID", client.Entity.UID).And("ID", proficiency.ID).Execute();
         }
         else
         {
             proficiency.Available = true;
             MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
             cmd.Insert("skills").Insert("Level", proficiency.Level).Insert("Experience", proficiency.Experience).Insert("EntityID", client.Entity.UID)
                 .Insert("Type", "Proficiency").Insert("ID", proficiency.ID).Execute();
         }
     }
 }
开发者ID:faresali,项目名称:co-pserver,代码行数:25,代码来源:Copy+of+SkillTable.cs

示例4: Inscribe

 public static void Inscribe(Game.ConquerStructures.Society.ArsenalType Type, uint Donation, Interfaces.IConquerItem item, Game.Entity Entity)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
     cmd.Insert("guild_arsenalsdonation").Insert("d_uid", Entity.UID).Insert("guild_uid", Entity.GuildID).Insert("name", Entity.Name).Insert("item_uid", item.UID).Insert("item_donation", Donation).Insert("item_arsenal_type", (byte)Type).Execute();
     cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd.Update("items").Set("Inscribed", 1).Where("UID", item.UID).Execute();
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:7,代码来源:ArsenalsTable.cs

示例5: Delete

 public static void Delete(uint UID)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE);
     cmd.Delete("guild_arsenalsdonation", "item_uid", UID).Execute();
     cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd.Update("items").Set("Inscribed", 0).Where("UID", UID).Execute();
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:7,代码来源:ArsenalsTable.cs

示例6: activateVip

 public static void activateVip(Client.GameState client)
 {
     if (inPremium(client))
     {
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
         cmd.Update("premium").Set("VipDays", client.VIPDays).Set("VipStartDate", DateTime.Now.Ticks).Where("Username", client.Account.Username).Execute();
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:8,代码来源:PremiumTable.cs

示例7: Disband

 public static void Disband(Game.ConquerStructures.Society.Guild guild)
 {
     MySqlCommand command = new MySqlCommand(MySqlCommandType.UPDATE);
     command.Update("entities").Set("GuildID", 0).Where("GuildID", guild.ID).Execute();
     ServerBase.Kernel.Guilds.Remove(guild.ID);
     command = new MySqlCommand(MySqlCommandType.DELETE);
     command.Delete("guilds", "ID", guild.ID).Execute();
 }
开发者ID:faresali,项目名称:co-pserver,代码行数:8,代码来源:GuildTable.cs

示例8: Update56

 public static void Update56(Conquer_Online_Server.Game.Entity Entity)
 {
     MySqlCommand Command = new MySqlCommand(MySqlCommandType.UPDATE);
     Command.Update("entities")
         .Set("My_Title", Entity.TitleActivated)
         .Where("UID", Entity.UID)
         .Execute();
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:8,代码来源:SubClassTable.cs

示例9: Update

 public static void Update(Game.Entity Entity)
 {
     MySqlCommand Command = new MySqlCommand(MySqlCommandType.UPDATE);
     Command.Update("entities")
         .Set("StudyPoints", Entity.SubClasses.StudyPoints)
         .Where("UID", Entity.UID)
         .Execute();
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:8,代码来源:SubClassTable.cs

示例10: JoinClan

        public static void JoinClan(Client.GameState client)
        {
            MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
            cmd3.Update("entities").Set("ClanID", client.Entity.Myclan.ClanId).Set("ClanRank", client.Entity.Myclan.Members[client.Entity.UID].Rank)
                .Set("ClanDonation", client.Entity.Myclan.Members[client.Entity.UID].Donation).Where("UID", client.Entity.UID).Execute();

            Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
            client.Send(cl.ToArray());
        }
开发者ID:faresali,项目名称:co-pserver,代码行数:9,代码来源:Clans.cs

示例11: DeleteAll

 public static void DeleteAll(Dictionary<uint, Game.ConquerStructures.Society.ArsenalSingle> Items)
 {
     foreach (ArsenalSingle AS in Items.Values)
     {
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE);
         cmd.Delete("guild_arsenalsdonation", "item_uid", AS.UID).Execute();
         cmd = new MySqlCommand(MySqlCommandType.UPDATE);
         cmd.Update("items").Set("Inscribed", 0).Where("UID", AS.UID).Execute();
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:10,代码来源:ArsenalsTable.cs

示例12: Lotto

 public static void Lotto(Client.GameState client, bool New)
 {
     if (New)
     {
         client.LotteryEntries = 1;
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
         cmd.Insert("quest").Insert("EntityName", client.Entity.Name).Insert("IP", client.IP).Insert("LottoDate", DateTime.Now.Ticks).Insert("LottoTries", 1).Insert("Username", client.Account.Username).Execute();
     }
     else
     {
         client.LotteryEntries += 1;
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
         cmd.Update("quest").Set("LottoDate", DateTime.Now.Ticks).Set("LottoTries", client.LotteryEntries).Set("Username", client.Account.Username).Where("EntityName", client.Entity.Name).Or("IP", client.IP).Execute();
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:15,代码来源:QuestTable.cs

示例13: SaveFlowerRank

 public static void SaveFlowerRank(Client.GameState C)
 {
     Game.Struct.Flowers F = C.Entity.MyFlowers;
     if (Conquer_Online_Server.ServerBase.Kernel.AllFlower.ContainsKey(C.Entity.UID))
     {
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
         cmd.Update("cq_flowers").Set("redroses", F.RedRoses).Set("redrosestoday", F.RedRoses2day).Set("lilies", F.Lilies).Set("liliestoday", F.Lilies2day).Set("tulips", F.Tulips).Set("tulipstoday", F.Tulips2day).Set("orchads", F.Orchads).Set("orchadstoday", F.Orchads2day).Where("charuid", C.Entity.UID).Execute();
     }
     else
     {
         Conquer_Online_Server.ServerBase.Kernel.AllFlower.Add(C.Entity.UID, F);
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
         cmd.Insert("cq_flowers").Insert("Names", C.Entity.Name).Insert("charuid", C.Entity.UID).Insert("redroses", F.RedRoses).Insert("redrosestoday", F.RedRoses2day).Insert("lilies", F.Lilies).Insert("liliestoday", F.Lilies2day).Insert("tulips", F.Tulips).Insert("tulipstoday", F.Tulips2day).Insert("orchads", F.Orchads).Insert("orchadstoday", F.Orchads2day).Execute();
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:15,代码来源:LoadFlowers.cs

示例14: PkWarSave

 public static void PkWarSave(Client.GameState client)
 {
     try
     {
         MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
         cmd.Update("entities")
         .Set("TopTrojan", client.Entity.TopTrojan)
         .Set("TopWarrior", client.Entity.TopWarrior)
         .Set("TopNinja", client.Entity.TopNinja)
         .Set("TopWaterTaoist", client.Entity.TopWaterTaoist)
         .Set("TopFireTaoist", client.Entity.TopFireTaoist)
         .Set("TopArcher", client.Entity.TopArcher)
         .Set("WeeklyPKChampion", client.Entity.WeeklyPKChampion)
         .Set("TopMonk", client.Entity.TopMonk).Where("UID", client.Account.EntityID);
     }
     catch (Exception e) { Program.SaveException(e); }
 }
开发者ID:faresali,项目名称:co-pserver,代码行数:17,代码来源:PkWarEvent.cs

示例15: CreateClan

        public static void CreateClan(Client.GameState client)
        {
            uint clanid = Game.Clans.ClanCount.Next;
            //clanid = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 40000);
            //if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(clanid))
              //  while (!Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(clanid))
                //    clanid = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 400000);

            client.Entity.Myclan.ClanId = clanid;
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
            cmd.Insert("Clans").Insert("Name", client.Entity.Myclan.ClanName).Insert("ClanID", clanid)
                .Insert("Leader", client.Entity.Name).Insert("Fund", 500000).Execute();

            MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
            cmd3.Update("entities").Set("ClanID", client.Entity.Myclan.ClanId).Set("ClanRank", client.Entity.Myclan.Members[client.Entity.UID].Rank)
                .Set("ClanDonation", client.Entity.Myclan.Members[client.Entity.UID].Donation).Where("UID", client.Entity.UID).Execute();

            client.Entity.ClanRank = 100;
            client.Entity.ClanName = client.Entity.Myclan.ClanName;
            client.Entity.ClanId = clanid;
            Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
            client.Send(cl.ToArray());
            Conquer_Online_Server.ServerBase.Kernel.ServerClans.Add(clanid, client.Entity.Myclan);
        }
开发者ID:faresali,项目名称:co-pserver,代码行数:24,代码来源:Clans.cs


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