本文整理汇总了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 ) );
}
示例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 ) );
}
示例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 ) );
}
示例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;
}
示例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;
}