Triggering Events, persisting state on a plugin?

Hi all,

I have a fairly simple realtime game working using the realtime SDK in C#. It's round-based, with games/rooms lasting only a few minutes at a time.

There's two things that I'm handling on the client right now that I'd like to have happening on the server. It's unclear to me if this is possible to achieve via plugins so I wanted to check.

1.) Triggered/looped-time events; every few seconds, I trigger an event on the clients. Could I set this up as a timeout loop or similar in a plugin, starting when the server is created (and then checking a flag for if the game's started)? E.g.
- On Game Start
- Start timeout loop
- On each cycle, if "game has started" flag, trigger event

2.) Tracking players' attributes. This seems like it should be taken care of, given there's an actor list; but can I track data associated with each player in the plugin, and perform logic on it triggered by events they send? e.g. I would like to run something like (quasi-code):
- Receive message from player
- check a condition on another player's status, which is tracked on the plugin
- respond accordingly

The long and short of it is it's unclear to me if the plugin associated with a room has its instance state persisted through the lifecycle of thee room. A few pieces of documentation mentioned a lack of persistence layer/needing to use a third party database, but I'm hoping that's just for long term storage and that a plugin can hold local state variables.

Thanks!

Comments

  • hi, @Craig

    all that you described is possible to get with plugin. the only thing is that you can not use custom plugin in public cloud. You have to order enterprise cloud or host photon your self. Last is not so difficult :)

    best,
    ilya
Sign In or Register to comment.