public static NetworkResponse Parse(MemoryStream dataStream) { ResponseMatchStatus response = new ResponseMatchStatus(); response.matchID = DataReader.ReadInt(dataStream); response.isActive = DataReader.ReadBool(dataStream); response.opponentIsReady = DataReader.ReadBool(dataStream); return(response); }
//Response to the server's ready request public void ProcessMatchStatus(NetworkResponse response) { //Retrieve the response arguments ResponseMatchStatus args = response as ResponseMatchStatus; //Request the deck from Server GetDeck(); //Set variables passed in from server related to the match's status GameManager.player1.isActive = args.isActive; GameManager.opponentIsReady = args.opponentIsReady; //Display the arguments passed from server Debug.Log("GameManager.player1 isActive: " + GameManager.player1.isActive + " opponentIsReady " + GameManager.opponentIsReady); }