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


C# PacketReader.ReadUTF8String方法代码示例

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


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

示例1: ZoneCluster_HandlerLoginZoneCluster

        /// <summary>
        /// 
        /// </summary>
        /// <param name="netState"></param>
        /// <param name="packetReader"></param>
        internal static void ZoneCluster_HandlerLoginZoneCluster( NetState netState, PacketReader packetReader )
        {
            ZoneCluster_ListenerExtendData extendData = netState.GetComponent<ZoneCluster_ListenerExtendData>( ZoneCluster_ListenerExtendData.COMPONENT_ID );
            if ( extendData == null )
                throw new Exception( "ZoneCluster_PacketHandlers.ZoneCluster_HandlerLoginZoneCluster(...) - extendData == null error!" );

            if ( extendData.IsLoggedIn == true )
            {
                LOGs.WriteLine( LogMessageType.MSG_ERROR, "ZoneCluster_PacketHandlers.ZoneCluster_HandlerLoginZoneCluster(...) - extendData.IsLoggedIn == true error!" );
                return;
            }

            string strZoneClusterPassword = packetReader.ReadUTF8String();
            string strZoneOrDomainPassword = packetReader.ReadUTF8String();

            if ( extendData.ConfigZoneCluster.ZoneClusterPassword == strZoneClusterPassword )
            {
                extendData.IsLoggedIn = true;

                // 检查是 Domain 服务端登陆 还是 Zone客户端登陆
                if ( extendData.ConfigZoneCluster.DomainPassword == strZoneOrDomainPassword )
                    extendData.IsDomainServer = true;
                else
                    extendData.IsZoneServer = true;

                extendData.ServerPassword = strZoneOrDomainPassword;
            }

            netState.Send( new ZoneCluster_LoginZoneClusterResult( extendData.IsLoggedIn ) );
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:35,代码来源:HandlerLoginZoneCluster.cs

示例2: Realm_HandleRegisterRealm

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

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

            Realm realm = new Realm();

            realm.Name = packetReader.ReadUTF8String();
            realm.Address = packetReader.ReadUTF8String();

            string strIcon = packetReader.ReadUTF8String();
            if ( Insensitive.Equals( strIcon, "PVP" ) )
                realm.Icon = (uint)RealmIconType.REALMTYPE_PVP;
            else if ( Insensitive.Equals( strIcon, "RP" ) )
                realm.Icon = (uint)RealmIconType.REALMTYPE_RP;
            else if ( Insensitive.Equals( strIcon, "RPPVP" ) )
                realm.Icon = (uint)RealmIconType.REALMTYPE_RPPVP;
            else
                realm.Icon = (uint)RealmIconType.REALMTYPE_NORMAL;

            realm.Colour = packetReader.ReadUInt32();
            realm.TimeZone = packetReader.ReadUInt32();
            realm.Population = packetReader.ReadFloat();

            extendData.RequestSession.Serial = RealmHandler.RealmsExclusiveSerial.GetExclusiveSerial();

            // Add to the main realm list
            RealmHandler.AddRealm( extendData.RequestSession.Serial, realm );

            extendData.IsLoggedIn = true;

            // Send back response packet.
            netState.Send( new Realm_RegisterRealmResult( extendData.RequestSession.Serial ) );
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:49,代码来源:HandleRegisterRealm.cs

示例3: World_HandleChannelNumMembersQuery

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

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

            string strChannelName = packetReader.ReadUTF8String();

            netState.Send( new Word_ChannelNumMembersQueryResponse( strChannelName, 0, 0 ) );
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:24,代码来源:HandleHandleChannelNumMembersQuery.cs

示例4: Read

                public static TradeAge.Client.Entity.Character.SimplePlayer Read(PacketReader reader)
                {
                    TradeAge.Client.Entity.Character.SimplePlayer ret = new TradeAge.Client.Entity.Character.SimplePlayer();

                    ret.Name = reader.ReadUTF8String();
                    ret.Postion = reader.ReadStruct <DogSE.Common.Vector3>();
                    ret.Direction = reader.ReadStruct <DogSE.Common.Vector3>();
                    ret.Id = reader.ReadInt32();
                    ret.AccountId = reader.ReadInt32();
                    ret.Sex = (TradeAge.Client.Entity.Character.Sex)reader.ReadByte();

                    return ret;
                }
开发者ID:zaq1xsw,项目名称:DogSE,代码行数:13,代码来源:SceneController.Net.cs

示例5: Read

                public static TradeAge.Client.Entity.Character.SimplePlayer Read(PacketReader reader)
                {
                    TradeAge.Client.Entity.Character.SimplePlayer ret = new TradeAge.Client.Entity.Character.SimplePlayer();

                    ret.Name = reader.ReadUTF8String();
                     ret.Postion = Vector3ReadProxy.Read(reader);
                     ret.Rotation = QuaternionReadProxy.Read(reader);
                    ret.Speed = reader.ReadFloat();
                    ret.Id = reader.ReadInt32();
                    ret.AccountId = reader.ReadInt32();
                    ret.Sex = (TradeAge.Client.Entity.Character.Sex)reader.ReadByte();

                    return ret;
                }
开发者ID:RainsSoft,项目名称:DogSE,代码行数:14,代码来源:SceneController.Net.cs


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