need help in litelobby Marmalade C++

edited October 2011 in Native
hi,

I want to perform following task in my game which using litelobby as server application:

1. restrict room to 4 user(actors)... [i read some where litelobby manage it internally but not happening at my end]
2. litelobby to create new room if room is full i.e. already have 4 users(actors) [currently I set room name from client side by saying opJoin("room name"), will litelobby manage it if specified room is full or i have do changes at server side? ]

it will be great help if u suggest documentation or example which will help me or which i may be missing out.

thanks

Comments

  • Hi.
    Well, I am afraid, that LiteLobby does not provide this functionality out of the box and you would have to implement it yourself.
  • it's said here at http://doc.exitgames.com/v2/liteandlite ... byconcepts under "Rooms for games"
    just i found it while going through...

    actually I don't want user to see rooms. as soon as user connect with server, it will redirect him/her to available room. we specify room name while joining.

    so just a query, is there any way to take call on server side? where i can make change for the same in litelobby application?

    thanks
  • Check out the server code. Specifically you should visit the places where the operation Join is handled. It should be in the Peer, where your client's requests will show up. Modify Join to get a room from a list or create a new one if you don't find a fitting one.

    The Loadbalancing application has a JoinRandomGame operation, so that could be 80% what you need. It does not (yet) create a new room if there is none.
  • thanks for your help but i am not able to find Loadbalancing application. can you please tell me where i can get it. :(

    i found the place at server side for joining... will work on it & will let you know update about it.

    thanks once again.
  • You find it here in the server SDK. Download the zip here:
    www.exitgames.com/Download/Photon
    Inside its located here:
    src-server\Loadbalancing
  • thanks Tobias.
    load balancing is there in Server 3.0 which I can't use since I am working on Marmalade which not support it. but I gone through it & it is useful to understand game logic implementation at server side.

    now I am working in class RoomCacheBase where new room is created.
    I am done with available room check implementation. but I want to check in that available room how many actors are present, which I am not able to find out.

    public RoomReference GetRoomReference(string roomName, params object[] args)
    {
    //some code
    ulong roomIndex = Room.GetTotalRooms();
    bool isRoomAvailable = false;

    for (ulong i = 0; i < roomIndex; i++)
    {

    if (this.roomInstances.TryGetValue("Temp" + i, out roomInstance))
    {
    //here i want to check is current room have actors < 4
    //if(actor in room "Temp"+i <4)
    not able to find any way or property in this class to check actors count in particular room
    isRoomAvailable = true;
    break;
    }
    }

    if (!isRoomAvailable)
    {
    Room room = this.CreateRoom("Temp" + roomIndex, args);
    roomInstance = new RoomInstance(this, room);
    this.roomInstances.Add("Temp" + roomIndex, roomInstance);
    }
    //some code
    }

    please help me out in it.
  • I manage to fix it... Thanks :D
Sign In or Register to comment.