public void SingleStep() { EndPoint sender = transport.CreateEndPoint(); byte[] data = transport.Recv(256, ref sender); if (data != null) { Array.Reverse(data); transport.Send(data, sender); } }
public void SingleStep() { EndPoint sender = transport.CreateEndPoint(); byte[] data = transport.Recv(256, ref sender); if (data != null) { byte command = data[0]; if (commandsTable.ContainsKey(command)) { commandsTable[command](data, sender); } } }
public void Update() { EndPoint sender = transport.CreateEndPoint(); byte[] data = transport.Recv(256, ref sender); if (data != null) { string message = ConvertBytesToString(data); string invMess = Reverse(message); byte[] invData = ConvertStringToBytes(invMess); } }
public void SingleStep() { EndPoint sender = transport.CreateEndPoint(); byte[] data = transport.Recv(256, ref sender); if (data != null) { byte gameCommand = data[0]; if (commandsTable.ContainsKey(gameCommand)) { commandsTable[gameCommand](data, sender); } else { throw new ServerException("Invalid GameCommand"); } } }
//Dispatcher that recive packet and call every right command //TODO //Add Malus To Client who try to send empty packet public void SingleStep() { //if Game in a room is starting do this foreach (Room room in Rooms) { room.Process(); } EndPoint sender = transport.CreateEndPoint(); byte[] data = transport.Recv(256, ref sender); if (data == null) { return; } commands[data[0]](data, sender); }