当前位置: 首页>>代码示例>>C#>>正文


C# ProcessedPacket.ReadUInt16方法代码示例

本文整理汇总了C#中ProcessedPacket.ReadUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessedPacket.ReadUInt16方法的具体用法?C# ProcessedPacket.ReadUInt16怎么用?C# ProcessedPacket.ReadUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProcessedPacket的用法示例。


在下文中一共展示了ProcessedPacket.ReadUInt16方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCharacterCreationStatus

        /// <summary>
        /// Received CharacterCreation packet from CityServer.
        /// </summary>
        /// <returns>The result of the character creation.</returns>
        public static CharacterCreationStatus OnCharacterCreationStatus(NetworkClient Client, ProcessedPacket Packet)
        {
            LogThis.Log.LogThis("Received OnCharacterCreationStatus!", LogThis.eloglevel.info);

            CharacterCreationStatus CCStatus = (CharacterCreationStatus)Packet.ReadByte();

            ushort NumHouses = Packet.ReadUInt16();
            LotTileEntry[] TileEntries = new LotTileEntry[NumHouses];

            if (NumHouses > 0)
            {
                for (int i = 0; i < NumHouses; i++)
                {
                    TileEntries[i] = new LotTileEntry(Packet.ReadInt32(), Packet.ReadString(), (short)Packet.ReadUInt16(),
                        (short)Packet.ReadUInt16(), (byte)Packet.ReadByte(), Packet.ReadInt32());
                }
            }

            lock(TSOClient.Code.GameFacade.CDataRetriever.LotTileData)
                TSOClient.Code.GameFacade.CDataRetriever.LotTileData = TileEntries;

            return CCStatus;
        }
开发者ID:gamedev1337,项目名称:Project-Dollhouse,代码行数:27,代码来源:UIPacketHandlers.cs

示例2: OnLotCostResponse

        public static LotTileEntry OnLotCostResponse(NetworkClient Client, ProcessedPacket Packet)
        {
            ushort X = Packet.ReadUInt16();
            ushort Y = Packet.ReadUInt16();
            int LotID = Packet.ReadInt32();
            string LotName = Packet.ReadString();
            //bit 0 = online, bit 1 = spotlight, bit 2 = locked, bit 3 = occupied, other bits free for whatever use
            byte Flags = (byte)Packet.ReadByte();
            int Cost = Packet.ReadInt32();

            return new LotTileEntry(LotID, LotName, (short)X, (short)Y, Flags, Cost);
        }
开发者ID:gamedev1337,项目名称:Project-Dollhouse,代码行数:12,代码来源:UIPacketHandlers.cs

示例3: OnPlayerJoinedSession

        /// <summary>
        /// A player joined a session (game) in progress.
        /// </summary>
        public static LotTileEntry OnPlayerJoinedSession(NetworkClient Client, ProcessedPacket Packet)
        {
            LotTileEntry TileEntry = new LotTileEntry(0, "", 0, 0, 0, 0);

            UISim Avatar = new UISim(Packet.ReadString());
            Avatar.Name = Packet.ReadString();
            Avatar.Sex = Packet.ReadString();
            Avatar.Description = Packet.ReadString();
            Avatar.HeadOutfitID = Packet.ReadUInt64();
            Avatar.BodyOutfitID = Packet.ReadUInt64();
            Avatar.Avatar.Appearance = (AppearanceType)Packet.ReadInt32();

            byte HasHouse = (byte)Packet.ReadByte();

            if (HasHouse != 0)
            {
                TileEntry = new LotTileEntry(Packet.ReadInt32(), Packet.ReadString(), (short)Packet.ReadUInt16(),
                    (short)Packet.ReadUInt16(), (byte)Packet.ReadByte(), Packet.ReadInt32());

                Avatar.LotID = TileEntry.lotid;
                Avatar.HouseX = TileEntry.x;
                Avatar.HouseY = TileEntry.y;

                LotTileEntry[] TileEntries = new LotTileEntry[TSOClient.Code.GameFacade.CDataRetriever.LotTileData.Length + 1];
                TileEntries[0] = TileEntry;
                TSOClient.Code.GameFacade.CDataRetriever.LotTileData.CopyTo(TileEntries, 1);
            }

            lock (NetworkFacade.AvatarsInSession)
            {
                NetworkFacade.AvatarsInSession.Add(Avatar);
            }

            return TileEntry;
        }
开发者ID:gamedev1337,项目名称:Project-Dollhouse,代码行数:38,代码来源:UIPacketHandlers.cs

示例4: OnCityTokenResponse

        /// <summary>
        /// Received from the CityServer in response to a CITY_TOKEN packet.
        /// </summary>
        public static CityTransferStatus OnCityTokenResponse(NetworkClient Client, ProcessedPacket Packet)
        {
            LogThis.Log.LogThis("Received OnCityTokenResponse", LogThis.eloglevel.info);

            CityTransferStatus Status = (CityTransferStatus)Packet.ReadByte();

            ushort NumHouses = Packet.ReadUInt16();
            LotTileEntry[] TileEntries = new LotTileEntry[NumHouses];

            if (NumHouses > 0)
            {
                for(int i = 0; i < NumHouses; i++)
                {
                    TileEntries[i] = new LotTileEntry(Packet.ReadInt32(), Packet.ReadString(), (short)Packet.ReadUInt16(),
                        (short)Packet.ReadUInt16(), (byte)Packet.ReadByte(), Packet.ReadInt32());
                }
            }

            PlayerAccount.Money = Packet.ReadInt32();

            lock(TSOClient.Code.GameFacade.CDataRetriever.LotTileData)
                TSOClient.Code.GameFacade.CDataRetriever.LotTileData = TileEntries;

            return Status;
        }
开发者ID:gamedev1337,项目名称:Project-Dollhouse,代码行数:28,代码来源:UIPacketHandlers.cs


注:本文中的ProcessedPacket.ReadUInt16方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。