private void ProcessGameCreate(byte[] msg, int currIndex) { string userHost; Game newGame = new Game(); currIndex++; StringBuilder s = new StringBuilder(); while (msg[currIndex] != 0) { s.Append((char)msg[currIndex++]); } userHost = s.ToString(); User host = users.GetUserFromName(userHost); newGame.host = host; newGame.gameHost = s.ToString(); currIndex++; s.Clear(); while (msg[currIndex] != 0) { s.Append((char)msg[currIndex++]); } newGame.name = s.ToString(); if (host == null) { return; } if (host.Category.Equals("Buddies")) { KailleraTrayManager.Instance.handleTrayEvent(TrayFlags.PopValues.gameCreated, host, newGame.name); } if (users.GetUserFromName(username).Equals(host)) { currGame = newGame; } s.Clear(); currIndex++; while (msg[currIndex] != 0) { s.Append((char)msg[currIndex++]); } newGame.emuName = s.ToString(); currIndex++; newGame.id = BitConverter.ToInt32(msg, currIndex); games.AddGame(newGame); gamesChanged(games); GUIManager.UpdateGames(games); }
private void ProcessGameCreate(byte[] msg, int currIndex) { Game newGame = new Game(); currIndex++; StringBuilder s = new StringBuilder(); while (msg[currIndex] != 0) { s.Append((char)msg[currIndex++]); } User host = users.GetUserFromName(s.ToString()); newGame.host = host; currIndex++; s.Clear(); while (msg[currIndex] != 0) { s.Append((char)msg[currIndex++]); } newGame.name = s.ToString(); s.Clear(); currIndex++; while (msg[currIndex] != 0) { s.Append((char)msg[currIndex++]); } newGame.emuName = s.ToString(); currIndex++; newGame.id = BitConverter.ToInt32(msg, currIndex); games.AddGame(newGame); GUIManager.UpdateGames(games); }