Exemplo n.º 1
0
        public static ItemBase DecodeItemData(ClientConnection pConnection, MaplePacket pPacket)
        {
            byte     type = pPacket.ReadByte();
            ItemBase ret  = null;

            switch (type)
            {
            case 1:
                ret        = new ItemEquip();
                ret.Amount = 1;
                break;

            case 2: ret = new ItemRechargable(); break;

            case 3:
                ret        = new ItemPet();
                ret.Amount = 1;
                break;

            default:
            {
                Logger.WriteLine("Unkown ItemType: {0}", type);
                return(null);
            }
            }

            ret.Decode(pConnection, pPacket);

            return(ret);
        }
Exemplo n.º 2
0
        public static ItemBase DecodeItemData(ClientConnection pConnection, MaplePacket pPacket)
        {
            byte type = pPacket.ReadByte();
            ItemBase ret = null;
            switch (type)
            {
                case 1:
                    ret = new ItemEquip();
                    ret.Amount = 1;
                    break;
                case 2: ret = new ItemRechargable(); break;
                case 3:
                    ret = new ItemPet();
                    ret.Amount = 1;
                    break;
                default:
                    {
                        Logger.WriteLine("Unkown ItemType: {0}", type);
                        return null;
                    }
            }

            ret.Decode(pConnection, pPacket);

            return ret;
        }
Exemplo n.º 3
0
 public static void SavePet(int pCharacterInternalID, ItemPet pPet, InsertQueryBuilder pInsertBuilder)
 {
     if (!pInsertBuilder.HasColumns)
     {
         pInsertBuilder.OnDuplicateUpdate = true;
         pInsertBuilder.AddColumn("character_id", false);
         pInsertBuilder.AddColumn("cashid", false);
         pInsertBuilder.AddColumn("name", true);
         pInsertBuilder.AddColumn("closeness", true);
         pInsertBuilder.AddColumn("fullness", true);
         pInsertBuilder.AddColumn("level", true);
     }
     pInsertBuilder.AddRow(pCharacterInternalID, pPet.CashID, pPet.Petname, pPet.Closeness, pPet.Fullness, pPet.Level);
 }
Exemplo n.º 4
0
        public static void SavePet(int pCharacterInternalID, ItemPet pPet, InsertQueryBuilder pInsertBuilder)
        {
            if (!pInsertBuilder.HasColumns)
            {
                pInsertBuilder.OnDuplicateUpdate = true;
                pInsertBuilder.AddColumn("character_id", false);
                pInsertBuilder.AddColumn("cashid", false);
                pInsertBuilder.AddColumn("name", true);
                pInsertBuilder.AddColumn("closeness", true);
                pInsertBuilder.AddColumn("fullness", true);
                pInsertBuilder.AddColumn("level", true);
            }
            pInsertBuilder.AddRow(pCharacterInternalID, pPet.CashID, pPet.Petname, pPet.Closeness, pPet.Fullness, pPet.Level);

        }