diff --git a/Client/ViewModels/ViewModel.cs b/Client/ViewModels/ViewModel.cs index 7ff0778..23b7b53 100644 --- a/Client/ViewModels/ViewModel.cs +++ b/Client/ViewModels/ViewModel.cs @@ -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; } diff --git a/SharedClientServer/JSONConvert.cs b/SharedClientServer/JSONConvert.cs index fc036c6..86b481b 100644 --- a/SharedClientServer/JSONConvert.cs +++ b/SharedClientServer/JSONConvert.cs @@ -18,10 +18,11 @@ namespace SharedClientServer public const byte MESSAGE = 0x02; public const byte LOBBY = 0x03; public const byte CANVAS = 0x04; - public const byte RANDOMWORD = 0x05; - public const byte MESSAGE_RECEIVED = 0x06; public const byte GAME = 0x05; - + public const byte MESSAGE_RECEIVED = 0x06; + public const byte RANDOMWORD = 0x07; + + public enum LobbyIdentifier { HOST,