added methods to send to all in lobby
This commit is contained in:
@@ -8,6 +8,15 @@ namespace SharedClientServer
|
||||
{
|
||||
class ClientServerUtil
|
||||
{
|
||||
// creates a message array to send to the server or to clients
|
||||
public byte[] createPayload(byte id, string payload)
|
||||
{
|
||||
byte[] stringAsBytes = Encoding.ASCII.GetBytes(payload);
|
||||
byte[] res = new byte[stringAsBytes.Length + 1];
|
||||
res[0] = id;
|
||||
Array.Copy(stringAsBytes, 0, res, 1, stringAsBytes.Length);
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user