otland/forgottenserver — pull request #994 by djdamc (2014-09-22 01:11:45+00:00)
Title: [WIP] Added a prototype version of a casting system

Closes #984
Since there isn't much activity in the casting system issue, I've decided to start working on it. Right now it's in working order, however it's still missing the Cast chatroom feature. As for the internal details: broadcasting is done by the ASI/O thread when it calls the Connection::onWriteOperation(...) method. The dispatcher thread does only one additional copy (it is required, as the ASI/O thread receives the message object with it's content already encrypted) which is then used for broadcasting. All variables relevant to the casting system have been placed in the ProtocolGame class. Starting a cast is achieved by using the !cast [password] talkaction. Stopping it is done by using !stopcast. Joining a stream as a spectator is achieved by logging in with an empty account name and a password, assuming the caster set one. If something isn't clear, feel free to ask. I'm open to suggestions if you think there's something that could be improved (probably there is).

P.S. don't merge yet ;)