3D Game Programming All in One- P11: During the past several years while working on the Tubettiland “Online Campaign” software and more recently while working on the Tubettiworld game, I figure I’ve received more than a hundred queries from people of all ages about how to get started making games. There were queries from 40-year-olds and 13-year-olds and every age in between. Most e-mails were from guys I would estimate to be in their late teens or early 20s. | Direct Messaging 207 Now here is where some of the Torque client server magic elbows its way onto the stage. The client will already have a GameConnection to the server and so will already know where to send the message. In order to act on our message the server side needs us to define the TellEveryone message handler which is really just a special purpose function something like this function ServerCmdTellEveryone client msg TellAll client msg Notice the prefix ServerCmd. When the server receives a message from the client via the CommandToServer function it will look in its message handle list which is a list of functions that have the ServerCmd prefix and find the one that matches ServerCmdTellEveryone. It then calls that function setting the first parameter to the GameConnection handle of the client that sent the message. It then sets the rest of the parameters to be the parameters passed in the message from the client which in this case is msg stuffed with the string Hello World . Then we can do what we want with the incoming message. In this case we want to send the message to all of the other clients that are connected to the server and we ll do that by calling the TellAll function. Now we could put the code right here in our ServerCmdTellEveryone message handler but it is a better design approach to break the code out into its own independent function. We ll cover how to do this in the next section. CommandToClient Okay here we are we re the server and we ve received a message from a client. We ve figured out that the message is the TellEveryone message we know which client sent it and we have a string that came along with the message. What we need to do now is define the TellAll function so here is what it could look like function TellAll sender msg count for i 0 i count i client i commandToClient client TellMessage sender msg Our intention here is to forward the message to all of the clients. Whenever a client .