Threading and operations in a custom server solution

Options
I have looked at many examples of photon usage and from what I can tell the 2 main ways that people structure their project is they run with a plugin, peer to peer and use raise event to send events to all the clients, or they run an application(like the mmorpg example) and they can have operations that get sent to the server.

I am trying to do something in the middle. My game is server controlled entirely and I want the clients to send messages to the plugin and I don't want those messages to go to the other clients. All the examples I have seen are using the Peer\operation code which doesn't seem to fit the design structure of a plugin which uses the plugin class and has overides like OnRaiseEvent.

I see that I could potentially use groups or something to try to have nobody but the server see a message, but it feels like this is not the right approach to use the client broadcasting of events just to talk to my plugin code.

The 2nd question here is I want the game to run itself and not be event driven. In my plugin create room code I could create a plain C# thread to run the game logic, but if i have a few thousand games running thats a few thousand threads. Is this the desired approach for that?

Finally I cannot find any premium support or contact info to be able to discuss things with photon directly, even if it costs money. Do they have any sort of way to get official feedback, as I would really like a way to present my plans to an expert in photon and ask, is this really the way I should be doing this.

Thanks!

Comments

  • chvetsov
    Options
    Hi
    1.if you are going to use plugins i would recommend to you to use RaiseEvent operations. you may override handler for this operation in plugin and call method Cancel if you do not want to broadcast this event to other clients. This will perfectly fit to photon and serve all your needs

    2. using threads is not really good idea in your case. use timers. from plugin code you may create timer at any moment. the only thing is that it will not be called exactly at spcefied time. lets say every 100 ms. becase actor action is put to rooms fiber queue, so it will be executed when alll actions before it will be executed

    3. developer@photonengine.com