some question about photon

liverol ✭✭
edited August 2010 in Photon Server
hi there, i plan to switch from sfs to photon but has some question:
1. i don't find any info about how to use database with photon,do i miss something?
2.sfs does offer solution for cluster servers(which using java Tech.),any chance for photon do the same job?


  • dreamora
    1. Photon uses C# for its server application (or just Application). As such you can just use System.Data and the there present database drivers to talk to DBs. No special modules or black art as with SFS - MySQL for example

    2. Unhappily there isn't something like Terracotta for this side. That being said, Photon on the other hand does also not run on a slow core like SFS (Java) because the core of Photon is a high performance C / C++ socket server, the C# part only drives your application and runs through CLR in / on top of it.
    There is nothing in photon that prevents you from having different photon servers talk to each other, so you can technically develop any kind of architecture
  • liverol
    3. can i use udp and tcp at the same time(or switch for a while) ,to send some message using tcp,and some using udp?
    4.hope there will be some examples to show how to use mmo features(interset managment) with multiply rooms(worlds)!!!
  • dreamora
    3. You would have to reconnect, a photon peer can only run in tcp or udp mode. But you can send reliable UDP, which gives you most what TCP would give you too (if not all, am not 100% sure its sequenced too)

    4. The MMO example is layed out for a single world. How much sense it makes in a MMO room environment really depends on the amount of users in the world etc, cause it must have enough going on to justify the costs of the IA etc and its not like you would want to host multiple worlds on one server (that would mean that 1 machine failing = multiple worlds offline instead of just 1)
  • Tobias
    3. Per connection you can only choose TCP or UDP and can't switch. But Photon's reliable UDP gives you all options needed. The protocol on top of UDP allows you to chose per-operation if it is reliable or unreliable.
    Operations are sent in "commands" and they are sequenced. Channels create separate sequences and inside a channel, unreliable commands are also in-sequence with any reliable commands. For reliable commands, the sequence must be complete, unreliable sequences might have gaps (it's used whatever made it through).