Invoking Operations without a game?

Options
anubhab123
edited December 2011 in Photon Server
Hello everyone

I Am attempting currently to figure out how to implement things such as a login or storing data on the server that is available to all users. I have read the photon API reference and found A workflow that seems to say that I have to join a game before sending data. But what if there is no game currently like if they are at a login screen? Then I would still need to send data which would be the username and password. Do I just create a custom operation and send data without joining/creating a game? Or am I required to create a game to send data to the server?

Thank you very much for any help you give!

Comments

  • Tobias
    Options
    You don't have to get into a room to call operations. The operation "Join" would not work either ;)
    You can handle operations in the Peer class. That's where login should be done and where Join is handled, I think.

    A similar topic:
    viewtopic.php?f=5&t=1122&view=unread#p5208
  • Thank you so much Tobias!

    I have one other question though if you don't mind.
    It says in the documentation that I would need to continuously call service() in the PhotonPeer class to send operations and receive events. It suggests to call service once per game loop. But at a login screen there is no game loop but I might still need to send operations and receive events. Do I still need to continuously call service in a loop to receive events or send operations at login screen? I was thinking if I need to I could call service() on a background thread.
  • Maybe I can call Service() after I invoke the operation when there is no game loop?
  • Kaiserludi
    Options
    Hi.
    You will still have to call it continuously, when being in a lobby, otherwise the client won't have any chance to tell the server from time to time by automatically sending out pings, when you don#t send anything, that it's still there and the server would disconnect you after a timeout-period.
  • Thank you so much Tobias and Kaiserludi! You have been a really great help!