OZ-Network server - Inventory and Shop fix!

Results 1 to 1 of 1
  1. #1
    Member yomega is offline
    MemberRank
    Apr 2012 Join Date
    75Posts

    OZ-Network server - Inventory and Shop fix!

    To fix use this: Game.network.clientpacket.PROTOCOL_INTENTORY_ENTER_REQ
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Game.Network.ServerPacket;
    using Core.Model;
    
    namespace Game.Network.ClientPacket
    {
        class PROTOCOL_INVENTORY_ENTER_REQ : ReceivePacket
        {
            private int test;
            public PROTOCOL_INVENTORY_ENTER_REQ(GameNetwork Client, byte[] data)
            {
                makeme(Client, data);
            }
            public override void ReadImpl()
            {
                
            }
            public override void RunImpl()
            {
                
                Room room = getClient().getPlayer().getRoom();
    
                if (room == null)
                {
                    Logger.Info("You aren't in a room!");
                   
                    getClient().SendPacket(new PROTOCOL_INVENTORY_ENTER_ACK());
                }
    
                else
                {
                    Logger.Info("You are in a room!");
                    getClient().getPlayer().getRoom().getRoomSlotByPlayer(getClient().getPlayer()).setState(SLOT_STATE.SLOT_STATE_INVENTORY);
                    getClient().SendPacket(new PROTOCOL_INVENTORY_ENTER_ACK());
                }   
    		}
        }
    }
    game.network.clientpacket.PROTOCOL_INVENTORY_ENTER_REQ
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Game.Network.ServerPacket;
    using Core.Model;
    using Core.Database.Tables;
    
    namespace Game.Network.ClientPacket
    {
        class PROTOCOL_INVENTORY_LEAVE_REQ : ReceivePacket
        {
            public PROTOCOL_INVENTORY_LEAVE_REQ(GameNetwork Client, byte[] data)
            {
                makeme(Client, data);
            }
    
            private int type;
            public override void ReadImpl()
            {
                Player player = getClient().getPlayer();
                type = ReadD(); // Тип одеваемых предметов
                if (type == 3)
                { // если 3 - оружие + скины, маски, береты - 40 байт
                    PlayerEquipTable.EquipAllSlots(player.AccountID, ReadD(), ReadD(), ReadD(), ReadD(), ReadD(), ReadD(), ReadD(), ReadD(), ReadD(), ReadD());
    
    
                }
                else if (type == 2)
                { // если 2 - оружие - 20 байт
                    PlayerEquipTable.EquipWeaponsSlots(player.AccountID, ReadD(), ReadD(), ReadD(), ReadD(), ReadD());
    
                }
                else if (type == 1)
                { // если 1 - скины, маски, береты - 20 байт
                    PlayerEquipTable.EquipArmorsSlots(player.AccountID, ReadD(), ReadD(), ReadD(), ReadD(), ReadD());
                }
            }
            public override void RunImpl()
            {
                Room room = getClient().getPlayer().getRoom();
                if (room == null)
                {
                    Logger.Info("You aren't in a room!");
    
                    getClient().SendPacket(new PROTOCOL_INVENTORY_LEAVE_ACK());
                }
    
                else
                {
                    Logger.Info("You are in a room!");
                    getClient().getPlayer().getRoom().getRoomSlotByPlayer(getClient().getPlayer()).setState(SLOT_STATE.SLOT_STATE_NORMAL);
                    getClient().SendPacket(new PROTOCOL_INVENTORY_LEAVE_ACK());
                }
                
            }
        }
    }
    game.network.clientpacket.PROTOCOL_SHOP_ENTER_REQ

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Game.Network.ServerPacket;
    using Core.Model;
    
    namespace Game.Network.ClientPacket
    {
        class PROTOCOL_SHOP_ENTER_REQ : ReceivePacket
        {
            public PROTOCOL_SHOP_ENTER_REQ(GameNetwork Client, byte[] data)
            {
                makeme(Client, data);
            }
            public override void ReadImpl()
            {
            }
            public override void RunImpl()
            {
                
                Room room = getClient().getPlayer().getRoom();
    
                if (room == null)
                {
                    Logger.Info("You aren't in a room!");
    
                    getClient().SendPacket(new PROTOCOL_SHOP_ENTER_ACK());
                }
    
                else
                {
                    Logger.Info("You are in a room!");
                    getClient().getPlayer().getRoom().getRoomSlotByPlayer(getClient().getPlayer()).setState(SLOT_STATE.SLOT_STATE_SHOP);
                    getClient().SendPacket(new PROTOCOL_SHOP_ENTER_ACK());
                }
            }
        }
    }
    game.network.clientpacket.PROTOCOL_SHOP_LEAVE_REQ
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Game.Network.ServerPacket;
    using Core.Model;
    
    namespace Game.Network.ClientPacket
    {
        class PROTOCOL_SHOP_LEAVE_REQ : ReceivePacket
        {
            public PROTOCOL_SHOP_LEAVE_REQ(GameNetwork Client, byte[] data)
            {
                makeme(Client, data);
            }
    
            public override void ReadImpl()
            {
            }
            public override void RunImpl()
            {
                Room room = getClient().getPlayer().getRoom();
                if (room == null)
                {
                    Logger.Info("You aren't in a room!");
    
                    getClient().SendPacket(new PROTOCOL_SHOP_LEAVE_ACK());
                }
    
                else
                {
                    Logger.Info("You are in a room!");
                    getClient().getPlayer().getRoom().getRoomSlotByPlayer(getClient().getPlayer()).setState(SLOT_STATE.SLOT_STATE_NORMAL);
                    getClient().SendPacket(new PROTOCOL_SHOP_LEAVE_ACK());
                }
               
            }
        }
    }
    Last edited by yomega; 03-07-15 at 08:57 AM. Reason: Shop fix added!




Advertisement