# Sending message to all players in room from Photon server?

I need to send a message to all players in the room from a Photon server. Sending the message from a player would introduce too much latency so I need the server to collect data and distribute messages at a rate of 16/s without a player's influence. Is there a way to do this?

if (PhotonNetwork.isMasterClient)
photonView.RPC ("SendMessageRPC", PhotonTargets.All, "Hello there!");

[PunRPC]
void SendMessage (string message) {
}


The above is basically how to send a message, with you needing to impliment a GUI or UI for a chatBox and a script that has a public void function that is called AddMessage, which adds the string message onto the big string of all the messages.

I'm not sure if there is a way to guarantee the speed of delivery, as all the client's (and if you're using a server, also that) devices and network speed is not the same.

• I need to initiate the message from the server. Calling it from the client would mean 1 extra trip for the message. – JPtheK9 Jan 3 '16 at 0:35
• @JPtheK9 Sorry then, I'm not very sure how you do this :) – ʇolɐǝz ǝɥʇ qoq Jan 3 '16 at 0:39
• actually allot of games use client based applications to send "Master" or "Admin" messages this way. Arma 3 for example has RCON software to allow admins of servers to send global messages to all player from a client side application. I would recommend maybe making a admin tool for your game/application. – Ryan white Aug 16 '16 at 13:34