m_foobar.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "inspircd.h"
00015
00016
00017
00018
00019
00020
00021 class ModuleFoobar : public Module
00022 {
00023 private:
00024
00025
00026
00027
00028
00029
00030
00031 public:
00032 ModuleFoobar(InspIRCd* Me)
00033 : Module(Me)
00034 {
00035
00036
00037
00038 Implementation eventlist[] = { I_OnUserConnect, I_OnUserQuit, I_OnUserJoin, I_OnUserPart, I_OnUserPreJoin };
00039 ServerInstance->Modules->Attach(eventlist, this, 5);
00040 }
00041
00042 virtual ~ModuleFoobar()
00043 {
00044 }
00045
00046 virtual Version GetVersion()
00047 {
00048
00049
00050
00051 return Version("$Id: m_foobar.cpp 10291 2008-08-25 20:35:51Z w00t $", VF_VENDOR, API_VERSION);
00052 }
00053
00054
00055 virtual void OnUserConnect(User* user)
00056 {
00057
00058
00059 std::string b = user->nick;
00060 ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User connecting: "+b);
00061 }
00062
00063 virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
00064 {
00065
00066
00067 std::string b = user->nick;
00068 ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User quitting: "+b);
00069 }
00070
00071 virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
00072 {
00073
00074
00075 std::string c = channel->name;
00076 std::string b = user->nick;
00077 ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User "+b+" joined "+c);
00078 }
00079
00080 virtual void OnUserPart(User* user, Channel* channel, std::string &partreason, bool &silent)
00081 {
00082
00083
00084 std::string c = channel->name;
00085 std::string b = user->nick;
00086 ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User "+b+" parted "+c);
00087 }
00088
00089 virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
00090 {
00091 return 0;
00092 }
00093 };
00094
00095
00096 MODULE_INIT(ModuleFoobar)
00097