本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadString方法的具体用法?C# NetIncomingMessage.ReadString怎么用?C# NetIncomingMessage.ReadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
internal override void Read(NetIncomingMessage Message)
{
Name = Message.ReadString();
if (!Guid.TryParse(Message.ReadString(), out CurrentConfigurationID)) {
throw new Exception("Unable to parse GUID for CurrentConfig in server info.");
}
}
示例2: FromNetMsg
public override void FromNetMsg(NetIncomingMessage netMsg)
{
// Here we assume that typeID was read before to determine which kind of message it was.
m_senderName = netMsg.ReadString();
m_group = netMsg.ReadString();
m_message = netMsg.ReadString();
}
示例3: Read
internal override void Read(NetIncomingMessage Message)
{
base.Read(Message);
Language = (CodeLanguage)Enum.Parse(typeof(CodeLanguage), Message.ReadString());
Location = (CodeLocation)Enum.Parse(typeof(CodeLocation), Message.ReadString());
Source = Message.ReadString();
}
示例4: ReadPayload
/// <summary>
/// Reads the transport into the contents of this type.
/// </summary>
public void ReadPayload(NetIncomingMessage message)
{
Identity = message.ReadString();
NovaId = message.ReadString();
PasswordHash = message.ReadString();
PublicEndPoint = message.ReadIPEndpoint();
PrivateEndPoint = message.ReadIPEndpoint();
}
示例5: onclientrecieve
public override void onclientrecieve(NetIncomingMessage message)
{
string id = message.ReadString();
string text = message.ReadString();
Console.WriteLine(text);
base.onclientrecieve(message);
}
示例6: ConnectionMessage
public ConnectionMessage(NetIncomingMessage msg)
{
string encryptedUsername = msg.ReadString();
string encryptedPassword = msg.ReadString();
byte[] xUsername = Xor(Encoding.UTF8.GetBytes(encryptedUsername), EncryptionKey);
byte[] xPassword = Xor(Encoding.UTF8.GetBytes(encryptedPassword), EncryptionKey);
Username = Encoding.UTF8.GetChars(xUsername).ToString();
Password = Encoding.UTF8.GetChars(xPassword).ToString();
}
示例7: Decode
public void Decode(NetIncomingMessage im)
{
this.Username = im.ReadString();
this.Password = im.ReadString();
this.Color = ColorExtensions.ColorFromHSV(im.ReadInt16(), Client.IO.ColorSaturation / 255f, Client.IO.ColorValue / 255f);
if (Username.Length > Settings.MaxNameLength) //Clamp name length
Username = Username.Truncate(Settings.MaxNameLength);
}
示例8: NotifySend
public virtual S2C.Message.NotifySend NotifySend(NetIncomingMessage im)
{
Message.NotifySend data = new Message.NotifySend();
data.from_id = im.ReadString();
data.message = im.ReadString();
if(OnNotifySend != null) OnNotifySend(im, data);
return data;
}
示例9: ReqSend
public virtual C2S.Message.ReqSend ReqSend(NetIncomingMessage im)
{
Message.ReqSend data = new Message.ReqSend();
data.to_id = im.ReadString();
data.message = im.ReadString();
if(OnReqSend != null) OnReqSend(im, data);
return data;
}
示例10: Read
public static PlayerInformation Read(NetIncomingMessage packet)
{
Byte slot = packet.ReadByte();
TeamType team = (TeamType)packet.ReadByte();
String callsign = packet.ReadString();
String tag = packet.ReadString();
return new PlayerInformation(slot, callsign, tag, team);
}
示例11: onserverrecieve
public override void onserverrecieve(NetIncomingMessage message)
{
var chat = PacketWriter.write<Packet_Chat>(NetEndpoint.SERVER);
chat.outgoingmessage.Write(message.ReadString());
chat.outgoingmessage.Write(message.ReadString());
chat.send();
base.onserverrecieve(message);
}
示例12: ResSend
public virtual S2C.Message.ResSend ResSend(NetIncomingMessage im)
{
Message.ResSend data = new Message.ResSend();
data.ret = im.ReadInt16();
data.ret_message = im.ReadString();
data.to_id = im.ReadString();
if(OnResSend != null) OnResSend(im, data);
return data;
}
示例13: OnDataReceived
public override void OnDataReceived(NetIncomingMessage incMsg)
{
NetDataType type = (NetDataType)incMsg.ReadByte();
if (type == NetDataType.eDATA_REQUEST_LOGIN)
{
string accountName = incMsg.ReadString();
string password = incMsg.ReadString();
Login(accountName, password, incMsg.SenderConnection);
}
}
示例14: IncomingChangeLevel
protected void IncomingChangeLevel(NetIncomingMessage msg)
{
string levelName = msg.ReadString();
string levelData = msg.ReadString();
double delayTime = double.Parse(msg.ReadString());
double recieveTime = msg.ReceiveTime / 1000;
double actualDelayTime = delayTime - recieveTime;
DownloadLevel(levelName, levelData);
OnChangedLevel(levelName, actualDelayTime);
}
示例15: DataProcessing
// TODO: Merge opcodes for move direction, something like that: Move(LookDirection)
void DataProcessing(NetIncomingMessage message, ref Client client)
{
switch (message.ReadByte())
{
case (byte)MessageType.ClientMessage.NeedMap:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Need map ! Let's give it to him :)");
ReceiveNeedMap(client);
break;
case (byte)MessageType.ClientMessage.MapSelection:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Has selected a map to play ! :)");
ReceiveMapSelection(client, message.ReadString());
break;
case (byte)MessageType.ClientMessage.Credentials:
ReceiveCredentials(client, message.ReadString(), message.ReadString());
break;
case (byte)MessageType.ClientMessage.Ready:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Ready message !");
ReceiveReady(client, message.ReadBoolean());
break;
case (byte)MessageType.ClientMessage.WantToStartGame:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] WantToStartGame message !");
ReceiveWantToStartGame();
break;
case (byte)MessageType.ClientMessage.HasMap:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] HasMap message !");
ReceiveHasMap(client);
break;
case (byte)MessageType.ClientMessage.MoveDown:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move down !");
ReceiveMovePlayer(client, LookDirection.Down);
break;
case (byte)MessageType.ClientMessage.MoveLeft:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move left !");
ReceiveMovePlayer(client, LookDirection.Left);
break;
case (byte)MessageType.ClientMessage.MoveRight:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move right !");
ReceiveMovePlayer(client, LookDirection.Right);
break;
case (byte)MessageType.ClientMessage.MoveUp:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move up !");
ReceiveMovePlayer(client, LookDirection.Up);
break;
case (byte)MessageType.ClientMessage.Standing:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to stay here !");
ReceiveMovePlayer(client, LookDirection.Idle, message.ReadTime(client.ClientConnection, true));
break;
case (byte)MessageType.ClientMessage.PlaceBomb:
Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to place bomb !");
ReceiveBombPlacing(client);
break;
}
}