public SocketCommand(SocketCommands cmd, SocketCommandData met) { Command = cmd; Metadata = met; }
// ??? Use this Socket xx, ClientSocket xx in parameters //Not neccesary to get byte[], ... also, I will move this to new class called SocketHandler, Deserialize and Serialize not needed anymore //Reimplement here serialize / deserialize functions? //0 means that the message is not for any client, is a broadcast message sended to the server, so, we have to handle errors when we don't manage it correctly. public static object SendCommand(SocketCommands cmd, SocketCommandData data, ulong OriginClientId = 0) { return(new SocketMessage(OriginClientId, new SocketCommand(cmd, data))); }