Esempio n. 1
0
 public void addToStreamEx(Bundle stream, ITEM_INFO v)
 {
     stream.writeUint64(v.UUID);
     stream.writeInt32(v.itemId);
     stream.writeUint32(v.itemCount);
     stream.writeInt32(v.itemIndex);
 }
Esempio n. 2
0
        public ITEM_INFO createFromStreamEx(MemoryStream stream)
        {
            ITEM_INFO datas = new ITEM_INFO();

            datas.UUID      = stream.readUint64();
            datas.itemId    = stream.readInt32();
            datas.itemCount = stream.readUint32();
            datas.itemIndex = stream.readInt32();
            return(datas);
        }
Esempio n. 3
0
        public override void onReqItemList(ITEM_INFO_LIST infos, ITEM_INFO_LIST equipInfos)
        {
            itemDict.Clear();
            List <ITEM_INFO> listinfos = infos.values;

            for (int i = 0; i < listinfos.Count; i++)
            {
                ITEM_INFO info = listinfos[i];
                itemDict.Add(info.UUID, info);
                itemIndex2Uids[info.itemIndex] = info.UUID;
            }
            equipItemDict.Clear();
            List <ITEM_INFO> elistinfos = equipInfos.values;

            for (int i = 0; i < elistinfos.Count; i++)
            {
                ITEM_INFO info = elistinfos[i];
                equipItemDict.Add(info.UUID, info);
                equipIndex2Uids[info.itemIndex] = info.UUID;
            }
            // ui event
            Event.fireOut("onReqItemList", new object[] { itemDict, equipItemDict });
        }
Esempio n. 4
0
        public override void equipItemRequest_re(ITEM_INFO itemInfo, ITEM_INFO equipItemInfo)
        {
            Event.fireOut("equipItemRequest_re", new object[] { itemInfo, equipItemInfo });
            UInt64 itemUUid      = itemInfo.UUID;
            UInt64 equipItemUUid = equipItemInfo.UUID;

            if (itemUUid == 0 && equipItemUUid != 0)//带上装备
            {
                equipItemDict[equipItemUUid] = equipItemInfo;
                itemDict.Remove(equipItemUUid);
            }
            else if (itemUUid != 0 && equipItemUUid != 0)//替换装备
            {
                itemDict.Remove(equipItemUUid);
                equipItemDict[equipItemUUid] = equipItemInfo;
                equipItemDict.Remove(itemUUid);
                itemDict[itemUUid] = itemInfo;
            }
            else if (itemUUid != 0 && equipItemUUid == 0)//脱下装备
            {
                equipItemDict.Remove(itemUUid);
                itemDict[itemUUid] = itemInfo;
            }
        }
Esempio n. 5
0
 public override void pickUp_re(ITEM_INFO itemInfo)
 {
     Event.fireOut("pickUp_re", new object[] { itemInfo });
     itemDict[itemInfo.UUID] = itemInfo;
 }
Esempio n. 6
0
        public override void onRemoteMethodCall(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Avatar"];

            UInt16 methodUtype            = 0;
            UInt16 componentPropertyUType = 0;

            if (sm.useMethodDescrAlias)
            {
                componentPropertyUType = stream.readUint8();
                methodUtype            = stream.readUint8();
            }
            else
            {
                componentPropertyUType = stream.readUint16();
                methodUtype            = stream.readUint16();
            }

            Method method = null;

            if (componentPropertyUType == 0)
            {
                method = sm.idmethods[methodUtype];
            }
            else
            {
                Property pComponentPropertyDescription = sm.idpropertys[componentPropertyUType];
                switch (pComponentPropertyDescription.properUtype)
                {
                default:
                    break;
                }

                return;
            }

            switch (method.methodUtype)
            {
            case 21:
                string ReceiveChatMessage_arg1 = stream.readUnicode();
                ReceiveChatMessage(ReceiveChatMessage_arg1);
                break;

            case 10104:
                dialog_close();
                break;

            case 10101:
                Int32         dialog_setContent_arg1 = stream.readInt32();
                List <UInt32> dialog_setContent_arg2 = ((DATATYPE_AnonymousArray_31)method.args[1]).createFromStreamEx(stream);
                List <string> dialog_setContent_arg3 = ((DATATYPE_AnonymousArray_32)method.args[2]).createFromStreamEx(stream);
                string        dialog_setContent_arg4 = stream.readUnicode();
                string        dialog_setContent_arg5 = stream.readUnicode();
                string        dialog_setContent_arg6 = stream.readUnicode();
                dialog_setContent(dialog_setContent_arg1, dialog_setContent_arg2, dialog_setContent_arg3, dialog_setContent_arg4, dialog_setContent_arg5, dialog_setContent_arg6);
                break;

            case 24:
                Int32  dropItem_re_arg1 = stream.readInt32();
                UInt64 dropItem_re_arg2 = stream.readUint64();
                dropItem_re(dropItem_re_arg1, dropItem_re_arg2);
                break;

            case 25:
                ITEM_INFO equipItemRequest_re_arg1 = ((DATATYPE_ITEM_INFO)method.args[0]).createFromStreamEx(stream);
                ITEM_INFO equipItemRequest_re_arg2 = ((DATATYPE_ITEM_INFO)method.args[1]).createFromStreamEx(stream);
                equipItemRequest_re(equipItemRequest_re_arg1, equipItemRequest_re_arg2);
                break;

            case 26:
                Int32 errorInfo_arg1 = stream.readInt32();
                errorInfo(errorInfo_arg1);
                break;

            case 31:
                Int32 onAddSkill_arg1 = stream.readInt32();
                onAddSkill(onAddSkill_arg1);
                break;

            case 32:
                Int32 onRemoveSkill_arg1 = stream.readInt32();
                onRemoveSkill(onRemoveSkill_arg1);
                break;

            case 22:
                ITEM_INFO_LIST onReqItemList_arg1 = ((DATATYPE_ITEM_INFO_LIST)method.args[0]).createFromStreamEx(stream);
                ITEM_INFO_LIST onReqItemList_arg2 = ((DATATYPE_ITEM_INFO_LIST)method.args[1]).createFromStreamEx(stream);
                onReqItemList(onReqItemList_arg1, onReqItemList_arg2);
                break;

            case 23:
                ITEM_INFO pickUp_re_arg1 = ((DATATYPE_ITEM_INFO)method.args[0]).createFromStreamEx(stream);
                pickUp_re(pickUp_re_arg1);
                break;

            case 35:
                Int32 recvDamage_arg1 = stream.readInt32();
                Int32 recvDamage_arg2 = stream.readInt32();
                Int32 recvDamage_arg3 = stream.readInt32();
                Int32 recvDamage_arg4 = stream.readInt32();
                recvDamage(recvDamage_arg1, recvDamage_arg2, recvDamage_arg3, recvDamage_arg4);
                break;

            default:
                break;
            }
            ;
        }
Esempio n. 7
0
 public abstract void pickUp_re(ITEM_INFO arg1);
Esempio n. 8
0
 public abstract void equipItemRequest_re(ITEM_INFO arg1, ITEM_INFO arg2);