Tue 16 Jan 2007
Relay messaging
Posted by Jeremy Squier under communication, code
No Comments
We are not going to be able to take relay message outside of game server very easily for several reasons:
- Game server level information associating character/player ids with sockets to preform a relay
- Relaying is an input only event. We receive input messages and send them to a different source.
- Routing and multi-casting needs to be done and this is also game server level information
I propose we keep it where it is but expand it to work on all messages that have a destination rather this be a character or a channel. We can simply look for the presence of a dst field in the input message (if just client to server there should be no dst the client just write the message down the socket) or if there is a chan field defined. These two conditions tell us the client wishes to relay this message to some other client on the server. I can think of a couple ways to implement this:
- Have the server check if dst and chan exist in the message if so run RelayMessage on it. Then if you want to filter by command have it check if that command has relay perms.
- Keep the structure much like it is and add explict calls in each cmd_X() to RelayMessage this way would be quicker but take up a bit more code bulk. This is of course its disadvantage it is not as flexible and needs to be rigidly defined.
