private void SetGamePackIndexes(string json) { packIds = JsonUtility.FromJson <IDPack>(json); packJsons = new JSonPack(); packJsons.ids = packIds.values; packJsons.values = new string[packIds.values.Length]; GetNextGamePack(); }
public void LoadGames(JSonPack packs, JSonPack games, List <int> unblockedPacks) { tempPacks = packs; tempGames = games; tempUnblockedPacks = unblockedPacks; RpcSetPacks(tempPacks.ids.Length); //RpcLoadGames(packs, games, unblockedPacks.ToArray()); }
private void RpcSetGames(int size) { if (!isLocalPlayer) { return; } getGameItterator = 0; tempGames = new JSonPack(); tempGames.ids = new int[size]; tempGames.values = new string[size]; CmdGetGame(getGameItterator); //CmdTriggerLoadGames(); }
private void SetGameDataIndexes(string json) { gameIds = JsonUtility.FromJson <IDPack>(json); List <int> ids = new List <int>(gameIds.values); for (int i = ids.Count - 1; i >= 0; i--) { if (ids[i] < ignoreGameIdsBelow) { ids.RemoveAt(i); } } gameJsons = new JSonPack(); gameJsons.ids = ids.ToArray(); gameJsons.values = new string[ids.Count]; GetNextGameData(); }
private void UnPackGames(JSonPack packs, JSonPack games, int[] unblockedPacks) { List <int> unblocked = new List <int>(unblockedPacks); clientState.gamePacks = new List <GamePack>(); foreach (var gamePackJson in packs.values) { GamePack gamePack = ScriptableObject.CreateInstance <GamePack>(); JsonUtility.FromJsonOverwrite(gamePackJson, gamePack); foreach (var gameIDPair in gamePack.gameIDPairs) { gameIDPair.gameInfo = GameInfoBase.FromJson(games.GetJsonOfId(gameIDPair.id)); } gamePack.blocked = gamePack.startBlocked; if (unblocked.Contains(gamePack.id)) { gamePack.blocked = false; } clientState.gamePacks.Add(gamePack); Debug.Log("GamePack " + clientState.gamePacks[clientState.gamePacks.Count - 1].id); } gamesLoaded = true; CmdGetLoginState(); }