What is the common way to use unity at server for business logic

For example i want to launch unity for each room(custom room code, not silly plugins). That is easy (looked into photonSwarm sources and you did exactly the same thing).

What's next? I want to process everything in that room using unity, so i should send messages to that unity instance.

1)I guess i need to make some sort of reserved photonPeer slot in room and pass roomId as arguments when i launch unity (so it will connect to that room and do some sort of authorization handshake)

Okay, so when any operation request received by room it will send it to that reserved photonPeer ....
Unity does something and sends response as request to room to transmit that message

2)I saw in photonSwarm there is used some sort of Pipe, but i didn't understood it yet. May be it's magic. hm.

3)Any other ideas?

Comments

  • approach with unity scales not very well.

    another idea could be use plain photon plugin

    best,
    ilya
  • I don't like idea of plugins, as i don't know how it works with threads, if only there would be more info about that topic in photon's scope

    I saw your post about rooms and threading (we should use queues and it will execute one by one may be on different threads)
  • Nevermind, i just can't see shit:

    "allowing to use lock free code: plugin instances will never get more than one call at the time and the framework provides a HTTP client and timers integrated in the underlying Photon message passing architecture (fibers)."


    found it on first page of plugins manual, i was sure there was none, gonna dig deep

    see me soon with another questions :D

    Actually, is it fine to use plugin's timers to update physics? I guess it is
  • hi, @TomatoFromTheSky

    yes, it is fine. but you should be aware that you will not be able to get exatct delta in all the cases. it might be slightly bigger. how bigger depends on loading of your server and how many tasks in the queue of plugins (rooms) fiber

    best,
    ilya