how to chat all peers

Options
Hi_TT
edited August 2013 in Photon Server
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? :?

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. :)
  • mad_sir1
    Options
    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. :)
    Hi Nicole,thanks for your reply ,I mean I use the loadbalancing project to my game,and I just want to a "world message",every player can send a message ,and everybod can receive the message,that is it ,the system message I have try it and it works , my game like this,if I have many gameservers and a masterserver, clients can playgame in the gameservers ,so if a player send a message I want that all clients can receive it ,how can I do that?maybe it will take amount of data ,do you have a good idea that client can send a message everyone can receive it ? I am sorry my poor English,I think you can take it,thanks :)
  • 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...