Ejemplo n.º 1
0
        private void Start()
        {
            user = new User();
            try {
                ObjectJSON ID = ParserJSON.getObjectJSONFromAsset("ID");
                userId   = (ulong)ID.getLong("userId");
                userName = ID.getString("userName");
                Debug.Log("Using custom ID loaded from file.");
            } catch (Exception) {
                Debug.Log("Using default ID.");
            }
            user.userId   = userId;
            user.userName = userName;
            InitializeClient();

            // TEMP
            // TODO : REMOVE AND INJECT CLASSIC IDENTIFICATION ROUTINE

            /*GameLogicClient game = new GameLogicClient("M002");
             * game.gameId = 1;
             * game.currentTurn = 0;
             * user.currentGameId = game.gameId;
             * for (int i = 0; i < 2; i++) {
             *  ulong playerId = (ulong)i;
             *  int cellId = DataManager.MAP_DATA["M002"].getSpawns(2)[i];
             *  int entityId = i;
             *  string displayedName = "Player " + i;
             *  float r = 255;
             *  float g = 255 * i;
             *  float b = 255 - 255 * i;
             *
             *  Player temp = CreatePlayer(playerId, cellId, entityId, displayedName, r, g, b);
             *  if (user.userId == playerId) {
             *      user.player = temp;
             *  }
             *  temp.playerEntity.initSpell(new string[4] { "S001", "S002", "S003", "S004" });
             *  temp.playerEntity.teamId = i;
             * }
             * GUIManager.gui.linkWithLocalEntity(game.localEntity);
             * GameLogicClient.game.prepareNewTurn(DateTime.UtcNow.AddSeconds(5).ToFileTimeUtc());*/
            // END TODO : REMOVE
        }