public static NetworkResponse Parse(MemoryStream dataStream) { ResponseWaitingList response = new ResponseWaitingList(); String tempName; int tempId; //response contains series of strings and ints (player name and id) terminated by an empty string and id of -1 tempName = DataReader.ReadString(dataStream); tempId = DataReader.ReadInt(dataStream); while (tempName != "" || tempId != -1) { response.nameQueue.Enqueue(tempName); response.idQueue.Enqueue(tempId); tempName = DataReader.ReadString(dataStream); tempId = DataReader.ReadInt(dataStream); } return response; }
public static NetworkResponse Parse(MemoryStream dataStream) { ResponseWaitingList response = new ResponseWaitingList(); String tempName; int tempId; //response contains series of strings and ints (player name and id) terminated by an empty string and id of -1 tempName = DataReader.ReadString(dataStream); tempId = DataReader.ReadInt(dataStream); while (tempName != "" || tempId != -1) { response.nameQueue.Enqueue(tempName); response.idQueue.Enqueue(tempId); tempName = DataReader.ReadString(dataStream); tempId = DataReader.ReadInt(dataStream); } return(response); }