[ADD] added sending the lobbies data from the server to the clients on startup
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using Client;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SharedClientServer
|
||||
@@ -79,6 +81,14 @@ namespace SharedClientServer
|
||||
});
|
||||
}
|
||||
|
||||
public static Lobby[] GetLobbiesFromMessage(byte[] json)
|
||||
{
|
||||
dynamic payload = JsonConvert.DeserializeObject(Encoding.ASCII.GetString(json));
|
||||
JArray lobbiesArray = payload.lobbies;
|
||||
Debug.WriteLine(lobbiesArray.ToString());
|
||||
return lobbiesArray.ToObject<Lobby[]>();
|
||||
}
|
||||
|
||||
public static int GetLobbyID(byte[] json)
|
||||
{
|
||||
dynamic payload = JsonConvert.DeserializeObject(Encoding.ASCII.GetString(json));
|
||||
|
||||
Reference in New Issue
Block a user