Class that implements server event behaviour. More...
#include <serverevents.h>
Inherits IServerEvents, and wxEvtHandler.

Public Types | |
| enum | ServerEventsMode { normal = 0, simple = 1 } |
Public Member Functions | |
| ServerEvents (Server &serv) | |
| ~ServerEvents () | |
| void | OnConnected (const wxString &server_name, const wxString &server_ver, bool supported, const wxString &server_spring_ver, bool lanmode) |
| void | OnDisconnected (bool wasonline) |
| void | OnLogin () |
| void | OnLoginInfoComplete () |
| void | OnLogout () |
| void | OnUnknownCommand (const wxString &command, const wxString ¶ms) |
| void | OnSocketError (const Sockerror &error) |
| void | OnProtocolError (const Protocolerror error) |
| void | OnMotd (const wxString &msg) |
| void | OnPong (wxLongLong ping_time) |
| void | OnNewUser (const wxString &nick, const wxString &conutry, int cpu, const wxString &id) |
| void | OnUserStatus (const wxString &nick, UserStatus status) |
| void | OnUserQuit (const wxString &nick) |
| void | OnBattleOpened (int id, BattleType type, NatType nat, const wxString &nick, const wxString &host, int port, int maxplayers, bool haspass, int rank, const wxString &maphash, const wxString &map, const wxString &title, const wxString &mod) |
| void | OnUserJoinedBattle (int battleid, const wxString &nick, const wxString &userScriptPassword) |
| void | OnUserLeftBattle (int battleid, const wxString &nick) |
| void | OnBattleInfoUpdated (int battleid, int spectators, bool locked, const wxString &maphash, const wxString &map) |
| void | OnSetBattleInfo (int battleid, const wxString ¶m, const wxString &value) |
| void | OnBattleInfoUpdated (int battleid) |
| void | OnBattleClosed (int battleid) |
| void | OnJoinedBattle (int battleid, const wxString &hash) |
| void | OnHostedBattle (int battleid) |
| void | OnStartHostedBattle (int battleid) |
| void | OnClientBattleStatus (int battleid, const wxString &nick, UserBattleStatus status) |
| void | OnBattleStartRectAdd (int battleid, int allyno, int left, int top, int right, int bottom) |
| void | OnBattleStartRectRemove (int battleid, int allyno) |
| void | OnBattleAddBot (int battleid, const wxString &nick, UserBattleStatus status) |
| void | OnBattleUpdateBot (int battleid, const wxString &nick, UserBattleStatus status) |
| void | OnBattleRemoveBot (int battleid, const wxString &nick) |
| void | OnBattleDisableUnit (int battleid, const wxString &unitname, int count=0) |
| void | OnBattleEnableUnit (int battleid, const wxString &unitname) |
| void | OnBattleEnableAllUnits (int battleid) |
| void | OnJoinChannelResult (bool success, const wxString &channel, const wxString &reason) |
| void | OnChannelSaid (const wxString &channel, const wxString &who, const wxString &message) |
| void | OnChannelJoin (const wxString &channel, const wxString &who) |
| void | OnChannelPart (const wxString &channel, const wxString &who, const wxString &message) |
| void | OnChannelTopic (const wxString &channel, const wxString &who, const wxString &message, int when) |
| void | OnChannelAction (const wxString &channel, const wxString &who, const wxString &action) |
| void | OnChannelList (const wxString &channel, const int &numusers, const wxString &topic) |
| void | OnUserJoinChannel (const wxString &channel, const wxString &who) |
| void | OnPrivateMessage (const wxString &user, const wxString &message, bool fromme=false) |
| void | OnPrivateMessageEx (const wxString &user, const wxString &action, bool fromme=false) |
| void | OnRequestBattleStatus (int battleid) |
| void | OnSaidBattle (int battleid, const wxString &nick, const wxString &msg) |
| void | OnBattleAction (int battleid, const wxString &nick, const wxString &msg) |
| void | OnAcceptAgreement (const wxString &agreement) |
| void | OnRing (const wxString &from) |
| void | OnServerMessage (const wxString &message) |
| void | OnServerBroadcast (const wxString &message) |
| void | OnServerMessageBox (const wxString &message) |
| void | OnChannelMessage (const wxString &channel, const wxString &msg) |
| void | OnHostExternalUdpPort (const unsigned int udpport) |
| void | OnMyExternalUdpSourcePort (const unsigned int udpport) |
| void | OnMyInternalUdpSourcePort (const unsigned int udpport) |
| void | OnClientIPPort (const wxString &username, const wxString &ip, unsigned int udpport) |
| void | OnKickedFromBattle () |
| void | OnRedirect (const wxString &address, unsigned int port, const wxString &CurrentNick, const wxString &CurrentPassword) |
| void | AutoCheckCommandSpam (Battle &battle, User &nick) |
| use this function to check spam from clients and autokick from the battle | |
| void | OnMutelistBegin (const wxString &channel) |
| void | OnMutelistItem (const wxString &channel, const wxString &mutee, const wxString &description) |
| void | OnMutelistEnd (const wxString &channel) |
| void | OnScriptStart (int battleid) |
| void | OnScriptLine (int battleid, const wxString &line) |
| void | OnScriptEnd (int battleid) |
| void | OnFileDownload (bool autolaunch, bool autoclose, bool disconnectonrefuse, const wxString &FileName, const wxString &url, const wxString &description) |
| void | OnSpringDownloadEvent (wxCommandEvent &event) |
Static Public Member Functions | |
| static IServerEvents * | getInstance (Server &server, ServerEventsMode mode=normal) |
Protected Attributes | |
| Server & | m_serv |
| std::map< wxString, MessageSpamCheck > | m_spam_check |
| bool | m_autolaunch |
| spring autoupdate stuff | |
| bool | m_autoclose |
| wxString | m_savepath |
Class that implements server event behaviour.
Definition at line 14 of file serverevents.h.
enum IServerEvents::ServerEventsMode [inherited] |
Definition at line 27 of file iserverevents.h.
| ServerEvents::ServerEvents | ( | Server & | serv | ) | [inline] |
Definition at line 17 of file serverevents.h.
| ServerEvents::~ServerEvents | ( | ) | [inline] |
Definition at line 18 of file serverevents.h.
use this function to check spam from clients and autokick from the battle
Implements IServerEvents.
Definition at line 913 of file serverevents.cpp.
| IServerEvents * IServerEvents::getInstance | ( | Server & | server, | |
| ServerEventsMode | mode = normal | |||
| ) | [static, inherited] |
Definition at line 5 of file iserverevents.cpp.
| void ServerEvents::OnAcceptAgreement | ( | const wxString & | agreement | ) | [virtual] |
Implements IServerEvents.
Definition at line 805 of file serverevents.cpp.
| void ServerEvents::OnBattleAction | ( | int | battleid, | |
| const wxString & | nick, | |||
| const wxString & | msg | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 730 of file serverevents.cpp.
| void ServerEvents::OnBattleAddBot | ( | int | battleid, | |
| const wxString & | nick, | |||
| UserBattleStatus | status | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 768 of file serverevents.cpp.
| void ServerEvents::OnBattleClosed | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 520 of file serverevents.cpp.
| void ServerEvents::OnBattleDisableUnit | ( | int | battleid, | |
| const wxString & | unitname, | |||
| int | count = 0 | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 535 of file serverevents.cpp.
| void ServerEvents::OnBattleEnableAllUnits | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 561 of file serverevents.cpp.
| void ServerEvents::OnBattleEnableUnit | ( | int | battleid, | |
| const wxString & | unitname | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 548 of file serverevents.cpp.
| void ServerEvents::OnBattleInfoUpdated | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 508 of file serverevents.cpp.
| void ServerEvents::OnBattleInfoUpdated | ( | int | battleid, | |
| int | spectators, | |||
| bool | locked, | |||
| const wxString & | maphash, | |||
| const wxString & | map | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 412 of file serverevents.cpp.
| void ServerEvents::OnBattleOpened | ( | int | id, | |
| BattleType | type, | |||
| NatType | nat, | |||
| const wxString & | nick, | |||
| const wxString & | host, | |||
| int | port, | |||
| int | maxplayers, | |||
| bool | haspass, | |||
| int | rank, | |||
| const wxString & | maphash, | |||
| const wxString & | map, | |||
| const wxString & | title, | |||
| const wxString & | mod | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 234 of file serverevents.cpp.
| void ServerEvents::OnBattleRemoveBot | ( | int | battleid, | |
| const wxString & | nick | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 788 of file serverevents.cpp.
| void ServerEvents::OnBattleStartRectAdd | ( | int | battleid, | |
| int | allyno, | |||
| int | left, | |||
| int | top, | |||
| int | right, | |||
| int | bottom | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 742 of file serverevents.cpp.
| void ServerEvents::OnBattleStartRectRemove | ( | int | battleid, | |
| int | allyno | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 755 of file serverevents.cpp.
| void ServerEvents::OnBattleUpdateBot | ( | int | battleid, | |
| const wxString & | nick, | |||
| UserBattleStatus | status | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 782 of file serverevents.cpp.
| void ServerEvents::OnChannelAction | ( | const wxString & | channel, | |
| const wxString & | who, | |||
| const wxString & | action | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 644 of file serverevents.cpp.
Implements IServerEvents.
Definition at line 605 of file serverevents.cpp.
| void ServerEvents::OnChannelList | ( | const wxString & | channel, | |
| const int & | numusers, | |||
| const wxString & | topic | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 686 of file serverevents.cpp.
Implements IServerEvents.
Definition at line 833 of file serverevents.cpp.
| void ServerEvents::OnChannelPart | ( | const wxString & | channel, | |
| const wxString & | who, | |||
| const wxString & | message | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 618 of file serverevents.cpp.
| void ServerEvents::OnChannelSaid | ( | const wxString & | channel, | |
| const wxString & | who, | |||
| const wxString & | message | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 591 of file serverevents.cpp.
| void ServerEvents::OnChannelTopic | ( | const wxString & | channel, | |
| const wxString & | who, | |||
| const wxString & | message, | |||
| int | when | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 631 of file serverevents.cpp.
| void ServerEvents::OnClientBattleStatus | ( | int | battleid, | |
| const wxString & | nick, | |||
| UserBattleStatus | status | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 345 of file serverevents.cpp.
| void ServerEvents::OnClientIPPort | ( | const wxString & | username, | |
| const wxString & | ip, | |||
| unsigned int | udpport | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 859 of file serverevents.cpp.
| void ServerEvents::OnConnected | ( | const wxString & | server_name, | |
| const wxString & | server_ver, | |||
| bool | supported, | |||
| const wxString & | server_spring_ver, | |||
| bool | lanmode | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 41 of file serverevents.cpp.
| void ServerEvents::OnDisconnected | ( | bool | wasonline | ) | [virtual] |
Implements IServerEvents.
Definition at line 50 of file serverevents.cpp.
| void ServerEvents::OnFileDownload | ( | bool | autolaunch, | |
| bool | autoclose, | |||
| bool | disconnectonrefuse, | |||
| const wxString & | FileName, | |||
| const wxString & | url, | |||
| const wxString & | description | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 980 of file serverevents.cpp.
| void ServerEvents::OnHostedBattle | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 302 of file serverevents.cpp.
| void ServerEvents::OnHostExternalUdpPort | ( | const unsigned int | udpport | ) | [virtual] |
Implements IServerEvents.
Definition at line 839 of file serverevents.cpp.
| void ServerEvents::OnJoinChannelResult | ( | bool | success, | |
| const wxString & | channel, | |||
| const wxString & | reason | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 574 of file serverevents.cpp.
| void ServerEvents::OnJoinedBattle | ( | int | battleid, | |
| const wxString & | hash | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 276 of file serverevents.cpp.
| void ServerEvents::OnKickedFromBattle | ( | ) | [virtual] |
Implements IServerEvents.
Definition at line 899 of file serverevents.cpp.
| void ServerEvents::OnLogin | ( | ) | [virtual] |
Implements IServerEvents.
Definition at line 58 of file serverevents.cpp.
| void ServerEvents::OnLoginInfoComplete | ( | ) | [virtual] |
Implements IServerEvents.
Definition at line 63 of file serverevents.cpp.
| void ServerEvents::OnLogout | ( | ) | [virtual] |
Implements IServerEvents.
Definition at line 91 of file serverevents.cpp.
| void ServerEvents::OnMotd | ( | const wxString & | msg | ) | [virtual] |
Implements IServerEvents.
Definition at line 116 of file serverevents.cpp.
| void ServerEvents::OnMutelistBegin | ( | const wxString & | channel | ) | [virtual] |
Implements IServerEvents.
Definition at line 929 of file serverevents.cpp.
| void ServerEvents::OnMutelistEnd | ( | const wxString & | channel | ) | [virtual] |
Implements IServerEvents.
Definition at line 947 of file serverevents.cpp.
| void ServerEvents::OnMutelistItem | ( | const wxString & | channel, | |
| const wxString & | mutee, | |||
| const wxString & | description | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 934 of file serverevents.cpp.
| void ServerEvents::OnMyExternalUdpSourcePort | ( | const unsigned int | udpport | ) | [virtual] |
Implements IServerEvents.
Definition at line 853 of file serverevents.cpp.
| void ServerEvents::OnMyInternalUdpSourcePort | ( | const unsigned int | udpport | ) | [virtual] |
Implements IServerEvents.
Definition at line 846 of file serverevents.cpp.
| void ServerEvents::OnNewUser | ( | const wxString & | nick, | |
| const wxString & | conutry, | |||
| int | cpu, | |||
| const wxString & | id | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 131 of file serverevents.cpp.
| void ServerEvents::OnPong | ( | wxLongLong | ping_time | ) | [virtual] |
Implements IServerEvents.
Definition at line 123 of file serverevents.cpp.
| void ServerEvents::OnPrivateMessage | ( | const wxString & | user, | |
| const wxString & | message, | |||
| bool | fromme = false | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 658 of file serverevents.cpp.
| void ServerEvents::OnPrivateMessageEx | ( | const wxString & | user, | |
| const wxString & | action, | |||
| bool | fromme = false | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 672 of file serverevents.cpp.
| void ServerEvents::OnProtocolError | ( | const Protocolerror | error | ) | [virtual] |
Implements IServerEvents.
Definition at line 110 of file serverevents.cpp.
| void ServerEvents::OnRedirect | ( | const wxString & | address, | |
| unsigned int | port, | |||
| const wxString & | CurrentNick, | |||
| const wxString & | CurrentPassword | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 905 of file serverevents.cpp.
| void ServerEvents::OnRequestBattleStatus | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 705 of file serverevents.cpp.
| void ServerEvents::OnRing | ( | const wxString & | from | ) | [virtual] |
Implements IServerEvents.
Definition at line 811 of file serverevents.cpp.
| void ServerEvents::OnSaidBattle | ( | int | battleid, | |
| const wxString & | nick, | |||
| const wxString & | msg | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 716 of file serverevents.cpp.
| void ServerEvents::OnScriptEnd | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 970 of file serverevents.cpp.
| void ServerEvents::OnScriptLine | ( | int | battleid, | |
| const wxString & | line | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 961 of file serverevents.cpp.
| void ServerEvents::OnScriptStart | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 952 of file serverevents.cpp.
| void ServerEvents::OnServerBroadcast | ( | const wxString & | message | ) | [virtual] |
Implements IServerEvents.
Definition at line 816 of file serverevents.cpp.
| void ServerEvents::OnServerMessage | ( | const wxString & | message | ) | [virtual] |
Implements IServerEvents.
Definition at line 821 of file serverevents.cpp.
| void ServerEvents::OnServerMessageBox | ( | const wxString & | message | ) | [virtual] |
Implements IServerEvents.
Definition at line 827 of file serverevents.cpp.
| void ServerEvents::OnSetBattleInfo | ( | int | battleid, | |
| const wxString & | param, | |||
| const wxString & | value | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 438 of file serverevents.cpp.
| void ServerEvents::OnSocketError | ( | const Sockerror & | error | ) | [virtual] |
Implements IServerEvents.
Definition at line 104 of file serverevents.cpp.
| void ServerEvents::OnSpringDownloadEvent | ( | wxCommandEvent & | event | ) | [virtual] |
Implements IServerEvents.
Definition at line 1001 of file serverevents.cpp.
| void ServerEvents::OnStartHostedBattle | ( | int | battleid | ) | [virtual] |
Implements IServerEvents.
Definition at line 336 of file serverevents.cpp.
Implements IServerEvents.
Definition at line 97 of file serverevents.cpp.
Implements IServerEvents.
Definition at line 692 of file serverevents.cpp.
| void ServerEvents::OnUserJoinedBattle | ( | int | battleid, | |
| const wxString & | nick, | |||
| const wxString & | userScriptPassword | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 363 of file serverevents.cpp.
| void ServerEvents::OnUserLeftBattle | ( | int | battleid, | |
| const wxString & | nick | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 392 of file serverevents.cpp.
| void ServerEvents::OnUserQuit | ( | const wxString & | nick | ) | [virtual] |
Implements IServerEvents.
Definition at line 199 of file serverevents.cpp.
| void ServerEvents::OnUserStatus | ( | const wxString & | nick, | |
| UserStatus | status | |||
| ) | [virtual] |
Implements IServerEvents.
Definition at line 152 of file serverevents.cpp.
bool ServerEvents::m_autoclose [protected] |
Definition at line 127 of file serverevents.h.
bool ServerEvents::m_autolaunch [protected] |
spring autoupdate stuff
Definition at line 126 of file serverevents.h.
wxString ServerEvents::m_savepath [protected] |
Definition at line 128 of file serverevents.h.
Server& ServerEvents::m_serv [protected] |
Definition at line 120 of file serverevents.h.
std::map<wxString,MessageSpamCheck> ServerEvents::m_spam_check [protected] |
Definition at line 121 of file serverevents.h.
1.6.3