Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 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();
         }
     }
 }
Esempio n. 3
0
 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();
         }
     }
 }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 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();
 }
Esempio n. 6
0
 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();
     }
 }
Esempio n. 7
0
 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();
 }
Esempio n. 8
0
 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();
 }
Esempio n. 9
0
 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();
 }
Esempio n. 10
0
        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());
        }
Esempio n. 11
0
 public static void Update(Game.Entity Entity, Game.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();
 }
Esempio n. 12
0
 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();
     }
 }
Esempio n. 13
0
 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();
     }
 }
Esempio n. 14
0
 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();
     }
 }
Esempio n. 15
0
 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); }
 }
Esempio n. 16
0
        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);
        }
Esempio n. 17
0
 public static bool canLotto(Client.GameState client, ref bool New)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
     cmd.Select("quest").Where("EntityName", client.Entity.Name).Or("IP", client.IP);
     MySqlReader rdr = new MySqlReader(cmd);
     if (rdr.Read())
     {
         New = false;
         client.LastLotteryEntry = DateTime.FromBinary(rdr.ReadInt64("LottoDate"));
         client.LotteryEntries = rdr.ReadByte("LottoTries");
         if (client.LotteryEntries <= 9)
         {
             rdr.Close();
             return true;
         }
         else if (DateTime.Now.DayOfYear != client.LastLotteryEntry.DayOfYear)
         {
             client.LotteryEntries = 0;
             MySqlCommand Do = new MySqlCommand(MySqlCommandType.UPDATE);
             Do.Update("quest").Set("LottoDate", DateTime.Now.Ticks).Set("LottoTries", 0).Where("EntityName", client.Entity.Name).Or("IP", client.IP).Execute();
             rdr.Close();
             return true;
         }
         else
         {
             rdr.Close();
             return false;
         }
     }
     else
     {
         rdr.Close();
         New = true;
         return true;
     }
 }
Esempio n. 18
0
 public static void ResetLotto(Client.GameState client)
 {
     client.LotteryEntries = 0;
     MySqlCommand Do = new MySqlCommand(MySqlCommandType.UPDATE);
     Do.Update("quest").Set("LottoDate", DateTime.Now.Ticks).Set("LottoTries", 0).Where("EntityName", client.Entity.Name).Or("IP", client.IP).Execute();
 }
Esempio n. 19
0
 public static void pExpBall(Client.GameState client)
 {
     MySqlCommand Do = new MySqlCommand(MySqlCommandType.UPDATE);
     Do.Update("quest").Set("pExpBallsUsed", "pExpBallsUsed"+1).Where("EntityName", client.Entity.Name).Execute();
 }
Esempio n. 20
0
 public static void SaveClientDonation(Client.GameState client)
 {
     MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd3.Update("entities").Set("ClanDonation", client.Entity.Myclan.Members[client.Entity.UID].Donation).Where("ClanID", client.Entity.Myclan.ClanId)
         .And("UID", client.Entity.UID).Execute();
 }
Esempio n. 21
0
 public static void ResetTopWeeklyPkWar()
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd.Update("entities").Set("WeeklyPKChampion", 0).Where("WeeklyPKChampion", 1); cmd.Execute();
 }
Esempio n. 22
0
 public static void TransferClan(string name)
 {
     MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd3.Update("entities")
         .Set("ClanRank", 100).Where("Name", name).Execute();
 }
Esempio n. 23
0
 public static void ResetTopWater2()
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd.Update("entities").Set("TopWaterTaoist2", 0).Where("TopWaterTaoist2", 1); cmd.Execute();
 }
Esempio n. 24
0
 public static void ClearPosition(uint EntityID, byte position)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     int res = cmd.Update("items").Set("Position", 0).Where("EntityID", EntityID).And("Position", position).Execute();
 }
Esempio n. 25
0
 public static void ResetTopDL()
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd.Update("entities").Set("TopDeputyLeader", 0).Where("TopDeputyLeader", 1); cmd.Execute();
 }
Esempio n. 26
0
 public static void SaveClan(Game.Clans clan)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     cmd.Update("Clans").Set("Fund", clan.ClanDonation).Set("Level", clan.ClanLevel)
         .Set("Bulletin",clan.ClanBuletion).Set("Leader",clan.ClanLider).Where("ClanID", clan.ClanId).Execute();
 }
Esempio n. 27
0
 public static void UpdateItem(Interfaces.IConquerItem Item, Client.GameState client)
 {
     string agate = "";
     if (Item.ID == 720828)
     {
         foreach (string coord in Item.Agate_map.Values)
         {
             agate += coord + "#";
         }
     }
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     int res = cmd.Update("items").Set("Plus", Item.Plus).Set("Bless", Item.Bless)
         .Set("Enchant", Item.Enchant).Set("SocketOne", (byte)Item.SocketOne)
         .Set("SocketTwo", (byte)Item.SocketTwo).Set("Durability", Item.Durability)
         .Set("MaximDurability", Item.MaximDurability).Set("SocketProgress", Item.SocketProgress)
         .Set("PlusProgress", Item.PlusProgress).Set("Effect", (ushort)Item.Effect)
         .Set("Bound", Item.Bound).Set("Locked", Item.Lock).Set("Position", Item.Position).Set("Warehouse", Item.Warehouse).Set("EntityID", client.Entity.UID)
         .Set("Suspicious", Item.Suspicious).Set("Color", (uint)Item.Color).Set("UnlockEnd", Item.UnlockEnd.ToBinary()).Set("SuspiciousStart", Item.SuspiciousStart.ToBinary())
         .Set("StackSize", Item.StackSize).Set("MaxStackSize", Item.MaxStackSize).Set("agate", agate).Where("UID", Item.UID).Execute();
     if (res != 1)
         client.Inventory.ReviewItem(Item);
 }
Esempio n. 28
0
 public static void UpdateLocation(Interfaces.IConquerItem Item, Client.GameState client)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     int res = cmd.Update("items").Set("EntityID", client.Entity.UID).Set("Position", Item.Position).Set("Warehouse", Item.Warehouse).Where("UID", Item.UID).Execute();
     if (res != 1)
         client.Inventory.ReviewItem(Item);
 }
Esempio n. 29
0
 public static void UpdateLock(Interfaces.IConquerItem Item, Client.GameState client)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     int res = cmd.Update("items").Set("Locked", Item.Lock).Set("UnlockEnd", Item.UnlockEnd.ToBinary()).Where("UID", Item.UID).Execute();
     if (res != 1)
         client.Inventory.ReviewItem(Item);
 }
Esempio n. 30
0
 public static void UpdateStackItem(Interfaces.IConquerItem Item, Client.GameState client)
 {
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
     int res = cmd.Update("items").Set("StackSize", Item.StackSize).Where("UID", Item.UID).Execute();
     if (res != 1)
         client.Inventory.ReviewItem(Item);
 }