Пример #1
0
 public override void Handle(ReBornWarRock_PServer.GameServer.Virtual_Objects.User.virtualUser User)
 {
     try
     {
         int    OPCode      = Convert.ToInt32(getBlock(0));
         int    Period      = Convert.ToInt32(getBlock(4));
         string Code        = getBlock(1);
         int[]  convertDays = new int[6] {
             3, 7, 15, 30, 1, -1
         };
         Item Item = ItemManager.getItem(Code);
         if (Item != null)
         {
             int Price = Item.getCashPrice(Period);
             if (User.Cash - Price < 1)
             {
                 User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.NotEnoughDinar, "NULL"));
             }
             else if (LevelCalculator.getLevelforExp(User.Exp) < Item.Level && User.Rank < 3)
             {
                 User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.LevelLow, "NULL"));
             }
             else
             {
                 int InventorySlot = User.InventorySlots;
                 if (InventorySlot >= 0)
                 {
                     User.Cash -= Price;
                     DB.runQuery("UPDATE users SET cash='" + User.Cash + "' WHERE id='" + User.UserID + "'");
                     User.LoadItems();
                     User.AddOutBoxItem(Code, convertDays[Period], 1);
                     User.send(new PACKET_OUTBOX_SEND(User));
                     Log.AppendText(User.Nickname + " has bought [" + Item.Code.ToUpper() + "-" + Item.Name + "] for " + convertDays /*[Period]*/ + "days.");
                 }
                 else
                 {
                     User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.InventoryFull, "NULL"));
                 }
             }
         }
         else
         {
             User.send(new Packets.PACKET_ITEMSHOP(Packets.PACKET_ITEMSHOP.ErrorCodes.CannotBeBougth, "NULL"));
         }
     }
     catch (Exception ex)
     {
         Log.AppendError(ex.Message);
     }
 }
Пример #2
0
        public override void Handle(ReBornWarRock_PServer.GameServer.Virtual_Objects.User.virtualUser User)
        {
            int UserID = Convert.ToInt32(getBlock(1));

            if (BanManager.isBlocked(UserID) == false)
            {
                string   LoginName   = getBlock(3);
                int      AccessLevel = Convert.ToInt32(getBlock(8));
                string[] UserData    = DB.runReadRow("SELECT id, username, nickname, exp, dinar, kills, deaths, premium, premiumExpire, cash, rank, coupons, todaycoupon, pc, clanID, clanrank, loginevent, logineventcheck, online, password, salt, country, infinity FROM users WHERE id='" + UserID + "' AND username='******'");
                string[] Event       = DB.runReadRow("SELECT userid, eventid FROM users_events WHERE userid='" + UserID + "'");

                if (UserData.Length > 0)
                {
                    if (Event.Length > 0)
                    {
                        if (Event[1] == "5")
                        {
                            User.ReceivedRandomBox = true;
                        }
                    }
                    User.UserID          = Convert.ToInt32(UserData[0]);
                    User.Username        = UserData[1];
                    User.Nickname        = UserData[2];
                    User.Exp             = Convert.ToInt32(UserData[3]);
                    User.Dinar           = Convert.ToInt32(UserData[4]);
                    User.Kills           = Convert.ToInt32(UserData[5]);
                    User.Deaths          = Convert.ToInt32(UserData[6]);
                    User.Premium         = Convert.ToInt32(UserData[7]);
                    User.PremiumExpire   = long.Parse(UserData[8]);
                    User.Cash            = Convert.ToInt32(UserData[9]);
                    User.Rank            = Convert.ToInt32(UserData[10]);
                    User.Coupons         = Convert.ToInt32(UserData[11]);
                    User.TodayCoupon     = Convert.ToInt32(UserData[12]);
                    User.PCItem          = (Convert.ToInt32(UserData[13]) == 1) ? true : false;
                    User.PCItem1         = (Convert.ToInt32(UserData[13]) == 2) ? true : false;
                    User.PCItem2         = (Convert.ToInt32(UserData[13]) == 3) ? true : false;
                    User.ClanID          = Convert.ToInt32(UserData[14]);
                    User.Country         = UserData[21];
                    User.InfinityPremium = int.Parse(UserData[22]);

                    User.LoginCountry = Structure.LookupModule.getCountry(User.IPAddr);

                    if (User.Country == "")
                    {
                        DB.runQuery("UPDATE users SET country='" + User.LoginCountry.getCode() + "' WHERE id='" + User.UserID + "'");

                        DB.runQuery("UPDATE countrys SET count=count+1 WHERE code='" + User.LoginCountry.getCode() + "'");
                    }

                    string[] HeadshotData = DB.runReadRow("SELECT headshots FROM users WHERE id='" + User.UserID + "'");

                    User.Headshots = Convert.ToInt32(HeadshotData[0]);

                    if (User.Rank > 4)
                    {
                        User.Nickname = "[GM]" + User.Nickname;
                    }
                    else if (User.Rank > 2)
                    {
                        User.Nickname = "[MOD]" + User.Nickname;
                    }
                    else if (User.Rank == 2)
                    {
                        User.Nickname = "[ESL]" + User.Nickname;
                    }

                    DB.runQuery("UPDATE users SET lasthwid='" + User.HWID + "' WHERE id='" + User.UserID + "'");
                    if (User.ClanID != -1)
                    {
                        User.ClanRank = Convert.ToInt32(UserData[15]);
                    }
                    User.LoginEvent      = Convert.ToInt32(UserData[16]);
                    User.LoginEventCheck = Convert.ToInt32(UserData[17]);
                    if (Convert.ToInt32(UserData[18]) == 1)
                    {
                        Log.AppendError(User.Nickname + " tried to double login!");
                        DB.runQuery("UPDATE users SET online='0' WHERE id='" + User.UserID + "'");
                        User.disconnect();
                    }

                    for (int I = 0; I < User.EndGameWord.Length; I++)
                    {
                        User.EndGameWord[I] = "/";
                    }

                    if (User.Rank > 1)
                    {
                        User.MaxSlots = 80;
                    }

                    if (Structure.Debug > 1 && User.Rank < 3)
                    {
                        User.send(new PACKET_CHAT(User, PACKET_CHAT.ChatType.Notice1, "NOTA: Stiamo facendo modifiche al server, attendere prego", User.SessionID, User.Nickname));
                        return;
                    }

                    User.uniqID      = Convert.ToInt32(getBlock(5)); // 1
                    User.uniqID2     = Convert.ToInt32(getBlock(6)); // 0
                    User.uniqIDisCRC = Convert.ToInt32(getBlock(7)); // 910
                    string LastJoin = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    DB.runQuery("UPDATE users SET lasthwid='" + User.HWID + "', lastjoin='" + LastJoin + "' WHERE id='" + User.UserID + "'");



                    DateTime current   = DateTime.Now;
                    int      StartTime = Convert.ToInt32(String.Format("{0:yyMMddHH}", current));

                    string[] Skin = DB.runReadRow("SELECT class_0,class_1,class_2,class_3,class_4 FROM users_costumes WHERE ownerid='" + User.UserID + "'");
                    if (Skin.Length > 0)
                    {
                        User.CostumeE = Skin[0];
                        User.CostumeM = Skin[1];
                        User.CostumeS = Skin[2];
                        User.CostumeA = Skin[3];
                        User.CostumeH = Skin[4];
                    }
                    else
                    {
                        DB.runQuery("INSERT INTO users_costumes(ownerid) VALUES ('" + User.UserID + "')");
                    }

                    if (User.ClanID != -1)
                    {
                        string[] Clan = DB.runReadRow("SELECT clanname, iconid FROM clans WHERE id='" + User.ClanID + "'");
                        if (Clan.Length > 0)
                        {
                            User.Clan       = ClanManager.getClan(User.ClanID);
                            User.ClanName   = Clan[0];
                            User.ClanIconID = Convert.ToInt32(Clan[1]);
                        }
                        string[] checkClanUser = DB.runReadRow("SELECT * FROM users WHERE clanrank='2' AND clanid='" + User.ClanID + "'");
                        if (checkClanUser.Length == 0)
                        {
                            DB.runQuery("UPDATE users SET clanrank='-1', clanid='-1' WHERE clanid='" + User.ClanID + "'");
                            DB.runQuery("DELETE FROM clans WHERE id='" + User.ClanID + "'");
                        }
                    }
                    else
                    {
                        DB.runQuery("UPDATE users SET clanID='-1', clanRank='1' WHERE id='" + User.UserID + "'");
                    }

                    bool isEventMessage = false;

                    for (int i = 0; i < 5; i++)
                    {
                        User.cCodes6th[i] = "^";
                    }

                    User.LoadItems();

                    int[] checkItemIDs = DB.runReadColumn("SELECT id FROM inventory WHERE ownerid='" + UserID.ToString() + "' AND deleted='0'", 0, null);
                    for (int I = 0; I < checkItemIDs.Length; I++)
                    {
                        string[] itemData = DB.runReadRow("SELECT expiredate, itemcode FROM inventory WHERE id=" + checkItemIDs[I].ToString());
                        if (Convert.ToInt32(itemData[0]) < StartTime)
                        {
                            int InvItems = 0;
                            foreach (InventoryItem _InvItem in User.Inventory)
                            {
                                if (_InvItem != null)
                                {
                                    InvItems++;
                                }
                            }
                            if (InvItems > User.MaxSlots)
                            {
                                DB.runQuery("DELETE FROM inventory WHERE ownerid='" + UserID.ToString() + "'");
                                User.send(new PACKET_CHAT("SYSTEM", PACKET_CHAT.ChatType.Room_ToAll, "SYSTEM >> Your inventory's was resetted due too many items!", 999, "NULL"));
                                User.Inventory = new InventoryItem[105];
                            }

                            string itemID = User.getInventoryID(itemData[1]);

                            DB.runQuery("DELETE FROM inventory WHERE ownerid='" + UserID.ToString() + "' AND itemcode='" + itemData[1] + "'");
                            User.LeftItems.Add(itemData[1]);
                            User.ExpiredWeapon = true;
                        }
                    }

                    int[] checkCostumeIDs = DB.runReadColumn("SELECT id FROM inventory_costume WHERE ownerid='" + UserID.ToString() + "' AND deleted='0'", 0, null);
                    for (int I = 0; I < checkCostumeIDs.Length; I++)
                    {
                        string[] itemData = DB.runReadRow("SELECT expiredate, itemcode FROM inventory_costume WHERE id=" + checkCostumeIDs[I].ToString());
                        if (Convert.ToInt32(itemData[0]) < StartTime)
                        {
                            int InvItems = 0;
                            foreach (CostumeItem _InvItem in User.Costume)
                            {
                                if (_InvItem != null)
                                {
                                    InvItems++;
                                }
                            }
                            if (InvItems > User.MaxSlots)
                            {
                                DB.runQuery("DELETE FROM inventory_costume WHERE ownerid='" + UserID.ToString() + "'");
                                User.send(new PACKET_CHAT("SYSTEM", PACKET_CHAT.ChatType.Room_ToAll, "SYSTEM >> Your costume's was resetted due too many items!", 999, "NULL"));
                                User.Costume = new CostumeItem[105];
                            }
                            DB.runQuery("DELETE FROM inventory_costume WHERE ownerid='" + UserID.ToString() + "' AND itemcode='" + itemData[1] + "'");
                            User.LeftItems.Add(itemData[1]);
                            User.ExpiredWeapon = true;
                        }
                    }


                    // Check for expired weapons

                    if (User.ExpiredWeapon == true)
                    {
                        User.LoadEquipment();
                        int ItemCount = User.LeftItems.Count;
                        foreach (string sItem in User.LeftItems)
                        {
                            string inventoryID = User.getInventoryID(sItem);
                            for (int Class = 0; Class < 5; Class++)
                            {
                                for (int Slot = 0; Slot < 8; Slot++)
                                {
                                    if (User.Equipment[Class, Slot].Contains(inventoryID))
                                    {
                                        User.Equipment[Class, Slot] = "^";
                                    }
                                }
                            }
                        }
                        User.SaveEquipment();
                        User.send(new PACKET_EXPIRE_ITEM(User));
                        User.reloadEquipment(ItemCount);
                        User.Inventory = new InventoryItem[105];
                        User.LoadItems();
                    }

                    User.CheckForFirstLogin();

                    /*Login Event*/
                    int  EventID      = 6;
                    bool EventEnabled = false;
                    if (User.CheckForEvent(EventID) == false && EventEnabled)
                    {
                        int InvItems = User.InventorySlots;

                        if (InvItems > 0)
                        {
                            User.AddOutBoxItem("CB09", -1, 1);
                            DB.runQuery("INSERT INTO users_events (eventid, userid) VALUES ('" + EventID + "','" + User.UserID + "')");
                        }
                        else
                        {
                            User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.InventoryFull, "NULL"));
                        }
                    }
                    User.PremiumTimeLeft();
                    User.LoadRetails();
                    User.KillEventLoad2();

                    User.send(new PACKET_CLIENT_PACKET(0)); // Welcome sound
                    UserManager.addUser(User);
                    if (isEventMessage == true)
                    {
                        User.send(new PACKET_MESSAGE_BOX("Check_your_inventory!_:)"));
                    }
                    User.send(new PACKET_CREDITS(User));
                    User.send(new PACKET_CHARACTER_INFO(User));
                    User.send(new PACKET_PING(User));
                    User.reloadCash();
                }
            }
            else
            {
                User.send(new PACKET_CHARACTER_INFO(73030));
                User.disconnect();
            }
        }
Пример #3
0
        public override void Handle(ReBornWarRock_PServer.GameServer.Virtual_Objects.User.virtualUser User)
        {
            try
            {
                int OPCode = Convert.ToInt32(getNextBlock());
                if (OPCode == 1113) // Item Shop Open
                {
                    User.reloadCash();
                    User.reloadOutBox();
                    User.reloadEquipment();
                    User.rebuildCostumeList();
                }
                else if (OPCode == 1111)
                {
                    string ItemCode = getBlock(4);
                    if (!User.hasItem(ItemCode))
                    {
                        User.disconnect();
                    }
                    if (ItemCode == "CB01")// Change Nick
                    {
                        string   NewNickname   = getBlock(5);
                        string[] checkUsedNick = DB.runReadRow("SELECT * FROM users WHERE nickname='" + NewNickname + "'");
                        if (checkUsedNick.Length == 0)
                        {
                            switch (User.Rank)
                            {
                            case 2: NewNickname = "[D]" + NewNickname; break;

                            case 3: NewNickname = "[MOD]" + NewNickname; break;

                            case 4: NewNickname = "[MOD]" + NewNickname; break;

                            case 5: NewNickname = "[GM]" + NewNickname; break;

                            case 6: NewNickname = "[GM]" + NewNickname; break;
                            }
                            Log.AppendText("---" + User.Nickname + " is now known as: " + NewNickname + "---");
                            User.Nickname = NewNickname;
                            User.send(new PACKET_CHANGE_NICKNAME(User, User.Nickname));
                            DB.runQuery("DELETE FROM inventory WHERE ownerid = '" + User.UserID + "' AND itemcode = 'CB01'");
                            DB.runQuery("UPDATE users SET nickname='" + NewNickname + "' WHERE id='" + User.UserID + "'");
                            User.Inventory = new InventoryItem[105];
                            User.send(new PACKET_DELETE_WEAPON(User, "CB01"));
                            User.LoadItems();
                            User.reloadCash();
                        }
                        else
                        {
                            User.send(new PACKET_CHANGE_NICKNAME());
                        }
                    }
                    else if (ItemCode == "CB03")
                    {
                        User.Kills  = 0;
                        User.Deaths = 0;
                        DB.runQuery("UPDATE users SET kills='0', deaths='0' WHERE id='" + User.UserID + "'");
                        DB.runQuery("DELETE FROM inventory WHERE ownerid='" + User.UserID + "' AND itemcode='CB03'");
                        User.Inventory = new InventoryItem[105];
                        User.LoadItems();
                        User.send(new PACKET_KILLDEATH_USE(User));
                    }
                    else if (ItemCode == "CZ99" || ItemCode == "CB09" || ItemCode == "CB27" || ItemCode == "CC36" || ItemCode == "CC37" || ItemCode == "CC56" || ItemCode == "CC57")
                    {
                        //if (ItemCode == "CB09" && User.hasItem("CB08") == false) return;
                        DB.runQuery("DELETE FROM inventory WHERE ownerid = '" + User.UserID + "' AND itemcode = '" + ItemCode + "'");
                        int    Rand = new Random().Next(0, 5);
                        string Code = null;
                        int    Days = 1;

                        if (ItemCode == "CB09")
                        {
                            if (Rand == 0)
                            {
                                Code = "DU04"; Days = 7;
                            }
                            else if (Rand == 1)
                            {
                                Code = "DF48"; Days = 15;
                            }
                            else if (Rand == 2)
                            {
                                Code = "CD02"; Days = 15;
                            }
                            else if (Rand == 3)
                            {
                                Code = "CD01"; Days = 15;
                            }
                            else if (Rand == 4)
                            {
                                Code = "DF35"; Days = 30;
                            }
                            else if (Rand == 5)
                            {
                                Code = "DC33"; Days = 30;
                            }
                        }
                        else if (ItemCode == "CB27")
                        {
                            if (Rand == 0)
                            {
                                Code = "DF06"; Days = 15;
                            }
                            else if (Rand == 1)
                            {
                                Code = "DF07"; Days = 15;
                            }
                            else if (Rand == 2)
                            {
                                Code = "DG08"; Days = 15;
                            }
                            else if (Rand == 3)
                            {
                                Code = "DC04"; Days = 15;
                            }
                            else if (Rand == 4)
                            {
                                Code = "DT02"; Days = 15;
                            }
                            else if (Rand == 5)
                            {
                                Code = "DG01"; Days = 15;
                            }
                        }
                        else if (ItemCode == "CC36")
                        {
                            if (Rand == 0)
                            {
                                Code = "DU04"; Days = 7;
                            }
                            else if (Rand == 1)
                            {
                                Code = "DF48"; Days = 15;
                            }
                            else if (Rand == 2)
                            {
                                Code = "CD02"; Days = 15;
                            }
                            else if (Rand == 3)
                            {
                                Code = "CD01"; Days = 15;
                            }
                            else if (Rand == 4)
                            {
                                Code = "DF35"; Days = 30;
                            }
                            else if (Rand == 5)
                            {
                                Code = "DC33"; Days = 30;
                            }
                        }
                        else if (ItemCode == "CC37")
                        {
                            if (Rand == 0)
                            {
                                Code = "DU04"; Days = 7;
                            }
                            else if (Rand == 1)
                            {
                                Code = "DF48"; Days = 15;
                            }
                            else if (Rand == 2)
                            {
                                Code = "CD02"; Days = 15;
                            }
                            else if (Rand == 3)
                            {
                                Code = "CD01"; Days = 15;
                            }
                            else if (Rand == 4)
                            {
                                Code = "DF35"; Days = 30;
                            }
                            else if (Rand == 5)
                            {
                                Code = "DC33"; Days = 30;
                            }
                        }
                        else if (ItemCode == "CZ99")
                        {
                            int[]    tableIDs = DB.runReadColumn("SELECT id FROM random_box_items;", 0, null);
                            int      id       = new Random().Next(1, tableIDs.Length);
                            string[] Data     = DB.runReadRow("SELECT * FROM `random_box_items` WHERE id=" + tableIDs[id]);
                            Code = Data[1];
                            Days = int.Parse(Data[2]);
                        }
                        else if (ItemCode == "CC56")
                        {
                            if (Rand == 0)
                            {
                                Code = "DU04"; Days = 7;
                            }
                            else if (Rand == 1)
                            {
                                Code = "DF48"; Days = 15;
                            }
                            else if (Rand == 2)
                            {
                                Code = "CD02"; Days = 15;
                            }
                            else if (Rand == 3)
                            {
                                Code = "CD01"; Days = 15;
                            }
                            else if (Rand == 4)
                            {
                                Code = "DF35"; Days = 30;
                            }
                            else if (Rand == 5)
                            {
                                Code = "DC33"; Days = 30;
                            }
                        }
                        else if (ItemCode == "CC57")
                        {
                            if (Rand == 0)
                            {
                                Code = "DU04"; Days = 7;
                            }
                            else if (Rand == 1)
                            {
                                Code = "DF48"; Days = 7;
                            }
                            else if (Rand == 2)
                            {
                                Code = "CD02"; Days = 15;
                            }
                            else if (Rand == 3)
                            {
                                Code = "CD01"; Days = 15;
                            }
                            else if (Rand == 4)
                            {
                                Code = "DF35"; Days = 30;
                            }
                            else if (Rand == 5)
                            {
                                Code = "DC33"; Days = 30;
                            }
                        }
                        User.AddOutBoxItem(Code, Days, 1);
                        User.Inventory = new InventoryItem[105];
                        User.LoadItems();
                        User.send(new PACKET_RANDOM_BOX(User, Code, Days));
                    }
                    else
                    {
                        Log.AppendError(" - Unknown ItemCode, blocks: " + string.Join(" ", getAllBlocks()));
                    }
                }
                else if (OPCode == 1110) // Buy with cash
                {
                    //1110 1110 2 3 0 750 DA03 0
                    int    Period      = Convert.ToInt32(getBlock(3));
                    int    CashToPay   = Convert.ToInt32(getBlock(5));
                    string ItemCode    = getBlock(6);
                    int    EACount     = 0;
                    int[]  convertDays = new int[6] {
                        3, 7, 15, 30, 1, -1
                    };

                    Item Item = ItemManager.getItem(ItemCode);
                    if (Item != null)
                    {
                        if (Item.Code == "CZ83" || Item.Code == "CZ84" || Item.Code == "CZ85")
                        {
                            if (Period == 0)
                            {
                                EACount = 1;
                            }
                            if (Period == 1)
                            {
                                EACount = 10;
                            }
                            if (Period == 2)
                            {
                                EACount = 30;
                            }
                        }
                        int Price = Item.getCashPrice(Period);
                        if (User.Cash < Price)
                        {
                            User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.NotEnoughDinar, "NULL"));
                        }
                        else if (LevelCalculator.getLevelforExp(User.Exp) < Item.Level && User.Rank < 2)
                        {
                            User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.LevelLow, "NULL"));
                        }
                        else if (User.Cash > Price && Item.Buyable == true && Price >= 0)
                        {
                            int InventorySlot = User.InventorySlots;
                            if (InventorySlot > 0)
                            {
                                #region military
                                string[] military = { "CR39", "CR09", "CR11" };
                                foreach (string x in military)
                                {
                                    if (ItemCode == x)
                                    {
                                        User.AddOutBoxItem(ItemCode, -1, 1); break;
                                    }
                                    ;
                                }
                                #endregion

                                #region SendItem
                                switch (ItemCode)
                                {
                                case "CB01":
                                {
                                    User.AddOutBoxItem(ItemCode, -1, 1);
                                    break;
                                }

                                case "CB03":
                                {
                                    User.AddOutBoxItem(ItemCode, -1, 1);
                                    break;
                                }

                                case "CB09":
                                {
                                    User.AddOutBoxItem(ItemCode, -1, 1);
                                    break;
                                }

                                case "CZ83":
                                {
                                    User.AddOutBoxItem(ItemCode, -1, EACount);
                                    break;
                                }

                                case "CZ84":
                                {
                                    User.AddOutBoxItem(ItemCode, -1, EACount);
                                    break;
                                }

                                case "CZ85":
                                {
                                    User.AddOutBoxItem(ItemCode, -1, EACount);
                                    break;
                                }

                                default:
                                {
                                    User.AddOutBoxItem(ItemCode, convertDays[Period], EACount);
                                    //User.AddItem(ItemCode, convertDays[Period]);
                                    break;
                                }
                                }
                                #endregion
                                User.Cash     -= Price;
                                User.Inventory = new InventoryItem[105];
                                DB.runQuery("UPDATE users SET cash='" + User.Cash + "' WHERE id='" + User.UserID + "'");
                                User.LoadItems();
                                User.send(new PACKET_OUTBOX_SEND(User));
                                Log.AppendText(User.Nickname + " has bought [" + Item.Code.ToUpper() + "-" + Item.Name + "] for " + convertDays[Period] + "days.");
                            }
                            else
                            {
                                User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.InventoryFull, "NULL"));
                            }
                        }
                        else
                        {
                            User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.CannotBeBougth, "NULL"));
                        }
                    }
                    else
                    {
                        if (ItemCode == "CB02" || ItemCode == "CB53" || ItemCode == "CB54")
                        {
                            User.send(new PACKET_CHAT("SYSTEM", PACKET_CHAT.ChatType.Whisper, "SYSTEM >> This item is available only on Webshop!", User.SessionID, User.Nickname));
                        }
                        Log.AppendError(User.Nickname + " tried to buy: " + ItemCode + " but is not available yet.");
                        User.send(new PACKET_ITEMSHOP(PACKET_ITEMSHOP.ErrorCodes.CannotBeBougth, "NULL"));
                    }
                }
                else
                {
                    Log.AppendText("New Cash ErrCode: " + OPCode);
                    Log.AppendText(string.Join(" ", getAllBlocks()));
                }
            }
            catch (Exception ex)
            {
                Log.AppendError("MySQL Error: " + ex.Message);
            }
        }