private void JoinGameResponse(byte[] bytes, IPEndPoint refEP) { JoinGameConv conv = ConversationFactory.Instance.CreateFromMessage <JoinGameConv>(bytes, refEP, null, null, null); JoinGame result = Message.Decode <JoinGame>(bytes); Player player = result.Player; player.SetIP(refEP); GamesOnLobby.HandleJoinGame(result.Player, result.GameID); conv._Game = GamesOnLobby.gameList[result.GameID]; conv.Start(); }
private void JoinButton_Click(object sender, EventArgs e) { if (SelectedGame == null) { return; } JoinGameConv conv = ConversationFactory .Instance.CreateFromConversationType <JoinGameConv> (server, null, JoinGamePostExecute, null); Thread convThread = new Thread(conv.Execute); //Add values to conversation from selected game conv._GameId = Int32.Parse(SelectedGame.SubItems[1].Text); conv._Player = Player; convThread.Start(); }