I'm working on a game where the client is an XNA program and the server is a
WPF program. Everything works properly upto connecting, but when I try to send
data to the server it only gets the first thing I wrote, regardless of data
type. Example:
Client side:
NetOutgoingMessage lobbyMsg = client.CreateMessage();
//Set Type
lobbyMsg.Write(0);
//Send Player Name, Character
lobbyMsg.Write("name");
Server Side:
byte dataType = im.ReadByte();
switch (dataType)
{
//Lobby Data
case 0:
{
//Update Player Data
string playerName = im.ReadString();
//Find that player
PlayerData player;
if (playerDictionary.TryGetValue(im.SenderEndpoint, out player))
{
player.myName = playerName;
}
break;
}
}
The server will read the byte but it won't read the string. Why would this be?
Original issue reported on code.google.com by kirbyfan...@gmail.com on 17 Sep 2012 at 5:57
Original issue reported on code.google.com by
kirbyfan...@gmail.com
on 17 Sep 2012 at 5:57