Esempio n. 1
0
        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());
        }
Esempio n. 2
0
    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();
        }
    }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
 public void Response9(byte[] responseBytes, Socket fromSocket, int fromId)
 {
     _client.ourId = int.Parse(ByteParser.ConvertToASCII(responseBytes));
     Logging.CreateLog("Recieved the id: " + _client.ourId);
 }
Esempio n. 5
0
 public void Response4(byte[] responseBytes, Socket fromSocket, int fromId)
 {
     Logging.CreateLog("Recieved a command response: " + ByteParser.ConvertToASCII(responseBytes));
 }
Esempio n. 6
0
 public void Response20(byte[] responseBytes, Socket fromSocket, int fromId)
 {
     Console.WriteLine("Recieved a 20: " + ByteParser.ConvertToASCII(responseBytes));
 }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
 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);
 }