Merge pull request #11 from SemvdH/setupBranch

merge Setup branch into master
This commit is contained in:
SemvdH
2020-10-23 14:06:36 +02:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ namespace Client
Debug.WriteLine("attempting to host game for " + ClientData.Instance.User.Username);
client.SendMessage(JSONConvert.ConstructLobbyHostMessage());
client.OnLobbyCreated = becomeHostForLobby;
}
private void becomeHostForLobby(int id)
@@ -68,6 +69,7 @@ namespace Client
Debug.WriteLine($"got host succes with data {id} ");
wantToBeHost = true;
wantToBeHostId = id;
ClientData.Instance.User.Host = true;
client.OnLobbiesReceivedAndWaitingForHost = hostLobbiesReceived;
}

View File

@@ -29,6 +29,7 @@ namespace Client.Views
{
User user = new User(usernameTextbox.Text);
Client client = new Client(user.Username);
loginButton.IsEnabled = false;
client.OnSuccessfullConnect = () =>
{
// because we need to start the main window on a UI thread, we need to let the dispatcher handle it, which will execute the code on the ui thread
@@ -42,6 +43,7 @@ namespace Client.Views
});
};
}
}
}