Example #1
0
 public void SaveRoom(int id, V_RoomTemplate room)
 {
     if (Rooms.ContainsKey(id))
     {
         Rooms[id] = room;
         // #revision if currentRoomId is going to be set from other methods except SaveRoom()
         currentRoom = room;
     }
 }
Example #2
0
 public void RemoveRoom(int id)
 {
     if (Rooms.ContainsKey(id))
     {
         Rooms.Remove(id);
     }
     currentRoom    = null;
     isMasterServer = false;
 }
Example #3
0
 public void QuickStartRoom(GameModes mode)
 {
     for (int i = 0; i < Rooms.Count; i++)
     {
         // #revision
         if (Rooms[i].gameMode == mode)
         {
             currentRoom = Rooms[i];
             break;
         }
     }
     // there was no Room with that GameModes, so
     //  UIController.ThrowError("V_CustomLobbyManager: QuickStartRoom(): No room with your selected GameMode");
 }
Example #4
0
    public void SaveRoom(V_RoomTemplate room)
    {
        // check if the Room is Valid

        // #revision
        // currentRoomId = something from the server
        int serverRoomId = UnityEngine.Random.Range(1, 100);

        if (!Rooms.ContainsKey(serverRoomId))
        {
            room.ID = serverRoomId;
            Rooms.Add(serverRoomId, room);

            currentRoom = room;
        }
        else
        {
            // UIController.ThrowError("V_CustomLobbyManager: SaveRoom(): Mismatch in Room ID");
        }
    }
Example #5
0
    void ChangeGameMode(GameModes mode)
    {
        V_RoomTemplate tmpRoom = new V_RoomTemplate();

        tmpRoom.gameMode = mode;

        if (firstCreateTheRoom)
        {
            // register the room on the server
            // and then on the lobby manager
            LobbyManager.isMasterServer = true;
            LobbyManager.SaveRoom(tmpRoom);
            UIController.Enable_DisableUI(UIController.RoomModalPanel);
        }
        else
        {
            // filter the Available Rooms base on the selected gameMode
            LobbyManager.isMasterServer = false;
            LobbyManager.QuickStartRoom(mode);
            UIController.GoFrom_To(UIController.LobbyPanel, UIController.RoomPanel);
        }
    }