]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_test.c
Changeover to new room structure. See ChangeLog for details.
[citadel.git] / citadel / serv_test.c
index 44b65677b224d3354f2cb5c6febde6cb3e3b5aaf..dc7915a599b0de295543fd38c0efd02d60e97863 100644 (file)
@@ -9,6 +9,7 @@
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <string.h>
+#include <limits.h>
 #include <pthread.h>
 #include "citadel.h"
 #include "server.h"
@@ -25,7 +26,7 @@ extern struct CitContext *ContextList;
 #define MODULE_AUTHOR  "Art Cancro"
 #define MODULE_EMAIL   "ajc@uncnsrd.mt-kisco.ny.us"
 #define MAJOR_VERSION  0
-#define MINOR_VERSION  1
+#define MINOR_VERSION  2
 
 static struct DLModule_Info info = {
   MODULE_NAME,
@@ -39,28 +40,40 @@ void CleanupTest(void) {
        lprintf(9, "--- test of adding an unload hook --- \n");
        }
 
-void NewRoomTest(char *RoomName) {
-       lprintf(9, "--- test module was told we're now in %s ---\n", RoomName);
+void NewRoomTest(void) {
+       lprintf(9, "--- test module was told we're now in %s ---\n",
+               CC->cs_room);
        }
 
-void SessionStartTest(int WhichSession) {
-       lprintf(9, "--- starting up session %d ---\n", WhichSession);
+void SessionStartTest(void) {
+       lprintf(9, "--- starting up session %d ---\n",
+               CC->cs_pid);
        }
 
-void SessionStopTest(int WhichSession) {
-       lprintf(9, "--- ending session %d ---\n", WhichSession);
+void SessionStopTest(void) {
+       lprintf(9, "--- ending session %d ---\n", 
+               CC->cs_pid);
        }
 
 void LoginTest(void) {
        lprintf(9, "--- Hello, %s ---\n", CC->curr_user);
        }
 
+
+void Ygorl(char *username, long usernum) {
+       if (!strcasecmp(username, "Hexslinger")) {
+               strcpy(username, "Flaming Asshole");
+               }
+       }
+
+
 struct DLModule_Info *Dynamic_Module_Init(void)
 {
    CtdlRegisterCleanupHook(CleanupTest);
-   CtdlRegisterNewRoomHook(NewRoomTest);
-   CtdlRegisterSessionHook(SessionStartTest, 1);
-   CtdlRegisterSessionHook(SessionStopTest, 0);
-   CtdlRegisterLoginHook(LoginTest);
+   CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
+   CtdlRegisterSessionHook(SessionStartTest, EVT_START);
+   CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
+   CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
+   CtdlRegisterUserHook(Ygorl, EVT_OUTPUTMSG);
    return &info;
 }