how to chat all peers
Options
OK,many problems can happen in the development,I mean ,yes ,a problem I confused me ,I want to know if I use the loadbalancing project ,how can I send the message to the all peers ,the loadbalancing works like this: client connect to the masterserver ,and it pick the low load gameserver ip send to the client ,and client connect to the gameserver(creatgame,joingame,etc) so how can I get all clients ,if I use two computers ,masterserver+gameserver,gameserver,there are two photon instance, how can all the peers can communicate with each other, anybody help me? :?
0
Comments
-
Photon does not have a built-in solution for client communication between different servers.
There are certainly ways to work around that (have a separate "chat server" to which each client connects, for example), BUT:
You should think again about your requirements. What exactly do you want to do?
1.) Send something like a "system message" to all peers? You can keep a list of all connected peers on the GS (there are a few threads on this forum how to do that), then send a notification from the master to each GS, and the GS forwards the message to all it's peers.
2.) Have one chat room with all connected players?
That's not a good idea at all. Say, each GS can handle 500 players - can you imagine a 1000-player-chat?
From a player's point of view: I can't imagine that anybody enjoys to be a in a chat room of that size.
From a technical point of view: If 999 players try to respond to one particular message all at once, your clients will blow up because they can not handle the amount of data burst - let aside the amount of traffic on the server when you create 1.000.000 outbound messages (= 1000 incoming messages, each sent to 1000 other peers) all at once.
There are good reasons why chat rooms have a user limit in many cases.0 -
Nicole wrote:Photon does not have a built-in solution for client communication between different servers.
There are certainly ways to work around that (have a separate "chat server" to which each client connects, for example), BUT:
You should think again about your requirements. What exactly do you want to do?
1.) Send something like a "system message" to all peers? You can keep a list of all connected peers on the GS (there are a few threads on this forum how to do that), then send a notification from the master to each GS, and the GS forwards the message to all it's peers.
2.) Have one chat room with all connected players?
That's not a good idea at all. Say, each GS can handle 500 players - can you imagine a 1000-player-chat?
From a player's point of view: I can't imagine that anybody enjoys to be a in a chat room of that size.
From a technical point of view: If 999 players try to respond to one particular message all at once, your clients will blow up because they can not handle the amount of data burst - let aside the amount of traffic on the server when you create 1.000.000 outbound messages (= 1000 incoming messages, each sent to 1000 other peers) all at once.
There are good reasons why chat rooms have a user limit in many cases.0 -
If you have already implemented a "system message", you can also add a operation that can be called by a player and raises that system message...0