public AVATAR_INFOS createFromStreamEx(MemoryStream stream)
        {
            AVATAR_INFOS datas = new AVATAR_INFOS();

            datas.dbid     = stream.readUint64();
            datas.Name     = stream.readUnicode();
            datas.RoleType = stream.readUint8();
            datas.Country  = stream.readUint8();
            datas.Sex      = stream.readUint8();
            datas.Level    = stream.readInt16();
            datas.Gold     = stream.readInt32();
            return(datas);
        }
Example #2
0
 static int readInt16(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         KBEngine.MemoryStream obj = (KBEngine.MemoryStream)ToLua.CheckObject <KBEngine.MemoryStream>(L, 1);
         short o = obj.readInt16();
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        public void onImportClientEntityDef(MemoryStream stream)
        {
            createDataTypeFromStreams(stream, true);

            while(stream.length() > 0)
            {
                string scriptmethod_name = stream.readString();
                UInt16 scriptUtype = stream.readUint16();
                UInt16 propertysize = stream.readUint16();
                UInt16 methodsize = stream.readUint16();
                UInt16 base_methodsize = stream.readUint16();
                UInt16 cell_methodsize = stream.readUint16();

                Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: import(" + scriptmethod_name + "), propertys(" + propertysize + "), " +
                        "clientMethods(" + methodsize + "), baseMethods(" + base_methodsize + "), cellMethods(" + cell_methodsize + ")!");

                ScriptModule module = new ScriptModule(scriptmethod_name);
                EntityDef.moduledefs[scriptmethod_name] = module;
                EntityDef.idmoduledefs[scriptUtype] = module;

                Type Class = module.script;

                while(propertysize > 0)
                {
                    propertysize--;

                    UInt16 properUtype = stream.readUint16();
                    UInt32 properFlags = stream.readUint32();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    string defaultValStr = stream.readString();
                    KBEDATATYPE_BASE utype = EntityDef.id2datatypes[stream.readUint16()];

                    System.Reflection.MethodInfo setmethod = null;

                    if(Class != null)
                    {
                        try{
                            setmethod = Class.GetMethod("set_" + name);
                        }
                        catch (Exception e)
                        {
                            string err = "KBEngine::Client_onImportClientEntityDef: " +
                                scriptmethod_name + ".set_" + name + ", error=" + e.ToString();

                            throw new Exception(err);
                        }
                    }

                    Property savedata = new Property();
                    savedata.name = name;
                    savedata.utype = utype;
                    savedata.properUtype = properUtype;
                    savedata.properFlags = properFlags;
                    savedata.aliasID = ialiasID;
                    savedata.defaultValStr = defaultValStr;
                    savedata.setmethod = setmethod;
                    savedata.val = savedata.utype.parseDefaultValStr(savedata.defaultValStr);

                    module.propertys[name] = savedata;

                    if(ialiasID >= 0)
                    {
                        module.usePropertyDescrAlias = true;
                        module.idpropertys[(UInt16)ialiasID] = savedata;
                    }
                    else
                    {
                        module.usePropertyDescrAlias = false;
                        module.idpropertys[properUtype] = savedata;
                    }

                    //Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), property(" + name + "/" + properUtype + ").");
                };

                while(methodsize > 0)
                {
                    methodsize--;

                    UInt16 methodUtype = stream.readUint16();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    Byte argssize = stream.readUint8();
                    List<KBEDATATYPE_BASE> args = new List<KBEDATATYPE_BASE>();

                    while(argssize > 0)
                    {
                        argssize--;
                        args.Add(EntityDef.id2datatypes[stream.readUint16()]);
                    };

                    Method savedata = new Method();
                    savedata.name = name;
                    savedata.methodUtype = methodUtype;
                    savedata.aliasID = ialiasID;
                    savedata.args = args;

                    if(Class != null)
                    {
                        try{
                            savedata.handler = Class.GetMethod(name);
                        }
                        catch (Exception e)
                        {
                            string err = "KBEngine::Client_onImportClientEntityDef: " + scriptmethod_name + "." + name + ", error=" + e.ToString();
                            throw new Exception(err);
                        }
                    }

                    module.methods[name] = savedata;

                    if(ialiasID >= 0)
                    {
                        module.useMethodDescrAlias = true;
                        module.idmethods[(UInt16)ialiasID] = savedata;
                    }
                    else
                    {
                        module.useMethodDescrAlias = false;
                        module.idmethods[methodUtype] = savedata;
                    }

                    //Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), method(" + name + ").");
                };

                while(base_methodsize > 0)
                {
                    base_methodsize--;

                    UInt16 methodUtype = stream.readUint16();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    Byte argssize = stream.readUint8();
                    List<KBEDATATYPE_BASE> args = new List<KBEDATATYPE_BASE>();

                    while(argssize > 0)
                    {
                        argssize--;
                        args.Add(EntityDef.id2datatypes[stream.readUint16()]);
                    };

                    Method savedata = new Method();
                    savedata.name = name;
                    savedata.methodUtype = methodUtype;
                    savedata.aliasID = ialiasID;
                    savedata.args = args;

                    module.base_methods[name] = savedata;
                    module.idbase_methods[methodUtype] = savedata;

                    //Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), base_method(" + name + ").");
                };

                while(cell_methodsize > 0)
                {
                    cell_methodsize--;

                    UInt16 methodUtype = stream.readUint16();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    Byte argssize = stream.readUint8();
                    List<KBEDATATYPE_BASE> args = new List<KBEDATATYPE_BASE>();

                    while(argssize > 0)
                    {
                        argssize--;
                        args.Add(EntityDef.id2datatypes[stream.readUint16()]);
                    };

                    Method savedata = new Method();
                    savedata.name = name;
                    savedata.methodUtype = methodUtype;
                    savedata.aliasID = ialiasID;
                    savedata.args = args;

                    module.cell_methods[name] = savedata;
                    module.idcell_methods[methodUtype] = savedata;
                    //Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), cell_method(" + name + ").");
                };

                if(module.script == null)
                {
                    Dbg.ERROR_MSG("KBEngine::Client_onImportClientEntityDef: module(" + scriptmethod_name + ") not found!");
                }

                foreach(string name in module.methods.Keys)
                {
                    // Method infos = module.methods[name];

                    if(module.script != null && module.script.GetMethod(name) == null)
                    {
                        Dbg.WARNING_MSG(scriptmethod_name + "(" + module.script + "):: method(" + name + ") no implement!");
                    }
                };
            }

            onImportEntityDefCompleted();
        }
Example #4
0
        public void Client_onImportClientEntityDef(MemoryStream stream)
        {
            UInt16 aliassize = stream.readUint16();
            Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: importAlias(size=" + aliassize + ")!");

            while(aliassize > 0)
            {
                aliassize--;
                createDataTypeFromStream(stream, true);
            };

            foreach(string datatype in EntityDef.datatypes.Keys)
            {
                if(EntityDef.datatypes[datatype] != null)
                {
                    EntityDef.datatypes[datatype].bind();
                }
            }

            while(stream.opsize() > 0)
            {
                string scriptmethod_name = stream.readString();
                UInt16 scriptUtype = stream.readUint16();
                UInt16 propertysize = stream.readUint16();
                UInt16 methodsize = stream.readUint16();
                UInt16 base_methodsize = stream.readUint16();
                UInt16 cell_methodsize = stream.readUint16();

                Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: import(" + scriptmethod_name + "), propertys(" + propertysize + "), " +
                        "clientMethods(" + methodsize + "), baseMethods(" + base_methodsize + "), cellMethods(" + cell_methodsize + ")!");

                ScriptModule module = new ScriptModule(scriptmethod_name);
                EntityDef.moduledefs[scriptmethod_name] = module;
                EntityDef.idmoduledefs[scriptUtype] = module;

                Dictionary<string, Property> defpropertys = new Dictionary<string, Property>();
                Entity.alldefpropertys.Add(scriptmethod_name, defpropertys);

                Type Class = module.script;

                while(propertysize > 0)
                {
                    propertysize--;

                    UInt16 properUtype = stream.readUint16();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    string defaultValStr = stream.readString();
                    KBEDATATYPE_BASE utype = EntityDef.iddatatypes[stream.readUint16()];

                    System.Reflection.MethodInfo setmethod = null;

                    if(Class != null)
                    {
                        setmethod = Class.GetMethod("set_" + name);
                    }

                    Property savedata = new Property();
                    savedata.name = name;
                    savedata.properUtype = properUtype;
                    savedata.aliasID = ialiasID;
                    savedata.defaultValStr = defaultValStr;
                    savedata.utype = utype;
                    savedata.setmethod = setmethod;

                    module.propertys[name] = savedata;

                    if(ialiasID >= 0)
                    {
                        module.usePropertyDescrAlias = true;
                        module.idpropertys[(UInt16)ialiasID] = savedata;
                    }
                    else
                    {
                        module.usePropertyDescrAlias = false;
                        module.idpropertys[properUtype] = savedata;
                    }

                    Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), property(" + name + "/" + properUtype + ").");
                };

                while(methodsize > 0)
                {
                    methodsize--;

                    UInt16 methodUtype = stream.readUint16();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    Byte argssize = stream.readUint8();
                    List<KBEDATATYPE_BASE> args = new List<KBEDATATYPE_BASE>();

                    while(argssize > 0)
                    {
                        argssize--;
                        args.Add(EntityDef.iddatatypes[stream.readUint16()]);
                    };

                    Method savedata = new Method();
                    savedata.name = name;
                    savedata.methodUtype = methodUtype;
                    savedata.aliasID = ialiasID;
                    savedata.args = args;

                    if(Class != null)
                        savedata.handler = Class.GetMethod(name);

                    module.methods[name] = savedata;

                    if(ialiasID >= 0)
                    {
                        module.useMethodDescrAlias = true;
                        module.idmethods[(UInt16)ialiasID] = savedata;
                    }
                    else
                    {
                        module.useMethodDescrAlias = false;
                        module.idmethods[methodUtype] = savedata;
                    }

                    Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), method(" + name + ").");
                };

                while(base_methodsize > 0)
                {
                    base_methodsize--;

                    UInt16 methodUtype = stream.readUint16();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    Byte argssize = stream.readUint8();
                    List<KBEDATATYPE_BASE> args = new List<KBEDATATYPE_BASE>();

                    while(argssize > 0)
                    {
                        argssize--;
                        args.Add(EntityDef.iddatatypes[stream.readUint16()]);
                    };

                    Method savedata = new Method();
                    savedata.name = name;
                    savedata.methodUtype = methodUtype;
                    savedata.aliasID = ialiasID;
                    savedata.args = args;

                    module.base_methods[name] = savedata;
                    module.idbase_methods[methodUtype] = savedata;

                    Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), base_method(" + name + ").");
                };

                while(cell_methodsize > 0)
                {
                    cell_methodsize--;

                    UInt16 methodUtype = stream.readUint16();
                    Int16 ialiasID = stream.readInt16();
                    string name = stream.readString();
                    Byte argssize = stream.readUint8();
                    List<KBEDATATYPE_BASE> args = new List<KBEDATATYPE_BASE>();

                    while(argssize > 0)
                    {
                        argssize--;
                        args.Add(EntityDef.iddatatypes[stream.readUint16()]);
                    };

                    Method savedata = new Method();
                    savedata.name = name;
                    savedata.methodUtype = methodUtype;
                    savedata.aliasID = ialiasID;
                    savedata.args = args;

                    module.cell_methods[name] = savedata;
                    module.idcell_methods[methodUtype] = savedata;
                    Dbg.DEBUG_MSG("KBEngine::Client_onImportClientEntityDef: add(" + scriptmethod_name + "), cell_method(" + name + ").");
                };

                if(module.script == null)
                {
                    Dbg.ERROR_MSG("KBEngine::Client_onImportClientEntityDef: module(" + scriptmethod_name + ") not found!");
                }

                foreach(string name in module.propertys.Keys)
                {
                    Property infos = module.propertys[name];

                    Property newp = new Property();
                    newp.name = infos.name;
                    newp.properUtype = infos.properUtype;
                    newp.aliasID = infos.aliasID;
                    newp.utype = infos.utype;
                    newp.val = infos.utype.parseDefaultValStr(infos.defaultValStr);
                    newp.setmethod = infos.setmethod;

                    defpropertys.Add(infos.name, newp);
                    if(module.script != null && module.script.GetMember(name) == null)
                    {
                        Dbg.ERROR_MSG(scriptmethod_name + "(" + module.script + "):: property(" + name + ") no defined!");
                    }
                };

                foreach(string name in module.methods.Keys)
                {
                    Method infos = module.methods[name];

                    if(module.script != null && module.script.GetMethod(name) == null)
                    {
                        Dbg.WARNING_MSG(scriptmethod_name + "(" + module.script + "):: method(" + name + ") no implement!");
                    }
                };
            }

            onImportEntityDefCompleted();
        }
Example #5
0
        public void process(byte[] datas, MessageLength length, Dictionary <uint, MessageHandler> flowHandler)
        {
            //Log.Net("process receive Data " + length + " state " + state);
            MessageLength totallen = 0;

            while (length > 0 && expectSize > 0)
            {
                if (state == READ_STATE.READ_STATE_FLAG)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        flag = stream.readUint8();
                        stream.clear();

                        state      = READ_STATE.READ_STATE_MSGLEN;
                        expectSize = 4;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }
                else if (state == READ_STATE.READ_STATE_MSGLEN)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        msglen = stream.readUint32();
                        stream.clear();

                        state      = READ_STATE.READ_STATE_FLOWID;
                        expectSize = 4;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }
                else if (state == READ_STATE.READ_STATE_FLOWID)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        flowId = stream.readUint32();
                        stream.clear();

                        state      = READ_STATE.READ_STATE_MODULEID;
                        expectSize = 1;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }
                else if (state == READ_STATE.READ_STATE_MODULEID)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        moduleId = stream.readUint8();
                        stream.clear();

                        state      = READ_STATE.READ_STATE_MSGID;
                        expectSize = 2;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }
                else if (state == READ_STATE.READ_STATE_MSGID)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        msgid = stream.readUint16();
                        stream.clear();

                        state      = READ_STATE.READ_STATE_RESPONSE_TIME;
                        expectSize = 4;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }
                else if (state == READ_STATE.READ_STATE_RESPONSE_TIME)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        responseTime = stream.readUint32();
                        stream.clear();

                        state      = READ_STATE.READ_STATE_RESPONSE_FLAG;
                        expectSize = 2;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }
                else if (state == READ_STATE.READ_STATE_RESPONSE_FLAG)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        responseFlag = stream.readInt16();
                        stream.clear();

                        state      = READ_STATE.READ_STATE_BODY;
                        expectSize = msglen - 4 - 1 - 2 - 4 - 2;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }

                /*
                 * body Can be empty
                 */
                if (state == READ_STATE.READ_STATE_BODY)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

                        /*
                         * No Handler Or PushMessage  forward To IPacketHandler
                         * Call Who's RPC Method Or Register Many RPC Method to Handle It ?
                         * [PushHandler]
                         * void GCPushSpriteInfo(Packet packet) {
                         * }
                         *
                         * PacketHandler namespace
                         * IPacketHandler---->GCPushSpriteInfo
                         */
                        MessageHandler handler = null;
                        if (flowHandler == null)
                        {
                            handler = msgHandle;
                        }
                        else if (flowHandler.ContainsKey(flowId))
                        {
                            handler = flowHandler [flowId];
                            flowHandler.Remove(flowId);
                        }



                        //Message msg = new Message();
                        IMessageLite pbmsg    = KBEngine.Message.handlePB(moduleId, msgid, stream);
                        Packet       p        = new Packet(flag, msglen, flowId, moduleId, msgid, responseTime, responseFlag, pbmsg);
                        var          fullName = pbmsg.GetType().FullName;
                        //Bundle.recvMsg.Add("recvMsg " + fullName + " : " + flowId);
                        //Log.Net("RecvMsg: "+fullName+" f "+flowId);

                        if (fullName.Contains("Push"))
                        {
                            //Log.Net("MessageReader Handler PushMessage");
                            if (mainLoop != null)
                            {
                                mainLoop.queueInLoop(delegate
                                {
                                    var handlerName = fullName.Replace("ChuMeng", "PacketHandler");
                                    var tp          = Type.GetType(handlerName);
                                    if (tp == null)
                                    {
                                        Debug.LogError("PushMessage noHandler " + handlerName);
                                    }
                                    else
                                    {
                                        //Debug.Log("Handler Push Message here "+handlerName);
                                        var ph = (PacketHandler.IPacketHandler)Activator.CreateInstance(tp);
                                        ph.HandlePacket(p);
                                    }
                                });
                            }
                        }
                        else if (handler != null)
                        {
                            mainLoop.queueInLoop(() => {
                                handler(p);
                            });
                        }
                        else
                        {
                            //flowHandler.Remove(flowId);
                            Debug.LogError("MessageReader::process No handler for flow Message " + msgid + " " + flowId + " " + pbmsg.GetType() + " " + pbmsg);
                        }



                        stream.clear();

                        state      = READ_STATE.READ_STATE_FLAG;
                        expectSize = 1;
                    }
                    else
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, length);
                        stream.wpos += (int)length;
                        expectSize  -= length;
                        break;
                    }
                }
            }

            if (responseFlag != 0)
            {
                Debug.LogError("MessageReader:: read Error Packet " + responseFlag);
            }

            //Log.Net("current state after " + state + " msglen " + msglen + " " + length);
            //Log.Net("MessageReader::  prop  flag" + flag + "  msglen " + msglen + " flowId " + flowId + " moduleId " + moduleId + " msgid " + msgid + " responseTime " + responseTime + " responseFlag " + responseFlag + " expectSize " + expectSize);
        }
Example #6
0
        public override void onRemoteMethodCall(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Account"];

            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 17:
                EntryFB();
                break;

            case 20:
                Int32 OnAttack_arg1 = stream.readInt32();
                Int32 OnAttack_arg2 = stream.readInt32();
                OnAttack(OnAttack_arg1, OnAttack_arg2);
                break;

            case 21:
                OnExitFb();
                break;

            case 19:
                Int32 OnMove_arg1 = stream.readInt32();
                Int32 OnMove_arg2 = stream.readInt32();
                Int32 OnMove_arg3 = stream.readInt32();
                OnMove(OnMove_arg1, OnMove_arg2, OnMove_arg3);
                break;

            case 18:
                Int16 OnStartRound_arg1 = stream.readInt16();
                Int32 OnStartRound_arg2 = stream.readInt32();
                OnStartRound(OnStartRound_arg1, OnStartRound_arg2);
                break;

            case 16:
                Int16 ReNameResult_arg1 = stream.readInt16();
                ReNameResult(ReNameResult_arg1);
                break;

            default:
                break;
            }
            ;
        }
Example #7
0
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Account"];
            Dictionary <UInt16, Property> pdatas = sm.idpropertys;

            while (stream.length() > 0)
            {
                UInt16 _t_utype       = 0;
                UInt16 _t_child_utype = 0;

                {
                    if (sm.usePropertyDescrAlias)
                    {
                        _t_utype       = stream.readUint8();
                        _t_child_utype = stream.readUint8();
                    }
                    else
                    {
                        _t_utype       = stream.readUint16();
                        _t_child_utype = stream.readUint16();
                    }
                }

                Property prop = null;

                if (_t_utype == 0)
                {
                    prop = pdatas[_t_child_utype];
                }
                else
                {
                    Property pComponentPropertyDescription = pdatas[_t_utype];
                    switch (pComponentPropertyDescription.properUtype)
                    {
                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 5:
                    Int16 oldval_CampType = CampType;
                    CampType = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCampTypeChanged(oldval_CampType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCampTypeChanged(oldval_CampType);
                        }
                    }

                    break;

                case 3:
                    CHESS_INFO_LIST oldval_MineChess = MineChess;
                    MineChess = ((DATATYPE_CHESS_INFO_LIST)EntityDef.id2datatypes[23]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMineChessChanged(oldval_MineChess);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMineChessChanged(oldval_MineChess);
                        }
                    }

                    break;

                case 2:
                    string oldval_RoleName = RoleName;
                    RoleName = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoleNameChanged(oldval_RoleName);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoleNameChanged(oldval_RoleName);
                        }
                    }

                    break;

                case 1:
                    Int16 oldval_RoleType = RoleType;
                    RoleType = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoleTypeChanged(oldval_RoleType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoleTypeChanged(oldval_RoleType);
                        }
                    }

                    break;

                case 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }

                    break;

                case 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                default:
                    break;
                }
                ;
            }
        }
Example #8
0
        public override void onUpdatePropertys(Property prop, MemoryStream stream)
        {
            switch (prop.properUtype)
            {
            case 40001:
                Vector3 oldval_direction = direction;
                direction = stream.readVector3();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onDirectionChanged(oldval_direction);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onDirectionChanged(oldval_direction);
                    }
                }

                break;

            case 23:
                List <Int32> oldval_hiddenCards = hiddenCards;
                hiddenCards = ((DATATYPE_AnonymousArray_31)EntityDef.id2datatypes[31]).createFromStreamEx(stream);

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onHiddenCardsChanged(oldval_hiddenCards);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onHiddenCardsChanged(oldval_hiddenCards);
                    }
                }

                break;

            case 24:
                List <Int32> oldval_hiddenCardsOpen = hiddenCardsOpen;
                hiddenCardsOpen = ((DATATYPE_AnonymousArray_32)EntityDef.id2datatypes[32]).createFromStreamEx(stream);

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onHiddenCardsOpenChanged(oldval_hiddenCardsOpen);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onHiddenCardsOpenChanged(oldval_hiddenCardsOpen);
                    }
                }

                break;

            case 25:
                Int16 oldval_highestPoint = highestPoint;
                highestPoint = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onHighestPointChanged(oldval_highestPoint);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onHighestPointChanged(oldval_highestPoint);
                    }
                }

                break;

            case 18:
                string oldval_intro = intro;
                intro = stream.readUnicode();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onIntroChanged(oldval_intro);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onIntroChanged(oldval_intro);
                    }
                }

                break;

            case 30:
                Int16 oldval_isGameOver = isGameOver;
                isGameOver = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onIsGameOverChanged(oldval_isGameOver);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onIsGameOverChanged(oldval_isGameOver);
                    }
                }

                break;

            case 19:
                Int16 oldval_isPlaying = isPlaying;
                isPlaying = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onIsPlayingChanged(oldval_isPlaying);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onIsPlayingChanged(oldval_isPlaying);
                    }
                }

                break;

            case 26:
                Int16 oldval_landlordIndex = landlordIndex;
                landlordIndex = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onLandlordIndexChanged(oldval_landlordIndex);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onLandlordIndexChanged(oldval_landlordIndex);
                    }
                }

                break;

            case 29:
                List <Int32> oldval_lastPlayCards = lastPlayCards;
                lastPlayCards = ((DATATYPE_AnonymousArray_33)EntityDef.id2datatypes[33]).createFromStreamEx(stream);

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onLastPlayCardsChanged(oldval_lastPlayCards);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onLastPlayCardsChanged(oldval_lastPlayCards);
                    }
                }

                break;

            case 28:
                Int16 oldval_lastPlayIndex = lastPlayIndex;
                lastPlayIndex = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onLastPlayIndexChanged(oldval_lastPlayIndex);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onLastPlayIndexChanged(oldval_lastPlayIndex);
                    }
                }

                break;

            case 17:
                string oldval_name = name;
                name = stream.readUnicode();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onNameChanged(oldval_name);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onNameChanged(oldval_name);
                    }
                }

                break;

            case 21:
                Int16 oldval_openCard = openCard;
                openCard = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onOpenCardChanged(oldval_openCard);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onOpenCardChanged(oldval_openCard);
                    }
                }

                break;

            case 27:
                Int16 oldval_playIndex = playIndex;
                playIndex = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onPlayIndexChanged(oldval_playIndex);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onPlayIndexChanged(oldval_playIndex);
                    }
                }

                break;

            case 40000:
                Vector3 oldval_position = position;
                position = stream.readVector3();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onPositionChanged(oldval_position);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onPositionChanged(oldval_position);
                    }
                }

                break;

            case 22:
                Int32 oldval_raiseIndex = raiseIndex;
                raiseIndex = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onRaiseIndexChanged(oldval_raiseIndex);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onRaiseIndexChanged(oldval_raiseIndex);
                    }
                }

                break;

            case 16:
                UInt64 oldval_roomKey = roomKey;
                roomKey = stream.readUint64();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onRoomKeyChanged(oldval_roomKey);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onRoomKeyChanged(oldval_roomKey);
                    }
                }

                break;

            case 20:
                SEATS_INFO oldval_seatsData = seatsData;
                seatsData = ((DATATYPE_SEATS_INFO)EntityDef.id2datatypes[23]).createFromStreamEx(stream);

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onSeatsDataChanged(oldval_seatsData);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onSeatsDataChanged(oldval_seatsData);
                    }
                }

                break;

            case 40002:
                stream.readUint32();
                break;

            default:
                break;
            }
            ;
        }
Example #9
0
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Avatar"];
            Dictionary <UInt16, Property> pdatas = sm.idpropertys;

            while (stream.length() > 0)
            {
                UInt16 _t_utype       = 0;
                UInt16 _t_child_utype = 0;

                {
                    if (sm.usePropertyDescrAlias)
                    {
                        _t_utype       = stream.readUint8();
                        _t_child_utype = stream.readUint8();
                    }
                    else
                    {
                        _t_utype       = stream.readUint16();
                        _t_child_utype = stream.readUint16();
                    }
                }

                Property prop = null;

                if (_t_utype == 0)
                {
                    prop = pdatas[_t_child_utype];
                }
                else
                {
                    Property pComponentPropertyDescription = pdatas[_t_utype];
                    switch (pComponentPropertyDescription.properUtype)
                    {
                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 20:
                    Byte oldval_Country = Country;
                    Country = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCountryChanged(oldval_Country);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCountryChanged(oldval_Country);
                        }
                    }

                    break;

                case 23:
                    Int32 oldval_Gold = Gold;
                    Gold = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onGoldChanged(oldval_Gold);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onGoldChanged(oldval_Gold);
                        }
                    }

                    break;

                case 22:
                    Int16 oldval_Level = Level;
                    Level = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onLevelChanged(oldval_Level);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onLevelChanged(oldval_Level);
                        }
                    }

                    break;

                case 18:
                    string oldval_PlayerName = PlayerName;
                    PlayerName = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerNameChanged(oldval_PlayerName);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerNameChanged(oldval_PlayerName);
                        }
                    }

                    break;

                case 19:
                    Byte oldval_RoleType = RoleType;
                    RoleType = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoleTypeChanged(oldval_RoleType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoleTypeChanged(oldval_RoleType);
                        }
                    }

                    break;

                case 21:
                    Byte oldval_Sex = Sex;
                    Sex = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onSexChanged(oldval_Sex);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onSexChanged(oldval_Sex);
                        }
                    }

                    break;

                case 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }

                    break;

                case 41006:
                    UInt32 oldval_modelID = modelID;
                    modelID = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onModelIDChanged(oldval_modelID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onModelIDChanged(oldval_modelID);
                        }
                    }

                    break;

                case 41007:
                    Byte oldval_modelScale = modelScale;
                    modelScale = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onModelScaleChanged(oldval_modelScale);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onModelScaleChanged(oldval_modelScale);
                        }
                    }

                    break;

                case 41003:
                    string oldval_name = name;
                    name = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onNameChanged(oldval_name);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onNameChanged(oldval_name);
                        }
                    }

                    break;

                case 24:
                    UInt16 oldval_own_val = own_val;
                    own_val = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onOwn_valChanged(oldval_own_val);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onOwn_valChanged(oldval_own_val);
                        }
                    }

                    break;

                case 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                case 41001:
                    UInt32 oldval_spaceUType = spaceUType;
                    spaceUType = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onSpaceUTypeChanged(oldval_spaceUType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onSpaceUTypeChanged(oldval_spaceUType);
                        }
                    }

                    break;

                case 41004:
                    UInt32 oldval_uid = uid;
                    uid = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onUidChanged(oldval_uid);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onUidChanged(oldval_uid);
                        }
                    }

                    break;

                case 41005:
                    UInt32 oldval_utype = utype;
                    utype = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onUtypeChanged(oldval_utype);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onUtypeChanged(oldval_utype);
                        }
                    }

                    break;

                default:
                    break;
                }
                ;
            }
        }
Example #10
0
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Avatar"];
            Dictionary <UInt16, Property> pdatas = sm.idpropertys;

            while (stream.length() > 0)
            {
                UInt16 _t_utype       = 0;
                UInt16 _t_child_utype = 0;

                {
                    if (sm.usePropertyDescrAlias)
                    {
                        _t_utype       = stream.readUint8();
                        _t_child_utype = stream.readUint8();
                    }
                    else
                    {
                        _t_utype       = stream.readUint16();
                        _t_child_utype = stream.readUint16();
                    }
                }

                Property prop = null;

                if (_t_utype == 0)
                {
                    prop = pdatas[_t_child_utype];
                }
                else
                {
                    Property pComponentPropertyDescription = pdatas[_t_utype];
                    switch (pComponentPropertyDescription.properUtype)
                    {
                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 17:
                    Byte oldval_CrystalAvaliable = CrystalAvaliable;
                    CrystalAvaliable = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCrystalAvaliableChanged(oldval_CrystalAvaliable);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCrystalAvaliableChanged(oldval_CrystalAvaliable);
                        }
                    }

                    break;

                case 16:
                    Byte oldval_CrystalSum = CrystalSum;
                    CrystalSum = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCrystalSumChanged(oldval_CrystalSum);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCrystalSumChanged(oldval_CrystalSum);
                        }
                    }

                    break;

                case 21:
                    Int16 oldval_HP = HP;
                    HP = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onHPChanged(oldval_HP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onHPChanged(oldval_HP);
                        }
                    }

                    break;

                case 11:
                    string oldval_NameA = NameA;
                    NameA = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onNameAChanged(oldval_NameA);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onNameAChanged(oldval_NameA);
                        }
                    }

                    break;

                case 12:
                    Byte oldval_RoleType = RoleType;
                    RoleType = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoleTypeChanged(oldval_RoleType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoleTypeChanged(oldval_RoleType);
                        }
                    }

                    break;

                case 13:
                    Byte oldval_Situation = Situation;
                    Situation = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onSituationChanged(oldval_Situation);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onSituationChanged(oldval_Situation);
                        }
                    }

                    break;

                case 23:
                    UInt16 oldval_armor = armor;
                    armor = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onArmorChanged(oldval_armor);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onArmorChanged(oldval_armor);
                        }
                    }

                    break;

                case 22:
                    UInt16 oldval_att = att;
                    att = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttChanged(oldval_att);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttChanged(oldval_att);
                        }
                    }

                    break;

                case 24:
                    UInt16 oldval_attSum = attSum;
                    attSum = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttSumChanged(oldval_attSum);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttSumChanged(oldval_attSum);
                        }
                    }

                    break;

                case 20:
                    UInt32 oldval_cardID = cardID;
                    cardID = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCardIDChanged(oldval_cardID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCardIDChanged(oldval_cardID);
                        }
                    }

                    break;

                case 25:
                    UInt16 oldval_cost = cost;
                    cost = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCostChanged(oldval_cost);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCostChanged(oldval_cost);
                        }
                    }

                    break;

                case 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }

                    break;

                case 36:
                    Byte oldval_frozen = frozen;
                    frozen = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onFrozenChanged(oldval_frozen);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onFrozenChanged(oldval_frozen);
                        }
                    }

                    break;

                case 37:
                    Byte oldval_immune = immune;
                    immune = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onImmuneChanged(oldval_immune);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onImmuneChanged(oldval_immune);
                        }
                    }

                    break;

                case 34:
                    Byte oldval_isAbled = isAbled;
                    isAbled = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsAbledChanged(oldval_isAbled);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsAbledChanged(oldval_isAbled);
                        }
                    }

                    break;

                case 33:
                    Byte oldval_isDivineShield = isDivineShield;
                    isDivineShield = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsDivineShieldChanged(oldval_isDivineShield);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsDivineShieldChanged(oldval_isDivineShield);
                        }
                    }

                    break;

                case 31:
                    Byte oldval_isRush = isRush;
                    isRush = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsRushChanged(oldval_isRush);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsRushChanged(oldval_isRush);
                        }
                    }

                    break;

                case 35:
                    Byte oldval_isStealth = isStealth;
                    isStealth = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsStealthChanged(oldval_isStealth);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsStealthChanged(oldval_isStealth);
                        }
                    }

                    break;

                case 30:
                    Byte oldval_isTaunt = isTaunt;
                    isTaunt = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsTauntChanged(oldval_isTaunt);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsTauntChanged(oldval_isTaunt);
                        }
                    }

                    break;

                case 32:
                    Byte oldval_isWindfury = isWindfury;
                    isWindfury = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsWindfuryChanged(oldval_isWindfury);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsWindfuryChanged(oldval_isWindfury);
                        }
                    }

                    break;

                case 29:
                    Byte oldval_maxHP = maxHP;
                    maxHP = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMaxHPChanged(oldval_maxHP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMaxHPChanged(oldval_maxHP);
                        }
                    }

                    break;

                case 27:
                    Byte oldval_playerID = playerID;
                    playerID = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerIDChanged(oldval_playerID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerIDChanged(oldval_playerID);
                        }
                    }

                    break;

                case 28:
                    string oldval_pos = pos;
                    pos = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPosChanged(oldval_pos);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPosChanged(oldval_pos);
                        }
                    }

                    break;

                case 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                case 26:
                    UInt16 oldval_type = type;
                    type = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onTypeChanged(oldval_type);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onTypeChanged(oldval_type);
                        }
                    }

                    break;

                default:
                    break;
                }
                ;
            }
        }
Example #11
0
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Account"];
            Dictionary <UInt16, Property> pdatas = sm.idpropertys;

            while (stream.length() > 0)
            {
                UInt16 _t_utype       = 0;
                UInt16 _t_child_utype = 0;

                {
                    if (sm.usePropertyDescrAlias)
                    {
                        _t_utype       = stream.readUint8();
                        _t_child_utype = stream.readUint8();
                    }
                    else
                    {
                        _t_utype       = stream.readUint16();
                        _t_child_utype = stream.readUint16();
                    }
                }

                Property prop = null;

                if (_t_utype == 0)
                {
                    prop = pdatas[_t_child_utype];
                }
                else
                {
                    Property pComponentPropertyDescription = pdatas[_t_utype];
                    switch (pComponentPropertyDescription.properUtype)
                    {
                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 6:
                    CARDGROUP_INFO_LIST oldval_CardGroupList = CardGroupList;
                    CardGroupList = ((DATATYPE_CARDGROUP_INFO_LIST)EntityDef.id2datatypes[29]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCardGroupListChanged(oldval_CardGroupList);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCardGroupListChanged(oldval_CardGroupList);
                        }
                    }

                    break;

                case 5:
                    CARD_LIST oldval_CardList = CardList;
                    CardList = ((DATATYPE_CARD_LIST)EntityDef.id2datatypes[24]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCardListChanged(oldval_CardList);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCardListChanged(oldval_CardList);
                        }
                    }

                    break;

                case 3:
                    Int32 oldval_Gold = Gold;
                    Gold = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onGoldChanged(oldval_Gold);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onGoldChanged(oldval_Gold);
                        }
                    }

                    break;

                case 4:
                    Int32 oldval_Kabao = Kabao;
                    Kabao = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onKabaoChanged(oldval_Kabao);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onKabaoChanged(oldval_Kabao);
                        }
                    }

                    break;

                case 2:
                    Int16 oldval_Level = Level;
                    Level = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onLevelChanged(oldval_Level);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onLevelChanged(oldval_Level);
                        }
                    }

                    break;

                case 1:
                    string oldval_Name = Name;
                    Name = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onNameChanged(oldval_Name);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onNameChanged(oldval_Name);
                        }
                    }

                    break;

                case 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }

                    break;

                case 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                default:
                    break;
                }
                ;
            }
        }
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Account"];
            Dictionary <UInt16, Property> pdatas = sm.idpropertys;

            while (stream.length() > 0)
            {
                UInt16 _t_utype       = 0;
                UInt16 _t_child_utype = 0;

                {
                    if (sm.usePropertyDescrAlias)
                    {
                        _t_utype       = stream.readUint8();
                        _t_child_utype = stream.readUint8();
                    }
                    else
                    {
                        _t_utype       = stream.readUint16();
                        _t_child_utype = stream.readUint16();
                    }
                }

                Property prop = null;

                if (_t_utype == 0)
                {
                    prop = pdatas[_t_child_utype];
                }
                else
                {
                    Property pComponentPropertyDescription = pdatas[_t_utype];
                    switch (pComponentPropertyDescription.properUtype)
                    {
                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 16:
                    ITEM_LIST oldval_bagItemList = bagItemList;
                    bagItemList = ((DATATYPE_ITEM_LIST)EntityDef.id2datatypes[23]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onBagItemListChanged(oldval_bagItemList);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onBagItemListChanged(oldval_bagItemList);
                        }
                    }

                    break;

                case 17:
                    EQUIP_DICT oldval_currentItemDict = currentItemDict;
                    currentItemDict = ((DATATYPE_EQUIP_DICT)EntityDef.id2datatypes[24]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCurrentItemDictChanged(oldval_currentItemDict);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCurrentItemDictChanged(oldval_currentItemDict);
                        }
                    }

                    break;

                case 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }

                    break;

                case 8:
                    Int32 oldval_gold = gold;
                    gold = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onGoldChanged(oldval_gold);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onGoldChanged(oldval_gold);
                        }
                    }

                    break;

                case 3:
                    SByte oldval_lastLoginDate = lastLoginDate;
                    lastLoginDate = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onLastLoginDateChanged(oldval_lastLoginDate);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onLastLoginDateChanged(oldval_lastLoginDate);
                        }
                    }

                    break;

                case 7:
                    Int16 oldval_lastLoginDayLoginTimes = lastLoginDayLoginTimes;
                    lastLoginDayLoginTimes = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onLastLoginDayLoginTimesChanged(oldval_lastLoginDayLoginTimes);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onLastLoginDayLoginTimesChanged(oldval_lastLoginDayLoginTimes);
                        }
                    }

                    break;

                case 5:
                    Int16 oldval_lastLoginDayPlayTime = lastLoginDayPlayTime;
                    lastLoginDayPlayTime = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onLastLoginDayPlayTimeChanged(oldval_lastLoginDayPlayTime);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onLastLoginDayPlayTimeChanged(oldval_lastLoginDayPlayTime);
                        }
                    }

                    break;

                case 2:
                    string oldval_nameS = nameS;
                    nameS = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onNameSChanged(oldval_nameS);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onNameSChanged(oldval_nameS);
                        }
                    }

                    break;

                case 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }

                    break;

                case 13:
                    Int32 oldval_progress = progress;
                    progress = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onProgressChanged(oldval_progress);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onProgressChanged(oldval_progress);
                        }
                    }

                    break;

                case 15:
                    Int32 oldval_roomNo = roomNo;
                    roomNo = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoomNoChanged(oldval_roomNo);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoomNoChanged(oldval_roomNo);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                case 6:
                    Int16 oldval_totalLoginTimes = totalLoginTimes;
                    totalLoginTimes = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onTotalLoginTimesChanged(oldval_totalLoginTimes);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onTotalLoginTimesChanged(oldval_totalLoginTimes);
                        }
                    }

                    break;

                case 4:
                    Int16 oldval_totalPlayTime = totalPlayTime;
                    totalPlayTime = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onTotalPlayTimeChanged(oldval_totalPlayTime);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onTotalPlayTimeChanged(oldval_totalPlayTime);
                        }
                    }

                    break;

                default:
                    break;
                }
                ;
            }
        }
        public override void onUpdatePropertys(Property prop, MemoryStream stream)
        {
            switch (prop.properUtype)
            {
            case 2:
                Int16 oldval_dbid = dbid;
                dbid = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onDbidChanged(oldval_dbid);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onDbidChanged(oldval_dbid);
                    }
                }

                break;

            case 40001:
                Vector3 oldval_direction = direction;
                direction = stream.readVector3();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onDirectionChanged(oldval_direction);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onDirectionChanged(oldval_direction);
                    }
                }

                break;

            case 15:
                Int32 oldval_gameResult = gameResult;
                gameResult = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onGameResultChanged(oldval_gameResult);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onGameResultChanged(oldval_gameResult);
                    }
                }

                break;

            case 11:
                List <Int32> oldval_handCards = handCards;
                handCards = ((DATATYPE_AnonymousArray_31)EntityDef.id2datatypes[31]).createFromStreamEx(stream);

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onHandCardsChanged(oldval_handCards);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onHandCardsChanged(oldval_handCards);
                    }
                }

                break;

            case 12:
                Int32 oldval_handCardsCount = handCardsCount;
                handCardsCount = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onHandCardsCountChanged(oldval_handCardsCount);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onHandCardsCountChanged(oldval_handCardsCount);
                    }
                }

                break;

            case 7:
                Int32 oldval_loseCount = loseCount;
                loseCount = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onLoseCountChanged(oldval_loseCount);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onLoseCountChanged(oldval_loseCount);
                    }
                }

                break;

            case 8:
                Int32 oldval_loseCountC = loseCountC;
                loseCountC = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onLoseCountCChanged(oldval_loseCountC);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onLoseCountCChanged(oldval_loseCountC);
                    }
                }

                break;

            case 14:
                Int32 oldval_message = message;
                message = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onMessageChanged(oldval_message);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onMessageChanged(oldval_message);
                    }
                }

                break;

            case 16:
                Byte oldval_modelID = modelID;
                modelID = stream.readUint8();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onModelIDChanged(oldval_modelID);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onModelIDChanged(oldval_modelID);
                    }
                }

                break;

            case 3:
                string oldval_name = name;
                name = stream.readUnicode();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onNameChanged(oldval_name);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onNameChanged(oldval_name);
                    }
                }

                break;

            case 4:
                string oldval_nameC = nameC;
                nameC = stream.readUnicode();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onNameCChanged(oldval_nameC);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onNameCChanged(oldval_nameC);
                    }
                }

                break;

            case 13:
                List <Int32> oldval_playCards = playCards;
                playCards = ((DATATYPE_AnonymousArray_32)EntityDef.id2datatypes[32]).createFromStreamEx(stream);

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onPlayCardsChanged(oldval_playCards);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onPlayCardsChanged(oldval_playCards);
                    }
                }

                break;

            case 40000:
                Vector3 oldval_position = position;
                position = stream.readVector3();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onPositionChanged(oldval_position);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onPositionChanged(oldval_position);
                    }
                }

                break;

            case 1:
                UInt64 oldval_roomKey = roomKey;
                roomKey = stream.readUint64();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onRoomKeyChanged(oldval_roomKey);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onRoomKeyChanged(oldval_roomKey);
                    }
                }

                break;

            case 10:
                Int16 oldval_seatIndex = seatIndex;
                seatIndex = stream.readInt16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onSeatIndexChanged(oldval_seatIndex);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onSeatIndexChanged(oldval_seatIndex);
                    }
                }

                break;

            case 40002:
                stream.readUint32();
                break;

            case 5:
                Int32 oldval_winCount = winCount;
                winCount = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onWinCountChanged(oldval_winCount);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onWinCountChanged(oldval_winCount);
                    }
                }

                break;

            case 6:
                Int32 oldval_winCountC = winCountC;
                winCountC = stream.readInt32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onWinCountCChanged(oldval_winCountC);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onWinCountCChanged(oldval_winCountC);
                    }
                }

                break;

            default:
                break;
            }
            ;
        }
Example #14
0
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["CardInfo"];
            Dictionary <UInt16, Property> pdatas = sm.idpropertys;

            while (stream.length() > 0)
            {
                UInt16 _t_utype       = 0;
                UInt16 _t_child_utype = 0;

                {
                    if (sm.usePropertyDescrAlias)
                    {
                        _t_utype       = stream.readUint8();
                        _t_child_utype = stream.readUint8();
                    }
                    else
                    {
                        _t_utype       = stream.readUint16();
                        _t_child_utype = stream.readUint16();
                    }
                }

                Property prop = null;

                if (_t_utype == 0)
                {
                    prop = pdatas[_t_child_utype];
                }
                else
                {
                    Property pComponentPropertyDescription = pdatas[_t_utype];
                    switch (pComponentPropertyDescription.properUtype)
                    {
                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 42:
                    Int16 oldval_HP = HP;
                    HP = stream.readInt16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onHPChanged(oldval_HP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onHPChanged(oldval_HP);
                        }
                    }

                    break;

                case 44:
                    UInt16 oldval_armor = armor;
                    armor = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onArmorChanged(oldval_armor);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onArmorChanged(oldval_armor);
                        }
                    }

                    break;

                case 43:
                    UInt16 oldval_att = att;
                    att = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttChanged(oldval_att);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttChanged(oldval_att);
                        }
                    }

                    break;

                case 45:
                    UInt16 oldval_attSum = attSum;
                    attSum = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttSumChanged(oldval_attSum);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttSumChanged(oldval_attSum);
                        }
                    }

                    break;

                case 41:
                    UInt32 oldval_cardID = cardID;
                    cardID = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCardIDChanged(oldval_cardID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCardIDChanged(oldval_cardID);
                        }
                    }

                    break;

                case 46:
                    UInt16 oldval_cost = cost;
                    cost = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCostChanged(oldval_cost);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCostChanged(oldval_cost);
                        }
                    }

                    break;

                case 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDirectionChanged(oldval_direction);
                        }
                    }

                    break;

                case 57:
                    Byte oldval_frozen = frozen;
                    frozen = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onFrozenChanged(oldval_frozen);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onFrozenChanged(oldval_frozen);
                        }
                    }

                    break;

                case 58:
                    Byte oldval_immune = immune;
                    immune = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onImmuneChanged(oldval_immune);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onImmuneChanged(oldval_immune);
                        }
                    }

                    break;

                case 55:
                    Byte oldval_isAbled = isAbled;
                    isAbled = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsAbledChanged(oldval_isAbled);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsAbledChanged(oldval_isAbled);
                        }
                    }

                    break;

                case 54:
                    Byte oldval_isDivineShield = isDivineShield;
                    isDivineShield = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsDivineShieldChanged(oldval_isDivineShield);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsDivineShieldChanged(oldval_isDivineShield);
                        }
                    }

                    break;

                case 52:
                    Byte oldval_isRush = isRush;
                    isRush = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsRushChanged(oldval_isRush);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsRushChanged(oldval_isRush);
                        }
                    }

                    break;

                case 56:
                    Byte oldval_isStealth = isStealth;
                    isStealth = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsStealthChanged(oldval_isStealth);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsStealthChanged(oldval_isStealth);
                        }
                    }

                    break;

                case 51:
                    Byte oldval_isTaunt = isTaunt;
                    isTaunt = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsTauntChanged(oldval_isTaunt);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsTauntChanged(oldval_isTaunt);
                        }
                    }

                    break;

                case 53:
                    Byte oldval_isWindfury = isWindfury;
                    isWindfury = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsWindfuryChanged(oldval_isWindfury);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsWindfuryChanged(oldval_isWindfury);
                        }
                    }

                    break;

                case 50:
                    Byte oldval_maxHP = maxHP;
                    maxHP = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMaxHPChanged(oldval_maxHP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMaxHPChanged(oldval_maxHP);
                        }
                    }

                    break;

                case 48:
                    Byte oldval_playerID = playerID;
                    playerID = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerIDChanged(oldval_playerID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerIDChanged(oldval_playerID);
                        }
                    }

                    break;

                case 49:
                    string oldval_pos = pos;
                    pos = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPosChanged(oldval_pos);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPosChanged(oldval_pos);
                        }
                    }

                    break;

                case 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPositionChanged(oldval_position);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                case 47:
                    UInt16 oldval_type = type;
                    type = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onTypeChanged(oldval_type);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onTypeChanged(oldval_type);
                        }
                    }

                    break;

                default:
                    break;
                }
                ;
            }
        }
        public void onImportClientMessages(MemoryStream stream)
        {
            UInt16 msgcount = stream.readUint16();

            Dbg.DEBUG_MSG(string.Format("KBEngine::Client_onImportClientMessages: start currserver=" + currserver + "(msgsize={0})...", msgcount));

            while(msgcount > 0)
            {
                msgcount--;

                MessageID msgid = stream.readUint16();
                Int16 msglen = stream.readInt16();

                string msgname = stream.readString();
                sbyte argstype = stream.readInt8();
                Byte argsize = stream.readUint8();
                List<Byte> argstypes = new List<Byte>();

                for(Byte i=0; i<argsize; i++)
                {
                    argstypes.Add(stream.readUint8());
                }

                System.Reflection.MethodInfo handler = null;
                bool isClientMethod = msgname.Contains("Client_");

                if(isClientMethod)
                {
                    handler = typeof(KBEngineApp).GetMethod(msgname);
                    if(handler == null)
                    {
                        Dbg.WARNING_MSG(string.Format("KBEngine::onImportClientMessages[{0}]: interface({1}/{2}/{3}) no implement!",
                            currserver, msgname, msgid, msglen));

                        handler = null;
                    }
                    else
                    {
                        //Dbg.DEBUG_MSG(string.Format("KBEngine::onImportClientMessages: imported({0}/{1}/{2}) successfully!",
                        //	msgname, msgid, msglen));
                    }
                }

                if(msgname.Length > 0)
                {
                    Message.messages[msgname] = new Message(msgid, msgname, msglen, argstype, argstypes, handler);

                    //if(!isClientMethod)
                    //	Dbg.DEBUG_MSG(string.Format("KBEngine::onImportClientMessages[{0}]: imported({1}/{2}/{3}) successfully!",
                    //		currserver, msgname, msgid, msglen));

                    if(isClientMethod)
                    {
                        Message.clientMessages[msgid] = Message.messages[msgname];
                    }
                    else
                    {
                        if(currserver == "loginapp")
                            Message.loginappMessages[msgid] = Message.messages[msgname];
                        else
                            Message.baseappMessages[msgid] = Message.messages[msgname];
                    }
                }
                else
                {
                    Message msg = new Message(msgid, msgname, msglen, argstype, argstypes, handler);

                    //if(!isClientMethod)
                    //	Dbg.DEBUG_MSG(string.Format("KBEngine::onImportClientMessages[{0}]: imported({1}/{2}/{3}) successfully!",
                    //		currserver, msgname, msgid, msglen));

                    if(currserver == "loginapp")
                        Message.loginappMessages[msgid] = msg;
                    else
                        Message.baseappMessages[msgid] = msg;
                }
            };

            onImportClientMessagesCompleted();
        }
 public override object createFromStream(MemoryStream stream)
 {
     return(stream.readInt16());
 }
		public override object createFromStream(MemoryStream stream)
		{
			return stream.readInt16();
		}