+Mon Aug 24 00:45:55 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+ * Added a CtdlGotoRoom() function to the CitadelAPI.
+
Sun Aug 23 21:47:00 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* sysoputil is finally dead! Removed it from the build.
* Added userpurge.c server extension (initial implementation)
struct CtdlServerHandle CtdlAppHandle;
struct CtdlServInfo CtdlAppServInfo;
+struct CtdlRoomInfo CtdlCurrentRoom;
int CtdlErrno = 0;
void logoff(int exitcode) {
}
/*
- * CtdlInternalExtractInt() - CtdlInternalExtract an int parm w/o supplying a buffer
+ * CtdlInternalExtractInt() - Extract an int parm w/o supplying a buffer
*/
int CtdlInternalExtractInt(char *source, int parmnum)
{
}
/*
- * CtdlInternalExtractLong() - CtdlInternalExtract an long parm w/o supplying a buffer
+ * CtdlInternalExtractLong() - Extract an long parm w/o supplying a buffer
*/
long CtdlInternalExtractLong(char *source, long int parmnum)
{
if (argc < 3) exit(1);
/* Zeroing out the server handle neatly sets the values of
- * CtdlAppHandle to sane default values
+ * CtdlAppHandle to sane default values. This also holds true
+ * for the CtdlCurrentRoom.
*/
bzero(&CtdlAppHandle, sizeof(struct CtdlServerHandle));
+ bzero(&CtdlCurrentRoom, sizeof(struct CtdlRoomInfo));
/* Now parse the command-line arguments fed to us by the server */
for (a=0; a<argc; ++a) switch(a) {
serv_gets(buf);
}
- sprintf(buf, "GOTO %s", CtdlAppHandle.InitialRoom);
- serv_puts(buf);
- serv_gets(buf);
- if (buf[0] != '2') {
- serv_puts("GOTO _BASEROOM_");
- serv_gets(buf);
+ if (CtdlGotoRoom(CtdlAppHandle.InitialRoom) != 0) {
+ CtdlGotoRoom("_BASEROOM_");
}
/* Now do the loop. */
return(0);
}
+
+
+
+/*
+ * Goto a different room
+ */
+int CtdlGotoRoom(char *RoomName) {
+ char buf[256];
+
+ sprintf(buf, "GOTO %s", RoomName);
+ serv_puts(buf);
+ serv_gets(buf);
+ if (buf[0] != '2') {
+ CtdlErrno = atoi(buf);
+ return(CtdlErrno);
+ }
+ extract(&CtdlCurrentRoom.RoomName, &buf[4], 0);
+ }
on the system; the single argument passed to the function will be the name of
the user being processed.
+
+
+
+ ROOM FUNCTIONS
+ --------------
+
+ extern struct CtdlRoomInfo CtdlCurrentRoom;
+
+ This structure contains information about the current room.
+
+
+
+ int CtdlGotoRoom(char *RoomName)
+
+ Goto any room to which the extension has access. An extension with
+administrative or privileged access may enter any room on the system. An
+extension running in the context of an ordinary user may enter any room to
+which the user has access.