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


C# PacketReader.ReadUInt32方法代码示例

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


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

示例1: LoginServerConnectFromCharServer

        /// <summary>
        /// 
        /// </summary>
        /// <param name="netState"></param>
        /// <param name="packetReader"></param>
        internal static void LoginServerConnectFromCharServer( NetState netState, PacketReader packetReader )
        {
            // 错误 不可能有创建
            if ( netState.ExtendData is CharServerExtendData == true )
                return;
            else
                netState.ExtendData = null;

            if ( packetReader.Size < 14/*6 + 8 + ?*/ )
                return;

            // 不检查网络是否活动
            netState.IsCheckActivity = false;

            long l_iCharGUID = packetReader.ReadUInt32();
            long l_iCharPort = packetReader.ReadUInt32();
            string l_strLoginPassword = packetReader.ReadStringSafe();

            if ( l_strLoginPassword == Program.ConfigInfo.LoginPassword )
            {
                CharServerExtendData l_ExtendData = new CharServerExtendData();

                l_ExtendData.IsLoggedIn = true;
                l_ExtendData.CharGUID = l_iCharGUID;
                l_ExtendData.CharHost = netState.NetAddress.ToString();
                l_ExtendData.CharPort = l_iCharPort;

                netState.ExtendData = l_ExtendData;

                Program.CharServerList.Add(l_ExtendData);

                l_ExtendData.ConnectToCharServer( l_ExtendData.CharHost, l_ExtendData.CharPort );
            }
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:39,代码来源:LoginPacketHandlers.cs

示例2: OnCompressedGump

 private static void OnCompressedGump(PacketReader p, PacketHandlerEventArgs e)
 {
     p.MoveToData();
     uint sender = p.ReadUInt32();
     uint id = p.ReadUInt32();
     if (id == gumpID)
     {
         responseID = sender;
         e.Block = enabled;
     }
 }
开发者ID:jaryn-kubik,项目名称:RazorEx,代码行数:11,代码来源:SpectralScimitar.cs

示例3: IS_NCI

 /// <summary>
 /// Creates a new IS_NCI class.
 /// </summary>
 /// <param name="buffer">The buffer containing the packet data.</param>
 public IS_NCI(byte[] buffer):this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     UCID = reader.ReadByte();
     Language = (LfsLanguage)reader.ReadByte();
     reader.Skip(3);
     UserID = reader.ReadUInt32();
     IPAddress = new IPAddress(reader.ReadUInt32());
 }
开发者ID:Kristoffeh,项目名称:InSim.NET_Library,代码行数:15,代码来源:IS_NCI.cs

示例4: IS_SPX

 /// <summary>
 /// Creates a new split time packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_SPX(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     PLID = reader.ReadByte();
     STime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
     ETime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
     Split = reader.ReadByte();
     Penalty = (PenaltyValue)reader.ReadByte();
     NumStops = reader.ReadByte();
 }
开发者ID:maindefine,项目名称:insimdotnet,代码行数:17,代码来源:IS_SPX.cs

示例5: IS_LAP

 /// <summary>
 /// Creates a new lap time packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_LAP(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     PLID = reader.ReadByte();
     LTime = TimeSpan.FromMilliseconds(reader.ReadUInt32()); ;
     ETime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
     LapsDone = reader.ReadUInt16();
     Flags = (PlayerFlags)reader.ReadUInt16();
     reader.Skip(1);
     Penalty = (PenaltyValue)reader.ReadByte();
     NumStops = reader.ReadByte();
 }
开发者ID:maindefine,项目名称:insimdotnet,代码行数:19,代码来源:IS_LAP.cs

示例6: Realm_HandleRegisterRealmResult

        /// <summary>
        /// 
        /// </summary>
        /// <param name="netState"></param>
        /// <param name="packetReader"></param>
        internal static void Realm_HandleRegisterRealmResult( NetState netState, PacketReader packetReader )
        {
            RealmExtendData extendData = netState.GetComponent<RealmExtendData>( RealmExtendData.COMPONENT_ID );
            if ( extendData == null )
            {
                Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRegisterRealmResult(...) - extendData == null error!" );
                return;
            }

            if ( extendData.IsLoggedIn == true )
            {
                Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRegisterRealmResult(...) - extendData.IsLoggedIn == true error!" );
                return;
            }

            uint iRealmSerial = packetReader.ReadUInt32();

            extendData.RegisterRealmResult.Serial = new Serial( iRealmSerial );

            // 已经登陆
            extendData.IsLoggedIn = true;

            // 3分钟 向服务端发一次心跳信号
            TimeSlice.StartTimeSlice( TimerPriority.Lowest, TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimeSliceCallback( SendPing ) );

            LOGs.WriteLine( LogMessageType.MSG_INFO, "RealmServer:登陆RealmServer服务器成功 返回的标示ID({0})", extendData.RegisterRealmResult.Serial.ToString() );
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:32,代码来源:HandleRegisterRealmResult.cs

示例7: Menu

        public Menu(byte[] data)
            : base(data)
        {
            PacketReader reader = new PacketReader(data);
            byte id = reader.ReadByte();
            ushort blockSize = reader.ReadUInt16();

            dialogSerial = reader.ReadUInt32();
            menuSerial = reader.ReadUInt16();

            byte titleLen = reader.ReadByte();
            title = reader.ReadAnsiString(titleLen);

            byte optionCount = reader.ReadByte();
            MenuOption[] optionList = new MenuOption[optionCount];

            for (int i = 0; i < optionCount; i++) {
                optionList[i].Artwork = reader.ReadUInt16();
                optionList[i].Hue = reader.ReadUInt16();

                byte textLen = reader.ReadByte();
                optionList[i].Text = reader.ReadAnsiString(textLen);
            }

            options = Array.AsReadOnly<MenuOption>(optionList);

            // if (reader.Offset == reader.Length)
            //     System.Diagnostics.Debug.WriteLine("Menu packet resolved succesfully.", "Communication");
        }
开发者ID:greeduomacro,项目名称:phoenix,代码行数:29,代码来源:Menu.cs

示例8: Realm_HandleRequestSession

        /// <summary>
        /// 
        /// </summary>
        /// <param name="netState"></param>
        /// <param name="packetReader"></param>
        public static void Realm_HandleRequestSession( NetState netState, PacketReader packetReader )
        {
            RealmExtendData extendData = netState.GetComponent<RealmExtendData>( RealmExtendData.COMPONENT_ID );
            if ( extendData == null )
            {
                Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRequestSession(...) - extendData == null error!" );
                return;
            }

            if ( extendData.IsLoggedIn == false )
            {
                Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRequestSession(...) - extendData.IsLoggedIn == false error!" );
                return;
            }

            uint iSerial = packetReader.ReadUInt32();
            string strAccountName = packetReader.ReadUTF8StringSafe();

            WowAccount wowAccount = WowAccountHandler.GetAccount( strAccountName );
            if ( wowAccount == null )
            {
                netState.Send( new Realm_RequestSessionResultError( iSerial ) );
                return;
            }

            SecureRemotePassword srp = SrpHandler.GetSRP( strAccountName );
            if ( srp == null )
            {
                netState.Send( new Realm_RequestSessionResultError( iSerial ) );
                return;
            }

            netState.Send( new Realm_RequestSessionResult( iSerial, wowAccount, srp ) );
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:39,代码来源:HandleRequestSession.cs

示例9: World_HandleRealmSplitStateRequest

        /// <summary>
        /// 
        /// </summary>
        /// <param name="netState"></param>
        /// <param name="packetReader"></param>
        internal static void World_HandleRealmSplitStateRequest( NetState netState, PacketReader packetReader )
        {
            LOGs.WriteLine( LogMessageType.MSG_HACK, "World_HandleRealmSplitStateRequest...... {0} ", packetReader.Size );

            WorldExtendData extendData = netState.GetComponent<WorldExtendData>( WorldExtendData.COMPONENT_ID );
            if ( extendData == null )
            {
                Debug.WriteLine( "World_PacketHandlers.World_HandleRealmSplitStateRequest(...) - extendData == null error!" );
                return;
            }

            if ( extendData.IsLoggedIn == false )
            {
                Debug.WriteLine( "World_PacketHandlers.World_HandleRealmSplitStateRequest(...) - extendData.IsLoggedIn == false error!" );
                return;
            }

            if ( packetReader.Size < 10 /*ProcessNet.WORLD_HEAD_SIZE + 0*/)
            {
                Debug.WriteLine( "World_PacketHandlers.World_HandleRealmSplitStateRequest(...) - extendData.Size < 10 error!" );
                return;
            }

            uint iUnknown = packetReader.ReadUInt32();

            netState.Send( new Word_RealmSplitStateRequest( iUnknown ) );
            //netState.Send( new Word_CharEnumResponse( new WowCharacterInfo[0] ) );
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:33,代码来源:HandleRealmSplitStateRequest.cs

示例10: HandlePacket

        public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
        {
            var reader = new PacketReader(data, position, size);
            var charId = reader.ReadUInt32();

            if (context.User == null)
                return;

            if (context.Character == null) // On character create, this is already set.
            {
                using (var db = new PolarisEf())
                {
                    var character = db.Characters.Find((int)charId);

                    if (character == null || character.Player.PlayerId != context.User.PlayerId)
                        return;

                    context.Character = character;
                }

            }

            // Transition to the loading screen
            context.SendPacket(new NoPayloadPacket(0x3, 0x4));

            // TODO Set area, Set character, possibly more. See PolarisLegacy for more.
        }
开发者ID:Zenohate,项目名称:PolarisServer,代码行数:27,代码来源:StartGame.cs

示例11: OnFilter

        public override void OnFilter( PacketReader p, PacketHandlerEventArgs args )
        {
            if ( args.Block )
                return;

            // 0, 1, 2
            Serial serial = p.ReadUInt32(); // 3, 4, 5, 6
            ushort body = p.ReadUInt16(); // 7, 8
            MessageType type = (MessageType)p.ReadByte(); // 9

            if ( type != m_Type )
                return;

            ushort hue = p.ReadUInt16(); // 10, 11
            ushort font = p.ReadUInt16();
            string name = p.ReadStringSafe( 30 );
            string text = p.ReadStringSafe();

            for(int i=0;i<m_Strings.Length;i++)
            {
                if ( text.IndexOf( m_Strings[i] ) != -1 )
                {
                    args.Block = true;
                    return;
                }
            }
        }
开发者ID:herculesjr,项目名称:razor,代码行数:27,代码来源:MessageFilter.cs

示例12: IS_FIN

 /// <summary>
 /// Creates a new finished race notification packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_FIN(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     PLID = reader.ReadByte();
     TTime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
     BTime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
     reader.Skip(1);
     NumStops = reader.ReadByte();
     Confirm = (ConfirmationFlags)reader.ReadByte();
     reader.Skip(1);
     LapsDone = reader.ReadUInt16();
     Flags = (PlayerFlags)reader.ReadUInt16();
 }
开发者ID:maindefine,项目名称:insimdotnet,代码行数:20,代码来源:IS_FIN.cs

示例13: ReadPacket

        public void ReadPacket(PacketReader reader)
        {
            MessageType = reader.ReadInt32();
            Unknown1 = reader.ReadInt32();
            ServerTick = reader.ReadUInt32();
            Unknown2 = (byte)reader.ReadByte();

            switch (MessageType) // not sure about this
            {
                case 1:
                    break;

                case 2:
                    UserID = reader.ReadInt64();
                    UserID2 = reader.ReadInt64();
                    Username = reader.ReadString();
                    Unknown3 = reader.ReadInt32();
                    Unknown4 = reader.ReadInt32();
                    MemberStatus = (MemberStatusId)reader.ReadInt32();
                    MessageTime = TimeSpan.FromSeconds(reader.ReadInt32());
                    Message = reader.ReadString();
                    break;

                default:
                    break;
            }
        }
开发者ID:maithanhtan,项目名称:CoCSharp,代码行数:27,代码来源:AllianceChatMessageServerPacket.cs

示例14: OnFilter

        public override void OnFilter( PacketReader p, PacketHandlerEventArgs args )
        {
            uint serial = p.ReadUInt32();
            ushort itemID = p.ReadUInt16();

            if ( (serial & 0x80000000) != 0 )
                p.ReadUInt16(); // amount

            if ( (itemID & 0x8000) != 0 )
                itemID = (ushort)((itemID&0x7FFF) + p.ReadSByte()); // itemID offset

            ushort x = p.ReadUInt16();
            ushort y = p.ReadUInt16();

            if ( (x & 0x8000) != 0 )
                p.ReadByte(); // direction

            short z = p.ReadSByte();

            if ( ( y & 0x8000 ) != 0 )
                p.ReadUInt16(); // hue

            bool visable = true;
            if ( ( y & 0x4000 ) != 0 )
            {
                int flags = p.ReadByte();

                visable = ( (flags&0x80) == 0 );
            }

            if ( IsStaffItem( itemID ) || !visable )
                args.Block = true;
        }
开发者ID:herculesjr,项目名称:razor,代码行数:33,代码来源:StaffItems.cs

示例15: IS_SMALL

 /// <summary>
 /// Creates a new general purpose packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_SMALL(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     SubT = (SmallType)reader.ReadByte();
     UVal = reader.ReadUInt32();
 }
开发者ID:Kristoffeh,项目名称:InSim.NET_Library,代码行数:13,代码来源:IS_SMALL.cs


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