public void Response51(byte[] responseBytes, Socket fromSocket, int fromId) { Console.WriteLine("Recieved a 51: " + fromId + ": " + responseBytes.Length); int idToJoin = int.Parse(ByteParser.ConvertToASCII(responseBytes)); _server.JoinRoom(fromSocket, idToJoin.ToString()); }
void MessageResponse(byte[] response, Socket socket, int from) { string message = ByteParser.ConvertToASCII(response); if (message.Equals("Full")) { ResponseMessage messageResposne = new ResponseMessage(); messageResposne.type = ResponseMessage.ResponseType.Full; OnConnected(messageResposne); Disconnect(); } }
public void Response7(byte[] responseBytes, Socket fromSocket, int fromId) { string message = ByteParser.ConvertToASCII(responseBytes); Logging.CreateLog("Recieved a message: " + message); if (message.Contains("Full Room")) { Logging.CreateLog("Room full!!!"); UIManager.instance.FailedConnect("Full"); } if (message.Contains("Not Exist")) { Logging.CreateLog("Room DNE!!!"); UIManager.instance.FailedConnect("Not Exist"); } if (message.Contains("Over")) { UIManager.instance.Over(); } if (message.Contains("Lost")) { UIManager.instance.Lost(); } if (message.Contains("Win")) { UIManager.instance.Win(); } if (message.Contains("Players")) { UIManager.instance.PlayerLost(); } }
public void Response9(byte[] responseBytes, Socket fromSocket, int fromId) { _client.ourId = int.Parse(ByteParser.ConvertToASCII(responseBytes)); Logging.CreateLog("Recieved the id: " + _client.ourId); }
public void Response4(byte[] responseBytes, Socket fromSocket, int fromId) { Logging.CreateLog("Recieved a command response: " + ByteParser.ConvertToASCII(responseBytes)); }
public void Response20(byte[] responseBytes, Socket fromSocket, int fromId) { Console.WriteLine("Recieved a 20: " + ByteParser.ConvertToASCII(responseBytes)); }
public void Response21(byte[] responseBytes, Socket fromSocket, int fromId) { Console.WriteLine("Recieved a 21: " + fromId + ": " + ByteParser.ConvertToASCII(responseBytes)); CommandHandler.RunCommand(ByteParser.ConvertToASCII(responseBytes), fromSocket, fromId); }
public void Response21(byte[] responseBytes, Socket fromSocket, int fromId) { Logging.CreateLog("Recieved a 21: " + fromId + ": " + ByteParser.ConvertToASCII(responseBytes)); CommandHandler.RunCommand(ByteParser.ConvertToASCII(responseBytes), fromSocket, fromId); }