[FIX] Callbacks weren't properly called

This commit is contained in:
Dogukan
2020-10-23 14:49:20 +02:00
parent 80d970da35
commit 7df48ab322
3 changed files with 4 additions and 25 deletions

View File

@@ -48,19 +48,12 @@ namespace Client.ViewModels
}
private string _randomWord;
public string RandomWord
{
get { return _randomWord; }
set { _randomWord = value; }
}
public static string Word
{
get;
set;
}
public bool IsHost
{
get { return data.User.Host; }
@@ -69,17 +62,6 @@ namespace Client.ViewModels
public ViewModelGame(GameWindow window)
{
this.window = window;
if (_payload == null)
{
_message = "";
}
else
{
//_message = data.Message;
//_username = data.User.Username;
//Messages.Add($"{data.User.Username}: {Message}");
}
buffer = new double[maxLines][];
linesQueue = new Queue<double[][]>();
@@ -228,7 +210,7 @@ namespace Client.ViewModels
data.Client.SendMessage(JSONConvert.GetMessageToSend(JSONConvert.MESSAGE, _payload));
}
public static void HandleIncomingMsg(string username, string message)
public void HandleIncomingMsg(string username, string message)
{
Application.Current.Dispatcher.Invoke(delegate
{
@@ -241,12 +223,12 @@ namespace Client.ViewModels
data.Client.SendMessage(JSONConvert.ConstructLobbyLeaveMessage(data.Lobby.ID));
}
public static void HandleRandomWord(string randomWord)
public void HandleRandomWord(string randomWord)
{
Debug.WriteLine("[CLIENT] Reached the handle random word method!");
Application.Current.Dispatcher.Invoke(delegate
{
Word = randomWord;
RandomWord = randomWord;
});
}
public void HandleIncomingPlayer(Lobby lobby)