[ADD] added sending the lobbies data from the server to the clients on startup

This commit is contained in:
Sem van der Hoeven
2020-10-20 21:12:31 +02:00
parent ba1b71d870
commit 671951c35b
6 changed files with 57 additions and 8 deletions

View File

@@ -123,6 +123,13 @@ namespace Server.Models
case JSONConvert.LOBBY:
// lobby data
LobbyIdentifier l = JSONConvert.GetLobbyIdentifier(payload);
switch(l)
{
case LobbyIdentifier.REQUEST:
Debug.WriteLine("[SERVERCLIENT] got lobby request message, sending lobbies...");
sendMessage(JSONConvert.ConstructLobbyListMessage(ServerCommunication.INSTANCE.lobbies.ToArray()));
break;
}
break;
case JSONConvert.CANVAS:
// canvas data
@@ -132,7 +139,6 @@ namespace Server.Models
Debug.WriteLine("[SERVER] Received weird identifier: " + id);
break;
}
//TODO implement ways to handle the message
}
/// <summary>