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


C# Database.MySqlCommand类代码示例

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


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

示例1: LoadFlags

        public static void LoadFlags()
        {
           
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("flags");
            PhoenixProject.Database.MySqlReader r = new PhoenixProject.Database.MySqlReader(cmd);
            if (r.Read())
            {
                TopSpouse = r.ReadString("TopSpouse");
                TopArcher = r.ReadString("TopArcher");
                TopWarrior = r.ReadString("TopWarrior");
                TopNinja = r.ReadString("TopNinja");
                TopWaterTaoist = r.ReadString("TopWaterTaoist");
                TopFireTaoist = r.ReadString("TopFireTaoist");
                TopTrojan = r.ReadString("TopTrojan");
                TopGuildLeader = r.ReadString("TopGuildLeader");
                TopDeputyLeader = r.ReadString("TopDeputyLeader");
                WeeklyPKChampion = r.ReadString("WeeklyPKChampion");
                MonthlyPKChampion = r.ReadString("MonthlyPKChampion");
                TopMonk = r.ReadString("TopMonk");
                TopDeputyLeader2 = r.ReadString("TopDeputyLeader2");
                TopDeputyLeader3 = r.ReadString("TopDeputyLeader3");
                TopDeputyLeader4 = r.ReadString("TopDeputyLeader4");
                TopDeputyLeader5 = r.ReadString("TopDeputyLeader5");
                TopPirate = r.ReadString("TopPirate");

            }
            r.Close();
            r.Dispose();
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:29,代码来源:Flags.cs

示例2: LoadRates

        public static void LoadRates()
        {
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("systemmessage");
            PhoenixProject.Database.MySqlReader r = new PhoenixProject.Database.MySqlReader(cmd);
            if (r.Read())
            {
                EliteGW2 = r.ReadString("EliteGW2");
                ClassPk = r.ReadString("ClassPk");
                GuildFlame = r.ReadString("GuildFlame");
                DisEnd = r.ReadString("DisEnd");
                DailyPk = r.ReadString("DailyPk");
                CouplesPk = r.ReadString("CouplesPk");
                SteedRace = r.ReadString("SteedRace");

                Sys = r.ReadString("Sys");
                Sys2 = r.ReadString("Sys2");
                Sys3 = r.ReadString("Sys3");
                Sys4 = r.ReadString("Sys4");
                Sys5 = r.ReadString("Sys5");
                Sys6 = r.ReadString("Sys6");
                Sys7 = r.ReadString("Sys7");
                Sys8 = r.ReadString("Sys8");
                Sys9 = r.ReadString("Sys9");

            }
            Console.WriteLine("System Messages  Loaded.");
            r.Close();
            r.Dispose();
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:29,代码来源:Message.cs

示例3: Claim

        public static void Claim(uint kimo, Client.GameState owner)
        {
            MySqlCommand command = new MySqlCommand(MySqlCommandType.DELETE);

            command.Delete("claimitems", "ItemUID", kimo).And("GainerUID", owner.Entity.UID).Execute();
            //ClaimItem.Delete(item.Item.UID);
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:7,代码来源:ClaimItemTable.cs

示例4: Flowers

 public static void Flowers(GameState client)
 {
     client.Entity.Flowers = new Flowers();
     if (!FlowerSystemTable.Exists(client.Entity.UID))
     {
         FlowerSystemTable.Insert(client);
     }
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
     cmd.Select("flowers").Where("id", (long)((ulong)client.Entity.UID));
     MySqlReader r = new MySqlReader(cmd);
     if (r.Read())
     {
         client.Entity.Flowers.id = client.Entity.UID;
         client.Entity.Flowers.RedRoses2day = 0u;
         client.Entity.Flowers.Lilies2day = 0u;
         client.Entity.Flowers.Tulips2day = 0u;
         client.Entity.Flowers.Orchads2day = 0u;
         client.Entity.Flowers.RedRoses = r.ReadUInt32("redroses");
         client.Entity.Flowers.Lilies = r.ReadUInt32("lilies");
         client.Entity.Flowers.Tulips = r.ReadUInt32("tulips");
         client.Entity.Flowers.Orchads = r.ReadUInt32("orchads");
     }
     r.Close();
     r.Dispose();
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:25,代码来源:FlowerSystemTable.cs

示例5: CreateClan

        public static void CreateClan(Client.GameState client)
        {
            try
            {
                uint clanid = Program.nextClanid;
                Program.nextClanid++;
                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", clanid).Set("ClanRank", "100")
                    .Set("ClanDonation", "500000").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 PhoenixProject.Network.GamePackets.Clan(client, 1);
                client.Send(cl.ToArray());
                PhoenixProject.ServerBase.Kernel.ServerClans.Add(clanid, client.Entity.Myclan);
                Network.GamePackets.Clan cls = new PhoenixProject.Network.GamePackets.Clan(client, 1);
                client.Send(cls.ToArray());
            }
            catch (Exception e)
            {
                Program.SaveException(e);
            }
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:28,代码来源:ClanTable.cs

示例6: 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:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:8,代码来源:GuildTable.cs

示例7: KimoUpdateName

        public static void KimoUpdateName(Client.GameState client)
        {
            
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("entities");
            PhoenixProject.Database.MySqlReader r = new PhoenixProject.Database.MySqlReader(cmd);
            String name = "";
            while (r.Read())
            {
                //newname = r.ReadString("namechange");//debug make
                name = r.ReadString("name");
                if (name != "")
                {
                    MySqlCommand cmdupdate = null;//lol i see the problem hold on ,,, hold on what? :$ try now
                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("apprentice").Set("MentorName", client.Entity.NewName).Where("MentorName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("apprentice").Set("ApprenticeName", client.Entity.NewName).Where("ApprenticeName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("arena").Set("EntityName", client.Entity.NewName).Where("EntityName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("claimitems").Set("OwnerName", client.Entity.NewName).Where("OwnerName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("claimitems").Set("GainerName", client.Entity.NewName).Where("GainerName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("detaineditems").Set("OwnerName", client.Entity.NewName).Where("OwnerName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("detaineditems").Set("GainerName", client.Entity.NewName).Where("GainerName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("enemy").Set("EnemyName", client.Entity.NewName).Where("EnemyName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("friends").Set("FriendName", client.Entity.NewName).Where("FriendName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("guilds").Set("Name", client.Entity.NewName).Where("Name", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("guilds").Set("LeaderName", client.Entity.NewName).Where("LeaderName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("nobility").Set("EntityName", client.Entity.NewName).Where("EntityName", name).Execute();

                    cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
                    cmdupdate.Update("partners").Set("PartnerName", client.Entity.NewName).Where("PartnerName", name).Execute();
                    UpdateStaff(client);
                    return;
                }
            }
            r.Close();
            r.Dispose();
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:58,代码来源:NameChanger.cs

示例8: Insert

 public static void Insert(Entity Entity, byte id)
 {
     Statement.SubClass Sub = new Statement.SubClass();
     MySqlCommand Command = new MySqlCommand(MySqlCommandType.INSERT);
     Command.Insert("subclasses")
         .Insert("uid", id)
         .Insert("id", Entity.UID)
         .Execute();
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:9,代码来源:SubClassTable.cs

示例9: CreateArsenal

 public static void CreateArsenal(uint s_id, Arsenal_ID id)
 {
     MySqlCommand Command = new MySqlCommand(MySqlCommandType.INSERT);
     Command.Insert("pt_arsenal")
         .Insert("syn_id", s_id)
         .Insert("arsenal_id", (byte)id)
         .Insert("arsenal_unlocked", 1)
         .Execute();
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:9,代码来源:ArsenalTable.cs

示例10: AddPartner

 public static void AddPartner(Client.GameState client, TradePartner partner)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
     cmd.Insert("partners").Insert("entityid", client.Entity.UID).Insert("partnerid", partner.ID)
         .Insert("partnername", partner.Name).Insert("probationstartedon", partner.ProbationStartedOn.Ticks).Execute();
     cmd = new MySqlCommand(MySqlCommandType.INSERT);
     cmd.Insert("partners").Insert("entityid", partner.ID).Insert("partnerid", client.Entity.UID)
         .Insert("partnername", client.Entity.Name).Insert("probationstartedon", partner.ProbationStartedOn.Ticks).Execute();
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:9,代码来源:KnownPersons.cs

示例11: AddFriend

 public static void AddFriend(Client.GameState client, Friend friend)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
     cmd.Insert("friends").Insert("entityid", client.Entity.UID).Insert("friendid", friend.ID)
         .Insert("friendname", friend.Name).Execute();
     cmd = new MySqlCommand(MySqlCommandType.INSERT);
     cmd.Insert("friends").Insert("entityid", friend.ID).Insert("friendid", client.Entity.UID)
         .Insert("friendname", client.Entity.Name).Execute();
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:9,代码来源:KnownPersons.cs

示例12: Create

 public static void Create(Game.ConquerStructures.Society.Guild guild)
 {
     MySqlCommand command = new MySqlCommand(MySqlCommandType.INSERT);
     command.Insert("guilds").
         Insert("ID", guild.ID).
         Insert("Name", guild.Name).
         Insert("SilverFund", 500000).
         Insert("LeaderName", guild.LeaderName);
     command.Execute();
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:10,代码来源:GuildTable.cs

示例13: NewReincarnated

 public static void NewReincarnated(Game.Entity entity)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
     cmd.Insert("reincarnation")
         .Insert("uid", entity.UID)
         .Insert("level", entity.Level)
         .Insert("experience", 0);
     cmd.Execute();
        // Conquer.Database.Reincarnation.Insert((int)entity.UID, (int)entity.Level, 0);
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:10,代码来源:ReincarnationTable.cs

示例14: Update

 public static void Update(Game.Entity Entity, Statement.SubClass SubClass)
 {
     MySqlCommand Command = new MySqlCommand(MySqlCommandType.UPDATE);
     Command.Update("subclasses")
         .Set("phase", SubClass.Phase)
         .Set("level", SubClass.Level)
         .Where("id", Entity.UID)
         .And("uid", SubClass.ID)
         .Execute();
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:10,代码来源:SubClassTable.cs

示例15: LoadClaimableItems

        public static void LoadClaimableItems(Client.GameState client)
        {
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
            cmd.Select("claimitems").Where("GainerUID", client.Entity.UID);
            MySqlReader r = new MySqlReader(cmd);
            while (r.Read())
            {
                DetainedItem item = new DetainedItem(true);
                item.ItemUID = r.ReadUInt32("ItemUID");
                item.UID = item.ItemUID;
                item.Page = (byte)DetainedItem.ClaimPage;
                item.Item = ConquerItemTable.LoadItem(item.ItemUID);
                item.ConquerPointsCost = r.ReadUInt32("ConquerPointsCost");
                item.OwnerUID = r.ReadUInt32("OwnerUID");
                item.GainerName = r.ReadString("GainerName");
                item.GainerUID = r.ReadUInt32("GainerUID");
                item.OwnerName = r.ReadString("OwnerName");
                item.Date = DateTime.FromBinary(r.ReadInt64("Date"));
                item.DaysLeft = (uint)(TimeSpan.FromTicks(DateTime.Now.Ticks).Days - TimeSpan.FromTicks(item.Date.Ticks).Days);
                if (item.OwnerUID == 500)
                {
                    item.MakeItReadyToClaim();
                    item.GainerUID = r.ReadUInt32("GainerUID");
                    item.OwnerUID = r.ReadUInt32("OwnerUID");
                }
                client.ClaimableItem.Add(item.UID, item);
            }
            r.Close();
            r.Dispose();

            /*ClaimItemCollection items = new ClaimItemCollection();
            items.LoadAndCloseReader(ClaimItem.FetchByParameter("GainerUID", client.Entity.UID));
            for (int x = 0; x < items.Count; x++)
            {
                DetainedItem item = new DetainedItem(true);
                item.ItemUID = items[x].ItemUID;
                item.UID = item.ItemUID - 1;
                item.Page = (byte)DetainedItem.ClaimPage;
                item.Item = ConquerItemTable.LoadItem(item.ItemUID);
                item.ConquerPointsCost = items[x].ConquerPointsCost;
                item.OwnerUID = items[x].OwnerUID;
                item.GainerName = items[x].GainerName;
                item.GainerUID = items[x].GainerUID;
                item.OwnerName = items[x].OwnerName;
                item.Date = DateTime.FromBinary((long)items[x].DateX);
                item.DaysLeft = (uint)(TimeSpan.FromTicks(DateTime.Now.Ticks).Days - TimeSpan.FromTicks(item.Date.Ticks).Days);
                if (item.OwnerUID == 500)
                {
                    item.MakeItReadyToClaim();
                    item.GainerUID = items[x].GainerUID;
                    item.OwnerUID = items[x].OwnerUID;
                }
                client.ClaimableItem.Add(item.UID, item);
            }*/
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:55,代码来源:ClaimItemTable.cs


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