I like how you're currently moving the implementation directly into the server, so that we can avoid the awkward inter-plugin calls. I have a few notes, though:
- cWorld::BroadcastChat() should get an extra parameter, the message type, in front of the Exclude parameter
- cPlayer should get the same compliment of messaging functions (SendMessageInfo(), SendMessageWarning() ...)
- cPlayer:SendMessage() should get an extra parameter, the message type
- cWorld:BroadcastChatInfo() etc should redirect to cWorld:BroadcastChat using the appropriate MessageType parameter
- cWorld:BroadcastChat() should call cPlayer:SendMessage() with the appropriate message type
- cPlayer:SendMessage() should do the final message formatting
If the message formatting was configurable through a few world.ini settings (AddPrefixes, ColorizePrefixes, ColorizeMessages), that'd be great.
Moving the formatting to cPlayer::SendMessage() will allow us to later possibly add per-user formatting options, although currently it would only incur minor performance loss for the broadcast messages.
EDIT:
Note: by providing a manual binding for cWorld:BroadcastChat(), you will be able to support both the new and the old model - just detect the param count and types and decide what to do based on that. Similar for cPlayer:SendMessage().
- cWorld::BroadcastChat() should get an extra parameter, the message type, in front of the Exclude parameter
- cPlayer should get the same compliment of messaging functions (SendMessageInfo(), SendMessageWarning() ...)
- cPlayer:SendMessage() should get an extra parameter, the message type
- cWorld:BroadcastChatInfo() etc should redirect to cWorld:BroadcastChat using the appropriate MessageType parameter
- cWorld:BroadcastChat() should call cPlayer:SendMessage() with the appropriate message type
- cPlayer:SendMessage() should do the final message formatting
If the message formatting was configurable through a few world.ini settings (AddPrefixes, ColorizePrefixes, ColorizeMessages), that'd be great.
Moving the formatting to cPlayer::SendMessage() will allow us to later possibly add per-user formatting options, although currently it would only incur minor performance loss for the broadcast messages.
EDIT:
Note: by providing a manual binding for cWorld:BroadcastChat(), you will be able to support both the new and the old model - just detect the param count and types and decide what to do based on that. Similar for cPlayer:SendMessage().