コード例 #1
0
ファイル: CustomDataTypes.cs プロジェクト: VirtuaIRiot/Game
        public EXAMPLES createFromStreamEx(MemoryStream stream)
        {
            EXAMPLES datas = new EXAMPLES();

            datas.k1 = stream.readInt64();
            datas.k2 = stream.readInt64();
            return(datas);
        }
コード例 #2
0
        public override void onRemoteMethodCall(Method method, MemoryStream stream)
        {
            switch (method.methodUtype)
            {
            case 21:
                UInt64 onEnterHall_arg1 = stream.readUint64();
                onEnterHall(onEnterHall_arg1);
                break;

            case 20:
                string onEnterSetName_arg1 = stream.readUnicode();
                onEnterSetName(onEnterSetName_arg1);
                break;

            case 29:
                Int64 onReqExitRoom_arg1 = stream.readInt64();
                onReqExitRoom(onReqExitRoom_arg1);
                break;

            case 25:
                UInt16 onReqJoinRoomFailed_arg1 = stream.readUint16();
                onReqJoinRoomFailed(onReqJoinRoomFailed_arg1);
                break;

            case 26:
                UInt16 onReqJoinRoomSuccess_arg1 = stream.readUint16();
                onReqJoinRoomSuccess(onReqJoinRoomSuccess_arg1);
                break;

            case 28:
                SEATS_INFO onReqPlayersInfo_arg1 = ((DATATYPE_SEATS_INFO)method.args[0]).createFromStreamEx(stream);
                onReqPlayersInfo(onReqPlayersInfo_arg1);
                break;

            case 27:
                string onReqRoomPassword_arg1 = stream.readUnicode();
                onReqRoomPassword(onReqRoomPassword_arg1);
                break;

            case 24:
                ROOM_INFOS_LIST onReqRoomsByParams_arg1 = ((DATATYPE_ROOM_INFOS_LIST)method.args[0]).createFromStreamEx(stream);
                onReqRoomsByParams(onReqRoomsByParams_arg1);
                break;

            case 22:
                UInt16 onSetNameFailed_arg1 = stream.readUint16();
                string onSetNameFailed_arg2 = stream.readUnicode();
                onSetNameFailed(onSetNameFailed_arg1, onSetNameFailed_arg2);
                break;

            case 23:
                string onSetNameSuccessfully_arg1 = stream.readUnicode();
                onSetNameSuccessfully(onSetNameSuccessfully_arg1);
                break;

            default:
                break;
            }
            ;
        }
コード例 #3
0
ファイル: CustomDataTypes.cs プロジェクト: VirtuaIRiot/Game
                public List <Int64> createFromStreamEx(MemoryStream stream)
                {
                    UInt32       size  = stream.readUint32();
                    List <Int64> datas = new List <Int64>();

                    while (size > 0)
                    {
                        --size;
                        datas.Add(stream.readInt64());
                    }
                    ;

                    return(datas);
                }
コード例 #4
0
 static int readInt64(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         KBEngine.MemoryStream obj = (KBEngine.MemoryStream)ToLua.CheckObject <KBEngine.MemoryStream>(L, 1);
         long o = obj.readInt64();
         LuaDLL.tolua_pushint64(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #5
0
 public override object createFromStream(MemoryStream stream)
 {
     return(stream.readInt64());
 }
コード例 #6
0
ファイル: RoomBase.cs プロジェクト: Uouini/HappyPoker
        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 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:
                    Int32 oldval_gameMupe = gameMupe;
                    gameMupe = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onGameMupeChanged(oldval_gameMupe);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onGameMupeChanged(oldval_gameMupe);
                        }
                    }

                    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 9:
                    Int64 oldval_roomId = roomId;
                    roomId = stream.readInt64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onRoomIdChanged(oldval_roomId);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onRoomIdChanged(oldval_roomId);
                        }
                    }

                    break;

                case 10:
                    Byte oldval_roomType = roomType;
                    roomType = stream.readUint8();

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

                    break;

                case 40002:
                    stream.readUint32();
                    break;

                default:
                    break;
                }
                ;
            }
        }
コード例 #7
0
		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;
				};
			}
		}
コード例 #8
0
		public override object createFromStream(MemoryStream stream)
		{
			return stream.readInt64();
		}
コード例 #9
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:
                    Int32 oldval_modelType = modelType;
                    modelType = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onModelTypeChanged(oldval_modelType);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onModelTypeChanged(oldval_modelType);
                        }
                    }

                    break;

                case 6:
                    Int64 oldval_playerExp = playerExp;
                    playerExp = stream.readInt64();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerExpChanged(oldval_playerExp);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerExpChanged(oldval_playerExp);
                        }
                    }

                    break;

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

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

                    break;

                case 11:
                    Int32 oldval_playerLayer = playerLayer;
                    playerLayer = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerLayerChanged(oldval_playerLayer);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerLayerChanged(oldval_playerLayer);
                        }
                    }

                    break;

                case 9:
                    Int32 oldval_playerMass = playerMass;
                    playerMass = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerMassChanged(oldval_playerMass);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerMassChanged(oldval_playerMass);
                        }
                    }

                    break;

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

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

                    break;

                case 3:
                    string oldval_playerNameBase = playerNameBase;
                    playerNameBase = stream.readUnicode();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerNameBaseChanged(oldval_playerNameBase);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerNameBaseChanged(oldval_playerNameBase);
                        }
                    }

                    break;

                case 8:
                    float oldval_playerScale = playerScale;
                    playerScale = stream.readFloat();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerScaleChanged(oldval_playerScale);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerScaleChanged(oldval_playerScale);
                        }
                    }

                    break;

                case 10:
                    float oldval_playerSpeed = playerSpeed;
                    playerSpeed = stream.readFloat();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerSpeedChanged(oldval_playerSpeed);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerSpeedChanged(oldval_playerSpeed);
                        }
                    }

                    break;

                case 7:
                    Int32 oldval_playerState = playerState;
                    playerState = stream.readInt32();

                    if (prop.isBase())
                    {
                        if (inited)
                        {
                            onPlayerStateChanged(oldval_playerState);
                        }
                    }
                    else
                    {
                        if (inWorld)
                        {
                            onPlayerStateChanged(oldval_playerState);
                        }
                    }

                    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;
                }
                ;
            }
        }