void OnPlayerDie(IByteArray byteArray) { var msg = new MsgBytes(byteArray); var playerName = msg.Read <string>(10); //Get player name var gold = msg.Read <int>(); //Get player's gold //player die logic }
void Send() { MsgBytes msgBytes = new MsgBytes(); int x = 10; msgBytes.Write(x); //tcp.send(msgBytes.ByteArray.Read(msgBytes.ByteArray.Length)); }
void Msg_Bytes() { var msg = new MsgBytes(); int x = 10; msg.Write(x); byte[] bytes = msg.ByteArray.Read(msg.ByteArray.Length); _tcp.Send(bytes); }
void OnMsg_Bytes(IByteArray byteArray) { var msg = new MsgBytes(byteArray); int getInt = msg.Read <int>(); }
void OnMsg(IByteArray iByteArray) { MsgBytes msgBytes = new MsgBytes(iByteArray); int x = msgBytes.Read <int>(); }