本文整理汇总了C#中Packet.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadString方法的具体用法?C# Packet.ReadString怎么用?C# Packet.ReadString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.ReadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AckChatSendOk
public AckChatSendOk(Packet packet)
{
this._channel = packet.ReadByte();
this._uid = packet.ReadUint();
this._uname = packet.ReadString();
this._content = packet.ReadString();
}
示例2: UserAuthenticationRequest
/// <summary>
/// Initializes new instance of <see cref="UserAuthenticationRequest"/> struct.
/// </summary>
/// <param name="p"><see cref="Packet"/> to initialize from.</param>
public UserAuthenticationRequest( Packet p )
{
RequestID = p.ReadLong();
Login = p.ReadString();
Password = p.ReadString();
SessionID = p.ReadInt();
}
示例3: ReqRoleCreate
public ReqRoleCreate(Packet packet)
{
this._uid = packet.ReadUint();
this._uuid = packet.ReadUint();
this._sid = packet.ReadUshort();
this._cid = packet.ReadUshort();
this._os = packet.ReadString();
this._version = packet.ReadString();
this._uname = packet.ReadString();
this._source = packet.ReadString();
this._source_sub = packet.ReadString();
this._login_time = packet.ReadUint();
}
示例4: ReqRoleLogin
public ReqRoleLogin(Packet packet)
{
this._uid = packet.ReadUint();
this._uuid = packet.ReadUint();
this._sid = packet.ReadUshort();
this._cid = packet.ReadUshort();
this._login_time = packet.ReadUint();
this._pwd = packet.ReadString();
this._relink = packet.ReadByte();
this._debug = packet.ReadByte();
this._os = packet.ReadString();
this._version = packet.ReadString();
}
示例5: ReqSceneMove
public ReqSceneMove(Packet packet)
{
this._scene_rot_pos = new MsgSceneRotPos(packet);
this._forward = new MsgSceneVector3(packet);
this._ani_name = packet.ReadString();
this._x_axis = packet.ReadShort();
}
示例6: HandleAddonInfo
//! TODO Implement server side addon & banned addon handling
public static async void HandleAddonInfo(CharacterSession session, byte[] addonData)
{
var addonInfo = new AddonInfo();
var addonDataReader = new Packet(addonData, 0);
var addons = addonDataReader.Read<uint>();
for (var i = 0; i < addons; i++)
{
var addonName = addonDataReader.ReadString();
var addonInfoProvided = addonDataReader.Read<bool>();
var addonCRC = addonDataReader.Read<uint>();
var urlCRC = addonDataReader.Read<uint>();
Log.Debug($"AddonData: Name '{addonName}', Info Provided '{addonInfoProvided}', CRC '0x{addonCRC:X}', URL CRC '0x{urlCRC:X}'.");
addonInfo.Addons.Add(new AddonInfoData
{
InfoProvided = addonInfoProvided,
KeyProvided = true,
KeyData = addonPublicKey
});
}
await session.Send(addonInfo);
}
示例7: HandleAuthRequest
public static void HandleAuthRequest(Packet packet, AuthSession session)
{
packet.Read<uint>(32);
packet.Read<ulong>(64);
var loginName = packet.ReadString();
Console.WriteLine($"Account '{loginName}' tries to connect.");
//var account = DB.Auth.Single<Account>(a => a.Email == loginName);
//if (account != null && account.Online)
{
var authComplete = new Packet(ServerMessage.AuthComplete);
authComplete.Write(0, 32);
session.Send(authComplete);
var connectToRealm = new Packet(ServerMessage.ConnectToRealm);
connectToRealm.Write(BitConverter.ToUInt32(new byte[] { 1, 0, 0, 127 }, 0), 32);
connectToRealm.Write(24000, 16);
connectToRealm.Write(0, 64);
connectToRealm.Write(0, 64);
connectToRealm.Write(0, 32);
connectToRealm.WriteWString("Multi-Emu");
connectToRealm.Write(0, 2);
connectToRealm.Write(0, 21);
session.Send(connectToRealm);
}
}
示例8: CacheUserSessionRequest
/// <summary>
/// Initializes new instance of <see cref="CacheUserSessionRequest"/> struct.
/// </summary>
/// <param name="p"><see cref="Packet"/> to initialize from.</param>
public CacheUserSessionRequest( Packet p )
{
RequestID = p.ReadLong();
UserSession session = new UserSession();
session.AccountName = p.ReadString();
session.IPAddress = p.ReadString();
session.ID = p.ReadInt();
session.AccountID = p.ReadInt();
session.Login1 = p.ReadInt();
session.Login2 = p.ReadInt();
session.Play1 = p.ReadInt();
session.Play2 = p.ReadInt();
session.StartTime = p.InternalReadDateTime();
Session = session;
}
示例9: HandlePacket
public void HandlePacket(Packet p, NetworkPlayer player)
{
byte num = p.ReadByte();
switch (num)
{
case 0:
string name = p.ReadString();
player.PlayerName = name;
Packet255SCConnectionFirmed packet2 = new Packet255SCConnectionFirmed(player.PlayerID);
SendPacket(packet2, player.NetConnection);
foreach (NetworkPlayer pl in GameServer.NetworkPlayers)
{
var packet = new Packet0SCPlayerConnect(pl.PlayerName, pl.PlayerID, pl.EntityPosition);
SendPacket(packet, player.NetConnection);
if (pl == player) continue;
packet = new Packet0SCPlayerConnect(player.PlayerName,
player.PlayerID, player.EntityPosition);
SendPacket(packet, pl.NetConnection);
}
ServerConsole.Log("New player \"" + name + "\" connected.");
break;
//A game event, JC!
case 1:
byte eventID = p.ReadByte();
GameServer.HandleGameEvent(eventID, p, player);
break;
case 2:
int pX = p.ReadInt();
int pY = p.ReadInt();
GameServer.SetBlock(pX, pY, 0, true, 0);
break;
case 4:
byte flags = p.ReadByte();
if (player.MovementFlags != flags)
{
player.UpdateMask |= (int)PlayerUpdateFlags.Player_Update;
player.UpdateMask |= (int)PlayerUpdateFlags.Player_Movement_Flags;
}
player.MovementFlags = flags;
break;
case 5:
flags = p.ReadByte();
float angle = p.ReadShort().DToR();
if (player.MovementFlags != flags || angle != player.PlayerAimAngle)
{
player.UpdateMask |= (int)PlayerUpdateFlags.Player_Update;
player.UpdateMask |= (int)PlayerUpdateFlags.Player_Movement_Flags;
}
player.MovementFlags = flags;
player.PlayerAimAngle = angle;
break;
}
}
示例10: MemberInsert
public static void MemberInsert(Packet packet, Player player)
{
string CharName = packet.ReadString(17);
int PlayerIndex = MainClass.Players.Find(CharName);
if (PlayerIndex != -1)
{
Packet Response = new Packet(0x7E03);
Response.WriteString(player.CharName, 17);
MainClass.Players[PlayerIndex].Sock.Send(Response);
}
}
示例11: PartyRequest
public static void PartyRequest(Packet packet, Player player)
{
string CharName = packet.ReadString(17);
byte Type = packet.ReadByte( );
int PlayerIndex = MainClass.Players.Find(CharName);
if (PlayerIndex != -1)
{
Packet Response = new Packet(0x0711);
Response.WriteString(player.CharName, 17);
Response.WriteByte(Type);
MainClass.Players[PlayerIndex].Sock.Send(Response);
}
}
示例12: Whisper
public static void Whisper(Packet packet, Player player)
{
string CharName = packet.ReadString(17);
byte Length = packet.ReadByte();
packet.ReadByte();
string Text = packet.ReadString(Length);
int PlayerIndex = MainClass.Players.Find(CharName);
if (PlayerIndex != -1)
{
Packet ToPacket = new Packet(0x0223);
ToPacket.WriteString(CharName, 17);
ToPacket.WriteByte(0);
ToPacket.WriteByte(1);
player.Sock.Send(ToPacket);
Packet FromPacket = new Packet(0x0224);
FromPacket.WriteString(player.CharName, 17);
FromPacket.WriteByte(0);
FromPacket.WriteByte(Length);
FromPacket.WriteString(Text, Length);
MainClass.Players[PlayerIndex].Sock.Send(FromPacket);
}
}
示例13: AckTestPhpOk
public AckTestPhpOk(Packet packet)
{
this._u64 = packet.ReadUlong();
this._strxx = packet.ReadString();
this._msg_req = new MsgTestPhp(packet);
this. msg_opt_flag = packet.ReadByte();
if (this.msg_opt_flag == 1)
{
this._msg_opt = new MsgTestPhp(packet);
}
this._msg_rep = new List<MsgTestPhp>();
ushort msg_rep_count = packet.ReadUshort();
for (ushort i = 0; i < msg_rep_count; i++)
{
this._msg_rep.Add(new MsgTestPhp(packet));
}
}
示例14: ReqChatGm
public ReqChatGm(Packet packet)
{
this._content = packet.ReadString();
}
示例15: AckRoleRandNameOk
public AckRoleRandNameOk(Packet packet)
{
this._uname = packet.ReadString();
}