A Lite lobby Application

Options
Danco
edited January 2012 in Photon Server
Well, this might seems like noobish question to some of you inhere.
However this problem drives me kinda crazy.
As im into making a Photon based chat solution i am trying to get into the nature of the Photon Lite Lobby application.

I have the server set up an running the officiel Lite lobby sample which is working perfectly. What I am trying to accomplish now is doing some manipulation and logging of the incomming chat message before its returned to peers in the chatroom (game). Because of the structure I cant seem to figure out where this message is received and sent back to peers. Could someone please please help me on this issue.
At the same time I will need to set up a list of predefined chatrooms for the peers to join. I've tried to add these to the hashtable roomlist. But unfurtunatly that doesnt seems to be working. Could anyone give me a few ideas to work with.

Thanks in advance.

Comments

  • Tobias
    Options
    The demo uses an operation called "RaiseEvent". This is handled in the game room class.
    LiteLobby extends Lite and adds new classes. The LiteLobbyGame.cs extends the LiteGame class, where you will find HandleRaiseEventOperation.
    In principle, it takes the content of the operation (data sent by one player) and sends it as events to the others. There you could modify this data.

    The predefined list of rooms means you have to add the room names to the list of available rooms and set the player count to 0. Clients usually join rooms that are existing and have > 0 players.
    In LiteLobby, I think joining a empty room will work. In the Photon Cloud, you would CREATE rooms that have 0 players and JOIN rooms with >= 1 players.
  • Hi Tobias, thanks for your reply which helped me alot. I got the point of the structure in the application.
    Tobias wrote:
    The predefined list of rooms means you have to add the room names to the list of available rooms and set the player count to 0. Clients usually join rooms that are existing and have > 0 players.
    In LiteLobby, I think joining a empty room will work. In the Photon Cloud, you would CREATE rooms that have 0 players and JOIN rooms with >= 1 players.

    Could you please give me some kind of hint where to set these room names, I've tried output debug messages to the log in order to find out where these rooms are initialized but without any luck so far.
    It would help me alot with some piece of code.

    At the same time i am trying to find a way of determine which chatroom a given chatmessage was send in. This is for logging purposes. However i does seems like there is anykind of reference between these classes. Or im I mistaken ?
  • Tobias
    Options
    A room know it's own name, so when you want to log, use that. Don't access a room from anywhere else though. It's built to run in a thread from the threadpool and accessing it directly can cause a lot of harm.

    There is a method that sends the room list. Check it out. It should be the best place to add "default" rooms.