Exemple #1
0
        public override object createFromStream(MemoryStream stream)
        {
            UInt32 size = stream.readUint32();
            List<object> datas = new List<object>();

            while(size > 0)
            {
                size--;
                datas.Add(((KBEDATATYPE_BASE)type).createFromStream(stream));
            };

            return datas;
        }
Exemple #2
0
 static int readUint32(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         KBEngine.MemoryStream obj = (KBEngine.MemoryStream)ToLua.CheckObject <KBEngine.MemoryStream>(L, 1);
         uint o = obj.readUint32();
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        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;
                }
                ;
            }
        }
Exemple #4
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 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:
                    FRIENDLIST oldval_friendList = friendList;
                    friendList = ((DATATYPE_FRIENDLIST)EntityDef.id2datatypes[24]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onFriendListChanged(oldval_friendList);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onFriendListChanged(oldval_friendList);
                        }
                    }

                    break;

                case 3:
                    Int32 oldval_playerBean = playerBean;
                    playerBean = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerBeanChanged(oldval_playerBean);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerBeanChanged(oldval_playerBean);
                        }
                    }

                    break;

                case 6:
                    ENTITYDATA oldval_playerData = playerData;
                    playerData = ((DATATYPE_ENTITYDATA)EntityDef.id2datatypes[25]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerDataChanged(oldval_playerData);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerDataChanged(oldval_playerData);
                        }
                    }

                    break;

                case 2:
                    UInt16 oldval_playerId = playerId;
                    playerId = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerIdChanged(oldval_playerId);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerIdChanged(oldval_playerId);
                        }
                    }

                    break;

                case 1:
                    string oldval_playerName = playerName;
                    playerName = stream.readUnicode();

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

                    break;

                case 4:
                    Byte oldval_playerNew = playerNew;
                    playerNew = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerNewChanged(oldval_playerNew);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerNewChanged(oldval_playerNew);
                        }
                    }

                    break;

                case 7:
                    POKERLIST oldval_playerPoker = playerPoker;
                    playerPoker = ((DATATYPE_POKERLIST)EntityDef.id2datatypes[23]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerPokerChanged(oldval_playerPoker);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerPokerChanged(oldval_playerPoker);
                        }
                    }

                    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 5:
                    Byte oldval_roomIndex = roomIndex;
                    roomIndex = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoomIndexChanged(oldval_roomIndex);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoomIndexChanged(oldval_roomIndex);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                default:
                    break;
                }
                ;
            }
        }
Exemple #5
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;
            }
            ;
        }
Exemple #6
0
        public override void process(byte[] datas, MessageLengthEx offset, MessageLengthEx length)
        {
            MessageLengthEx totallen = offset;

            while (length > 0 && expectSize > 0)
            {
                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();

                        Message msg = Messages.clientMessages[msgid];

                        if (msg.msglen == -1)
                        {
                            state      = READ_STATE.READ_STATE_MSGLEN;
                            expectSize = 2;
                        }
                        else if (msg.msglen == 0)
                        {
                            // 如果是0个参数的消息,那么没有后续内容可读了,处理本条消息并且直接跳到下一条消息
                                                        #if UNITY_EDITOR
                            Dbg.profileStart(msg.name);
                                                        #endif

                            msg.handleMessage(stream);

                                                        #if UNITY_EDITOR
                            Dbg.profileEnd(msg.name);
                                                        #endif

                            state      = READ_STATE.READ_STATE_MSGID;
                            expectSize = 2;
                        }
                        else
                        {
                            expectSize = (MessageLengthEx)msg.msglen;
                            state      = READ_STATE.READ_STATE_BODY;
                        }
                    }
                    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.readUint16();
                        stream.clear();

                        // 长度扩展
                        if (msglen >= 65535)
                        {
                            state      = READ_STATE.READ_STATE_MSGLEN_EX;
                            expectSize = 4;
                        }
                        else
                        {
                            state      = READ_STATE.READ_STATE_BODY;
                            expectSize = msglen;
                        }
                    }
                    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_EX)
                {
                    if (length >= expectSize)
                    {
                        Array.Copy(datas, totallen, stream.data(), stream.wpos, expectSize);
                        totallen    += expectSize;
                        stream.wpos += (int)expectSize;
                        length      -= expectSize;

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

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

                        Message msg = Messages.clientMessages[msgid];

#if UNITY_EDITOR
                        Dbg.profileStart(msg.name);
#endif

                        msg.handleMessage(stream);
#if UNITY_EDITOR
                        Dbg.profileEnd(msg.name);
#endif

                        stream.clear();

                        state      = READ_STATE.READ_STATE_MSGID;
                        expectSize = 2;
                    }
                    else
                    {
                        stream.append(datas, totallen, length);
                        expectSize -= length;
                        break;
                    }
                }
            }
        }
Exemple #7
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 32:
                UInt32 oldval_launchID = launchID;
                launchID = stream.readUint32();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onLaunchIDChanged(oldval_launchID);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onLaunchIDChanged(oldval_launchID);
                    }
                }

                break;

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

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

                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["City"];
			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 7:
						Int64 oldval_BusinessDvelopment = BusinessDvelopment;
						BusinessDvelopment = stream.readInt64();

						if(prop.isBase())
						{
							if(inited)
								onBusinessDvelopmentChanged(oldval_BusinessDvelopment);
						}
						else
						{
							if(inWorld)
								onBusinessDvelopmentChanged(oldval_BusinessDvelopment);
						}

						break;
					case 6:
						Byte oldval_CityCountry = CityCountry;
						CityCountry = stream.readUint8();

						if(prop.isBase())
						{
							if(inited)
								onCityCountryChanged(oldval_CityCountry);
						}
						else
						{
							if(inWorld)
								onCityCountryChanged(oldval_CityCountry);
						}

						break;
					case 3:
						UInt32 oldval_CityID = CityID;
						CityID = stream.readUint32();

						if(prop.isBase())
						{
							if(inited)
								onCityIDChanged(oldval_CityID);
						}
						else
						{
							if(inWorld)
								onCityIDChanged(oldval_CityID);
						}

						break;
					case 4:
						string oldval_CityName = CityName;
						CityName = stream.readUnicode();

						if(prop.isBase())
						{
							if(inited)
								onCityNameChanged(oldval_CityName);
						}
						else
						{
							if(inWorld)
								onCityNameChanged(oldval_CityName);
						}

						break;
					case 5:
						Byte oldval_CityType = CityType;
						CityType = stream.readUint8();

						if(prop.isBase())
						{
							if(inited)
								onCityTypeChanged(oldval_CityType);
						}
						else
						{
							if(inWorld)
								onCityTypeChanged(oldval_CityType);
						}

						break;
					case 8:
						Int64 oldval_MilitaryDvelopment = MilitaryDvelopment;
						MilitaryDvelopment = stream.readInt64();

						if(prop.isBase())
						{
							if(inited)
								onMilitaryDvelopmentChanged(oldval_MilitaryDvelopment);
						}
						else
						{
							if(inWorld)
								onMilitaryDvelopmentChanged(oldval_MilitaryDvelopment);
						}

						break;
					case 9:
						CITY_SELL_GOODS_LIST oldval_SellGoodsList = SellGoodsList;
						SellGoodsList = ((DATATYPE_CITY_SELL_GOODS_LIST)EntityDef.id2datatypes[23]).createFromStreamEx(stream);

						if(prop.isBase())
						{
							if(inited)
								onSellGoodsListChanged(oldval_SellGoodsList);
						}
						else
						{
							if(inWorld)
								onSellGoodsListChanged(oldval_SellGoodsList);
						}

						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;
				};
			}
		}
        /*
            服务端初始化客户端的spacedata, spacedata请参考API
        */
        public void Client_initSpaceData(MemoryStream stream)
        {
            clearSpace(false);
            spaceID = stream.readUint32();

            while(stream.length() > 0)
            {
                string key = stream.readString();
                string val = stream.readString();
                Client_setSpaceData(spaceID, key, val);
            }

            Dbg.DEBUG_MSG("KBEngine::Client_initSpaceData: spaceID(" + spaceID + "), size(" + _spacedatas.Count + ")!");
        }
Exemple #10
0
        public override void onUpdatePropertys(Property prop, MemoryStream stream)
        {
            switch (prop.properUtype)
            {
            case 21:
                UInt16 oldval_anYeYiYangGold = anYeYiYangGold;
                anYeYiYangGold = stream.readUint16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onAnYeYiYangGoldChanged(oldval_anYeYiYangGold);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onAnYeYiYangGoldChanged(oldval_anYeYiYangGold);
                    }
                }

                break;

            case 18:
                string oldval_animState = animState;
                animState = stream.readUnicode();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onAnimStateChanged(oldval_animState);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onAnimStateChanged(oldval_animState);
                    }
                }

                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 13:
                UInt16 oldval_goldNum = goldNum;
                goldNum = stream.readUint16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onGoldNumChanged(oldval_goldNum);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onGoldNumChanged(oldval_goldNum);
                    }
                }

                break;

            case 20:
                UInt16 oldval_jiaSuGold = jiaSuGold;
                jiaSuGold = stream.readUint16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onJiaSuGoldChanged(oldval_jiaSuGold);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onJiaSuGoldChanged(oldval_jiaSuGold);
                    }
                }

                break;

            case 19:
                UInt16 oldval_keepJiaSuTime = keepJiaSuTime;
                keepJiaSuTime = stream.readUint16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onKeepJiaSuTimeChanged(oldval_keepJiaSuTime);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onKeepJiaSuTimeChanged(oldval_keepJiaSuTime);
                    }
                }

                break;

            case 14:
                float oldval_moveSpeed = moveSpeed;
                moveSpeed = stream.readFloat();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onMoveSpeedChanged(oldval_moveSpeed);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onMoveSpeedChanged(oldval_moveSpeed);
                    }
                }

                break;

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

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

                break;

            case 23:
                UInt16 oldval_nanShangJiaNanGold = nanShangJiaNanGold;
                nanShangJiaNanGold = stream.readUint16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onNanShangJiaNanGoldChanged(oldval_nanShangJiaNanGold);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onNanShangJiaNanGoldChanged(oldval_nanShangJiaNanGold);
                    }
                }

                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 12:
                Byte oldval_track = track;
                track = stream.readUint8();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onTrackChanged(oldval_track);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onTrackChanged(oldval_track);
                    }
                }

                break;

            case 22:
                UInt16 oldval_xiaCiYiDingGold = xiaCiYiDingGold;
                xiaCiYiDingGold = stream.readUint16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onXiaCiYiDingGoldChanged(oldval_xiaCiYiDingGold);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onXiaCiYiDingGoldChanged(oldval_xiaCiYiDingGold);
                    }
                }

                break;

            default:
                break;
            }
            ;
        }
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Room"];
            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 8:
                    Byte oldval_RoomType = RoomType;
                    RoomType = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoomTypeChanged(oldval_RoomType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoomTypeChanged(oldval_RoomType);
                        }
                    }

                    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 10:
                    Byte oldval_playerMaxCount = playerMaxCount;
                    playerMaxCount = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerMaxCountChanged(oldval_playerMaxCount);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerMaxCountChanged(oldval_playerMaxCount);
                        }
                    }

                    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 7:
                    UInt64 oldval_roomKey = roomKey;
                    roomKey = stream.readUint64();

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

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                default:
                    break;
                }
                ;
            }
        }
Exemple #12
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 48005:
                    UInt32 oldval_Die_Count = Die_Count;
                    Die_Count = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDie_CountChanged(oldval_Die_Count);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDie_CountChanged(oldval_Die_Count);
                        }
                    }

                    break;

                case 47005:
                    Int32 oldval_EXP = EXP;
                    EXP = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onEXPChanged(oldval_EXP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onEXPChanged(oldval_EXP);
                        }
                    }

                    break;

                case 47006:
                    Int32 oldval_EXP_Max = EXP_Max;
                    EXP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onEXP_MaxChanged(oldval_EXP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onEXP_MaxChanged(oldval_EXP_Max);
                        }
                    }

                    break;

                case 47001:
                    Int32 oldval_HP = HP;
                    HP = stream.readInt32();

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

                    break;

                case 47002:
                    Int32 oldval_HP_Max = HP_Max;
                    HP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }

                    break;

                case 48006:
                    UInt32 oldval_Kill_Count = Kill_Count;
                    Kill_Count = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onKill_CountChanged(oldval_Kill_Count);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onKill_CountChanged(oldval_Kill_Count);
                        }
                    }

                    break;

                case 47003:
                    Int32 oldval_MP = MP;
                    MP = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }

                    break;

                case 47004:
                    Int32 oldval_MP_Max = MP_Max;
                    MP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }

                    break;

                case 48003:
                    UInt32 oldval_Rank = Rank;
                    Rank = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRankChanged(oldval_Rank);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRankChanged(oldval_Rank);
                        }
                    }

                    break;

                case 48001:
                    Int32 oldval_Round = Round;
                    Round = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoundChanged(oldval_Round);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoundChanged(oldval_Round);
                        }
                    }

                    break;

                case 48002:
                    Int32 oldval_Round_Max = Round_Max;
                    Round_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRound_MaxChanged(oldval_Round_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRound_MaxChanged(oldval_Round_Max);
                        }
                    }

                    break;

                case 48004:
                    UInt32 oldval_Score = Score;
                    Score = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onScoreChanged(oldval_Score);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onScoreChanged(oldval_Score);
                        }
                    }

                    break;

                case 12:
                    UInt16 oldval_cruiseSpeed = cruiseSpeed;
                    cruiseSpeed = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCruiseSpeedChanged(oldval_cruiseSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCruiseSpeedChanged(oldval_cruiseSpeed);
                        }
                    }

                    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 41002:
                    UInt16 oldval_level = level;
                    level = stream.readUint16();

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

                    break;

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

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

                    break;

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

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

                    break;

                case 11:
                    UInt16 oldval_moveSpeed = moveSpeed;
                    moveSpeed = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }

                    break;

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

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

                    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 42008:
                    UInt32 oldval_spaceUType = spaceUType;
                    spaceUType = stream.readUint32();

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

                    break;

                case 44006:
                    SByte oldval_state = state;
                    state = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStateChanged(oldval_state);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStateChanged(oldval_state);
                        }
                    }

                    break;

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

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

                    break;

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

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

                    break;

                default:
                    break;
                }
                ;
            }
        }
Exemple #13
0
        public override void onRemoteMethodCall(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Avatar"];

            UInt16 methodUtype            = 0;
            UInt16 componentPropertyUType = 0;

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

            Method method = null;

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

                return;
            }

            switch (method.methodUtype)
            {
            case 61003:
                UInt16 canUseWeaponResult_arg1 = stream.readUint16();
                Byte   canUseWeaponResult_arg2 = stream.readUint8();
                canUseWeaponResult(canUseWeaponResult_arg1, canUseWeaponResult_arg2);
                break;

            case 17:
                onJump();
                break;

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

            case 22:
                UInt32 recvPropEffect_arg1 = stream.readUint32();
                Int32  recvPropEffect_arg2 = stream.readInt32();
                recvPropEffect(recvPropEffect_arg1, recvPropEffect_arg2);
                break;

            default:
                break;
            }
            ;
        }
Exemple #14
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;
                }
                ;
            }
        }
Exemple #15
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)
                    {
                    case 16:
                        component1.onUpdatePropertys(_t_child_utype, stream, -1);
                        break;

                    case 21:
                        component2.onUpdatePropertys(_t_child_utype, stream, -1);
                        break;

                    case 22:
                        component3.onUpdatePropertys(_t_child_utype, stream, -1);
                        break;

                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 47001:
                    Int32 oldval_HP = HP;
                    HP = stream.readInt32();

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

                    break;

                case 47002:
                    Int32 oldval_HP_Max = HP_Max;
                    HP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }

                    break;

                case 47003:
                    Int32 oldval_MP = MP;
                    MP = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }

                    break;

                case 47004:
                    Int32 oldval_MP_Max = MP_Max;
                    MP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }

                    break;

                case 16:
                    component1.createFromStream(stream);
                    break;

                case 21:
                    component2.createFromStream(stream);
                    break;

                case 22:
                    component3.createFromStream(stream);
                    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 47005:
                    Int32 oldval_forbids = forbids;
                    forbids = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onForbidsChanged(oldval_forbids);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onForbidsChanged(oldval_forbids);
                        }
                    }

                    break;

                case 41002:
                    UInt16 oldval_level = level;
                    level = stream.readUint16();

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

                    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 11:
                    Byte oldval_moveSpeed = moveSpeed;
                    moveSpeed = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }

                    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 6:
                    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 47006:
                    SByte oldval_state = state;
                    state = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStateChanged(oldval_state);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStateChanged(oldval_state);
                        }
                    }

                    break;

                case 47007:
                    Byte oldval_subState = subState;
                    subState = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onSubStateChanged(oldval_subState);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onSubStateChanged(oldval_subState);
                        }
                    }

                    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;
                }
                ;
            }
        }
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Space"];
            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 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 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 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;
                }
                ;
            }
        }
Exemple #17
0
        public override void onUpdatePropertys(Property prop, MemoryStream stream)
        {
            switch (prop.properUtype)
            {
            case 4:
                FRIEND_INFO_LIST oldval_Friend_list = Friend_list;
                Friend_list = ((DATATYPE_FRIEND_INFO_LIST)EntityDef.id2datatypes[23]).createFromStreamEx(stream);

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onFriend_listChanged(oldval_Friend_list);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onFriend_listChanged(oldval_Friend_list);
                    }
                }

                break;

            case 3:
                UInt16 oldval_Icon = Icon;
                Icon = stream.readUint16();

                if (prop.isBase())
                {
                    if (inited)
                    {
                        onIconChanged(oldval_Icon);
                    }
                }
                else
                {
                    if (inWorld)
                    {
                        onIconChanged(oldval_Icon);
                    }
                }

                break;

            case 2:
                Byte oldval_Level = Level;
                Level = stream.readUint8();

                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 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

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

                    break;

                case 5:
                    Byte oldval_isNewPlayer = isNewPlayer;
                    isNewPlayer = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onIsNewPlayerChanged(oldval_isNewPlayer);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onIsNewPlayerChanged(oldval_isNewPlayer);
                        }
                    }

                    break;

                case 4:
                    UInt16 oldval_playerID = playerID;
                    playerID = stream.readUint16();

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

                    break;

                case 2:
                    UInt16 oldval_playerID_base = playerID_base;
                    playerID_base = stream.readUint16();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerID_baseChanged(oldval_playerID_base);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerID_baseChanged(oldval_playerID_base);
                        }
                    }

                    break;

                case 3:
                    string oldval_playerName = playerName;
                    playerName = stream.readUnicode();

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

                    break;

                case 1:
                    string oldval_playerName_base = playerName_base;
                    playerName_base = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerName_baseChanged(oldval_playerName_base);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerName_baseChanged(oldval_playerName_base);
                        }
                    }

                    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;
                }
                ;
            }
        }
Exemple #19
0
        public override void onRemoteMethodCall(Method method, MemoryStream stream)
        {
            switch (method.methodUtype)
            {
            case 26:
                backToMain();
                break;

            case 25:
                enterBattleSpace();
                break;

            case 18:
                UInt32 reqAddFriendMessage_arg1 = stream.readUint32();
                string reqAddFriendMessage_arg2 = stream.readUnicode();
                reqAddFriendMessage(reqAddFriendMessage_arg1, reqAddFriendMessage_arg2);
                break;

            case 17:
                string reqChangeNameCall_arg1 = stream.readUnicode();
                reqChangeNameCall(reqChangeNameCall_arg1);
                break;

            case 21:
                UInt32 reqEnterMatchRoomMessage_arg1 = stream.readUint32();
                string reqEnterMatchRoomMessage_arg2 = stream.readUnicode();
                reqEnterMatchRoomMessage(reqEnterMatchRoomMessage_arg1, reqEnterMatchRoomMessage_arg2);
                break;

            case 16:
                string reqMessageCall_arg1 = stream.readUnicode();
                reqMessageCall(reqMessageCall_arg1);
                break;

            case 24:
                string reqShowMatching_arg1 = stream.readUnicode();
                reqShowMatching(reqShowMatching_arg1);
                break;

            case 20:
                UInt64 reqUpdateFriendChatting_arg1 = stream.readUint64();
                string reqUpdateFriendChatting_arg2 = stream.readUnicode();
                reqUpdateFriendChatting(reqUpdateFriendChatting_arg1, reqUpdateFriendChatting_arg2);
                break;

            case 19:
                reqUpdateFriendListUI();
                break;

            case 23:
                string reqUpdateMatchRoomChatting_arg1 = stream.readUnicode();
                string reqUpdateMatchRoomChatting_arg2 = stream.readUnicode();
                reqUpdateMatchRoomChatting(reqUpdateMatchRoomChatting_arg1, reqUpdateMatchRoomChatting_arg2);
                break;

            case 22:
                FRIEND_INFO_LIST reqUpdateMatchRoomUI_arg1 = ((DATATYPE_FRIEND_INFO_LIST)method.args[0]).createFromStreamEx(stream);
                reqUpdateMatchRoomUI(reqUpdateMatchRoomUI_arg1);
                break;

            default:
                break;
            }
            ;
        }
        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 47001:
                    Int32 oldval_HP = HP;
                    HP = stream.readInt32();

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

                    break;

                case 47002:
                    Int32 oldval_HP_Max = HP_Max;
                    HP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }

                    break;

                case 47003:
                    Int32 oldval_MP = MP;
                    MP = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }

                    break;

                case 47004:
                    Int32 oldval_MP_Max = MP_Max;
                    MP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }

                    break;

                case 17:
                    Int32 oldval_attack_Max = attack_Max;
                    attack_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttack_MaxChanged(oldval_attack_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttack_MaxChanged(oldval_attack_Max);
                        }
                    }

                    break;

                case 18:
                    Int32 oldval_attack_Min = attack_Min;
                    attack_Min = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttack_MinChanged(oldval_attack_Min);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttack_MinChanged(oldval_attack_Min);
                        }
                    }

                    break;

                case 19:
                    Int32 oldval_defence = defence;
                    defence = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDefenceChanged(oldval_defence);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDefenceChanged(oldval_defence);
                        }
                    }

                    break;

                case 25:
                    Int32 oldval_dexterity = dexterity;
                    dexterity = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDexterityChanged(oldval_dexterity);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDexterityChanged(oldval_dexterity);
                        }
                    }

                    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 21:
                    Int32 oldval_dodge = dodge;
                    dodge = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDodgeChanged(oldval_dodge);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDodgeChanged(oldval_dodge);
                        }
                    }

                    break;

                case 7:
                    ITEM_INFO_LIST oldval_equipItemList = equipItemList;
                    equipItemList = ((DATATYPE_ITEM_INFO_LIST)EntityDef.id2datatypes[28]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onEquipItemListChanged(oldval_equipItemList);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onEquipItemListChanged(oldval_equipItemList);
                        }
                    }

                    break;

                case 8:
                    Int32 oldval_equipWeapon = equipWeapon;
                    equipWeapon = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onEquipWeaponChanged(oldval_equipWeapon);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onEquipWeaponChanged(oldval_equipWeapon);
                        }
                    }

                    break;

                case 23:
                    UInt64 oldval_exp = exp;
                    exp = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onExpChanged(oldval_exp);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onExpChanged(oldval_exp);
                        }
                    }

                    break;

                case 47005:
                    Int32 oldval_forbids = forbids;
                    forbids = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onForbidsChanged(oldval_forbids);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onForbidsChanged(oldval_forbids);
                        }
                    }

                    break;

                case 6:
                    ITEM_INFO_LIST oldval_itemList = itemList;
                    itemList = ((DATATYPE_ITEM_INFO_LIST)EntityDef.id2datatypes[28]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onItemListChanged(oldval_itemList);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onItemListChanged(oldval_itemList);
                        }
                    }

                    break;

                case 5:
                    UInt16 oldval_level = level;
                    level = stream.readUint16();

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

                    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 22:
                    UInt64 oldval_money = money;
                    money = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMoneyChanged(oldval_money);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMoneyChanged(oldval_money);
                        }
                    }

                    break;

                case 12:
                    Byte oldval_moveSpeed = moveSpeed;
                    moveSpeed = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }

                    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 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

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

                    break;

                case 20:
                    Int32 oldval_rating = rating;
                    rating = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRatingChanged(oldval_rating);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRatingChanged(oldval_rating);
                        }
                    }

                    break;

                case 4:
                    Byte oldval_roleTypeCell = roleTypeCell;
                    roleTypeCell = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoleTypeCellChanged(oldval_roleTypeCell);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoleTypeCellChanged(oldval_roleTypeCell);
                        }
                    }

                    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 26:
                    Int32 oldval_stamina = stamina;
                    stamina = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStaminaChanged(oldval_stamina);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStaminaChanged(oldval_stamina);
                        }
                    }

                    break;

                case 47006:
                    SByte oldval_state = state;
                    state = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStateChanged(oldval_state);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStateChanged(oldval_state);
                        }
                    }

                    break;

                case 24:
                    Int32 oldval_strength = strength;
                    strength = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStrengthChanged(oldval_strength);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStrengthChanged(oldval_strength);
                        }
                    }

                    break;

                case 47007:
                    Byte oldval_subState = subState;
                    subState = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onSubStateChanged(oldval_subState);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onSubStateChanged(oldval_subState);
                        }
                    }

                    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;
                }
                ;
            }
        }
Exemple #21
0
        public void Client_initSpaceData(MemoryStream stream)
        {
            spacedatas.Clear();
            UInt32 spaceID = stream.readUint32();
            KBEngineApp.app.spaceID = spaceID;

            while(stream.opsize() > 0)
            {
                string key = stream.readString();
                string val = stream.readString();
                Client_setSpaceData(spaceID, key, val);
            }

            Dbg.DEBUG_MSG("KBEngine::Client_initSpaceData: spaceID(" + spaceID + "), size(" + spacedatas.Count + ")!");
        }
Exemple #22
0
 public override object createFromStream(MemoryStream stream)
 {
     return(stream.readUint32());
 }
Exemple #23
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;
                }
                ;
            }
        }
Exemple #24
0
        protected override void onAsyncConnect(ConnectState state)
        {
            try
            {
                //state.socket.Connect(state.connectIP, state.connectPort);

                byte[] helloPacket = System.Text.Encoding.ASCII.GetBytes(UDP_HELLO);
                state.socket.SendTo(helloPacket, helloPacket.Length, SocketFlags.None, new IPEndPoint(IPAddress.Parse(state.connectIP), state.connectPort));

                ArrayList readList = new ArrayList();
                readList.Add(state.socket);
                Socket.Select(readList, null, null, 3000000);

                if (readList.Count > 0)
                {
                    byte[] buffer = new byte[UDP_PACKET_MAX];
                    int    length = state.socket.Receive(buffer);

                    if (length <= 0)
                    {
                        Dbg.ERROR_MSG(string.Format("NetworkInterfaceKCP::_asyncConnect(), failed to connect to '{0}:{1}'! receive hello-ack error!", state.connectIP, state.connectPort));
                        state.error = "receive hello-ack error!";
                    }
                    else
                    {
                        MemoryStream stream = new MemoryStream();
                        Array.Copy(buffer, 0, stream.data(), stream.wpos, length);
                        stream.wpos = length;
                        string helloAck      = stream.readString();
                        string versionString = stream.readString();
                        uint   conv          = stream.readUint32();

                        if (helloAck != UDP_HELLO_ACK)
                        {
                            Dbg.ERROR_MSG(string.Format("NetworkInterfaceKCP::_asyncConnect(), failed to connect to '{0}:{1}'! receive hello-ack({2}!={3}) mismatch!",
                                                        state.connectIP, state.connectPort, helloAck, UDP_HELLO_ACK));

                            state.error = "hello-ack mismatch!";
                        }
                        else if (KBEngineApp.app.serverVersion != versionString)
                        {
                            Dbg.ERROR_MSG(string.Format("NetworkInterfaceKCP::_asyncConnect(), failed to connect to '{0}:{1}'! version({2}!={3}) mismatch!",
                                                        state.connectIP, state.connectPort, versionString, KBEngineApp.app.serverVersion));

                            state.error = "version mismatch!";
                        }
                        else if (conv == 0)
                        {
                            Dbg.ERROR_MSG(string.Format("NetworkInterfaceKCP::_asyncConnect(), failed to connect to '{0}:{1}'! conv is 0!",
                                                        state.connectIP, state.connectPort));

                            state.error = "kcp conv error!";
                        }

                        ((NetworkInterfaceKCP)state.networkInterface).connID = conv;
                    }
                }
                else
                {
                    Dbg.ERROR_MSG(string.Format("NetworkInterfaceKCP::_asyncConnect(), connect to '{0}:{1}' timeout!'", state.connectIP, state.connectPort));
                    state.error = "timeout!";
                }
            }
            catch (Exception e)
            {
                Dbg.ERROR_MSG(string.Format("NetworkInterfaceKCP::_asyncConnect(), connect to '{0}:{1}' fault! error = '{2}'", state.connectIP, state.connectPort, e));
                state.error = e.ToString();
            }
        }
        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)
                    {
                    case 6:
                        component1.onUpdatePropertys(_t_child_utype, stream, -1);
                        break;

                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 6:
                    component1.createFromStream(stream);
                    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 41002:
                    UInt16 oldval_level = level;
                    level = stream.readUint16();

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

                    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 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;
                }
                ;
            }
        }
Exemple #26
0
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Monster"];
            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 47001:
                    Int32 oldval_HP = HP;
                    HP = stream.readInt32();

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

                    break;

                case 47002:
                    Int32 oldval_HP_Max = HP_Max;
                    HP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onHP_MaxChanged(oldval_HP_Max);
                        }
                    }

                    break;

                case 47003:
                    Int32 oldval_MP = MP;
                    MP = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMPChanged(oldval_MP);
                        }
                    }

                    break;

                case 47004:
                    Int32 oldval_MP_Max = MP_Max;
                    MP_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMP_MaxChanged(oldval_MP_Max);
                        }
                    }

                    break;

                case 37:
                    Int32 oldval_attack_Max = attack_Max;
                    attack_Max = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttack_MaxChanged(oldval_attack_Max);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttack_MaxChanged(oldval_attack_Max);
                        }
                    }

                    break;

                case 38:
                    Int32 oldval_attack_Min = attack_Min;
                    attack_Min = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onAttack_MinChanged(oldval_attack_Min);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onAttack_MinChanged(oldval_attack_Min);
                        }
                    }

                    break;

                case 39:
                    Int32 oldval_defence = defence;
                    defence = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDefenceChanged(oldval_defence);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDefenceChanged(oldval_defence);
                        }
                    }

                    break;

                case 32:
                    UInt32 oldval_dialogID = dialogID;
                    dialogID = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDialogIDChanged(oldval_dialogID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDialogIDChanged(oldval_dialogID);
                        }
                    }

                    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 41:
                    Int32 oldval_dodge = dodge;
                    dodge = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onDodgeChanged(oldval_dodge);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onDodgeChanged(oldval_dodge);
                        }
                    }

                    break;

                case 51007:
                    UInt32 oldval_entityNO = entityNO;
                    entityNO = stream.readUint32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onEntityNOChanged(oldval_entityNO);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onEntityNOChanged(oldval_entityNO);
                        }
                    }

                    break;

                case 47005:
                    Int32 oldval_forbids = forbids;
                    forbids = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onForbidsChanged(oldval_forbids);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onForbidsChanged(oldval_forbids);
                        }
                    }

                    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 33:
                    Byte oldval_moveSpeed = moveSpeed;
                    moveSpeed = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }

                    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 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

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

                    break;

                case 40:
                    Int32 oldval_rating = rating;
                    rating = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRatingChanged(oldval_rating);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRatingChanged(oldval_rating);
                        }
                    }

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                case 47006:
                    SByte oldval_state = state;
                    state = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStateChanged(oldval_state);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStateChanged(oldval_state);
                        }
                    }

                    break;

                case 47007:
                    Byte oldval_subState = subState;
                    subState = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onSubStateChanged(oldval_subState);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onSubStateChanged(oldval_subState);
                        }
                    }

                    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;
                }
                ;
            }
        }
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Room"];
            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 11:
                    Byte oldval_RoomType = RoomType;
                    RoomType = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoomTypeChanged(oldval_RoomType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoomTypeChanged(oldval_RoomType);
                        }
                    }

                    break;

                case 15:
                    Byte oldval_cur_turn = cur_turn;
                    cur_turn = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onCur_turnChanged(oldval_cur_turn);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onCur_turnChanged(oldval_cur_turn);
                        }
                    }

                    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 14:
                    Byte oldval_numOfMJ = numOfMJ;
                    numOfMJ = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onNumOfMJChanged(oldval_numOfMJ);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onNumOfMJChanged(oldval_numOfMJ);
                        }
                    }

                    break;

                case 13:
                    Byte oldval_playerMaxCount = playerMaxCount;
                    playerMaxCount = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerMaxCountChanged(oldval_playerMaxCount);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerMaxCountChanged(oldval_playerMaxCount);
                        }
                    }

                    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 16:
                    ROOM_PUBLIC_INFO oldval_public_roomInfo = public_roomInfo;
                    public_roomInfo = ((DATATYPE_ROOM_PUBLIC_INFO)EntityDef.id2datatypes[26]).createFromStreamEx(stream);

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPublic_roomInfoChanged(oldval_public_roomInfo);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPublic_roomInfoChanged(oldval_public_roomInfo);
                        }
                    }

                    break;

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

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

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                default:
                    break;
                }
                ;
            }
        }
Exemple #28
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 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

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

                    break;

                case 2:
                    UInt64 oldval_lastSelCharacter = lastSelCharacter;
                    lastSelCharacter = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onLastSelCharacterChanged(oldval_lastSelCharacter);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onLastSelCharacterChanged(oldval_lastSelCharacter);
                        }
                    }

                    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 object createFromStream(MemoryStream stream)
		{
			return stream.readUint32();
		}
Exemple #30
0
        public override void onRemoteMethodCall(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Avatar"];

            UInt16 methodUtype            = 0;
            UInt16 componentPropertyUType = 0;

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

            Method method = null;

            if (componentPropertyUType == 0)
            {
                method = sm.idmethods[methodUtype];
            }
            else
            {
                Property pComponentPropertyDescription = sm.idpropertys[componentPropertyUType];
                switch (pComponentPropertyDescription.properUtype)
                {
                case 16:
                    component1.onRemoteMethodCall(methodUtype, stream);
                    break;

                case 21:
                    component2.onRemoteMethodCall(methodUtype, stream);
                    break;

                case 22:
                    component3.onRemoteMethodCall(methodUtype, stream);
                    break;

                default:
                    break;
                }

                return;
            }

            switch (method.methodUtype)
            {
            case 10101:
                Byte   dialog_addOption_arg1 = stream.readUint8();
                UInt32 dialog_addOption_arg2 = stream.readUint32();
                string dialog_addOption_arg3 = stream.readUnicode();
                Int32  dialog_addOption_arg4 = stream.readInt32();
                dialog_addOption(dialog_addOption_arg1, dialog_addOption_arg2, dialog_addOption_arg3, dialog_addOption_arg4);
                break;

            case 10104:
                dialog_close();
                break;

            case 10102:
                string dialog_setText_arg1 = stream.readUnicode();
                Byte   dialog_setText_arg2 = stream.readUint8();
                UInt32 dialog_setText_arg3 = stream.readUint32();
                string dialog_setText_arg4 = stream.readUnicode();
                dialog_setText(dialog_setText_arg1, dialog_setText_arg2, dialog_setText_arg3, dialog_setText_arg4);
                break;

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

            case 7:
                onJump();
                break;

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

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

            default:
                break;
            }
            ;
        }
		public override object createFromStream(MemoryStream stream)
		{
			UInt32 size = stream.readUint32();
			if(4 != size)
			{
				Dbg.ERROR_MSG(string.Format("KBEDATATYPE_VECTOR4::createFromStream: size({0}) is error!", size));
			}
			
			return new Vector4(stream.readFloat(), stream.readFloat(), stream.readFloat(), stream.readFloat());
		}
Exemple #32
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);
        }
Exemple #33
0
        public override void onUpdatePropertys(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Chess"];
            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 11:
                    UInt64 oldval_chess_attack = chess_attack;
                    chess_attack = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_attackChanged(oldval_chess_attack);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_attackChanged(oldval_chess_attack);
                        }
                    }

                    break;

                case 12:
                    UInt64 oldval_chess_defense = chess_defense;
                    chess_defense = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_defenseChanged(oldval_chess_defense);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_defenseChanged(oldval_chess_defense);
                        }
                    }

                    break;

                case 6:
                    UInt64 oldval_chess_id = chess_id;
                    chess_id = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_idChanged(oldval_chess_id);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_idChanged(oldval_chess_id);
                        }
                    }

                    break;

                case 9:
                    UInt64 oldval_chess_index_x = chess_index_x;
                    chess_index_x = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_index_xChanged(oldval_chess_index_x);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_index_xChanged(oldval_chess_index_x);
                        }
                    }

                    break;

                case 10:
                    UInt64 oldval_chess_index_z = chess_index_z;
                    chess_index_z = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_index_zChanged(oldval_chess_index_z);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_index_zChanged(oldval_chess_index_z);
                        }
                    }

                    break;

                case 7:
                    UInt64 oldval_chess_level = chess_level;
                    chess_level = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_levelChanged(oldval_chess_level);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_levelChanged(oldval_chess_level);
                        }
                    }

                    break;

                case 8:
                    string oldval_chess_name = chess_name;
                    chess_name = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_nameChanged(oldval_chess_name);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_nameChanged(oldval_chess_name);
                        }
                    }

                    break;

                case 13:
                    UInt64 oldval_chess_owner_player = chess_owner_player;
                    chess_owner_player = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onChess_owner_playerChanged(oldval_chess_owner_player);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onChess_owner_playerChanged(oldval_chess_owner_player);
                        }
                    }

                    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 14:
                    UInt64 oldval_max_hp = max_hp;
                    max_hp = stream.readUint64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMax_hpChanged(oldval_max_hp);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMax_hpChanged(oldval_max_hp);
                        }
                    }

                    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 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();
        }
Exemple #35
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 40001:
                    Vector3 oldval_direction = direction;
                    direction = stream.readVector3();

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

                    break;

                case 5:
                    Byte oldval_level = level;
                    level = stream.readUint8();

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

                    break;

                case 4:
                    Int32 oldval_mass = mass;
                    mass = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMassChanged(oldval_mass);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMassChanged(oldval_mass);
                        }
                    }

                    break;

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

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

                    break;

                case 7:
                    float oldval_modelScale = modelScale;
                    modelScale = stream.readFloat();

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

                    break;

                case 6:
                    float oldval_moveSpeed = moveSpeed;
                    moveSpeed = stream.readFloat();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }

                    break;

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

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

                    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 8:
                    SByte oldval_state = state;
                    state = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStateChanged(oldval_state);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStateChanged(oldval_state);
                        }
                    }

                    break;

                default:
                    break;
                }
                ;
            }
        }
        /*
            服务端通知当前玩家进入了一个新的space
        */
        public void Client_onEntityEnterSpace(MemoryStream stream)
        {
            Int32 eid = stream.readInt32();
            spaceID = stream.readUint32();

            sbyte isOnGround = 1;

            if(stream.length() > 0)
                isOnGround = stream.readInt8();

            Entity entity = null;

            if(!entities.TryGetValue(eid, out entity))
            {
                Dbg.ERROR_MSG("KBEngine::Client_onEntityEnterSpace: entity(" + eid + ") not found!");
                return;
            }

            entity.isOnGround = isOnGround > 0;
            _entityServerPos = entity.position;
            entity.enterSpace();
        }
Exemple #37
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)
                    {
                    case 15:
                        componentFrameSync.onUpdatePropertys(_t_child_utype, stream, -1);
                        break;

                    default:
                        break;
                    }

                    return;
                }

                switch (prop.properUtype)
                {
                case 15:
                    componentFrameSync.createFromStream(stream);
                    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 11:
                    SByte oldval_gameStateC = gameStateC;
                    gameStateC = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onGameStateCChanged(oldval_gameStateC);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onGameStateCChanged(oldval_gameStateC);
                        }
                    }

                    break;

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

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

                    break;

                case 8:
                    float oldval_moveSpeed = moveSpeed;
                    moveSpeed = stream.readFloat();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onMoveSpeedChanged(oldval_moveSpeed);
                        }
                    }

                    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 40000:
                    Vector3 oldval_position = position;
                    position = stream.readVector3();

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

                    break;

                case 4:
                    Byte oldval_roleType = roleType;
                    roleType = stream.readUint8();

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

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                case 9:
                    SByte oldval_state = state;
                    state = stream.readInt8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onStateChanged(oldval_state);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onStateChanged(oldval_state);
                        }
                    }

                    break;

                case 6:
                    Byte oldval_teamID = teamID;
                    teamID = stream.readUint8();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onTeamIDChanged(oldval_teamID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onTeamIDChanged(oldval_teamID);
                        }
                    }

                    break;

                case 5:
                    Int32 oldval_weaponID = weaponID;
                    weaponID = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onWeaponIDChanged(oldval_weaponID);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onWeaponIDChanged(oldval_weaponID);
                        }
                    }

                    break;

                default:
                    break;
                }
                ;
            }
        }