* Fixed serv_upgrade.c and export5.c (found elsewhere) to use a new
authorArt Cancro <ajc@citadel.org>
Fri, 20 Nov 1998 04:29:32 +0000 (04:29 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 20 Nov 1998 04:29:32 +0000 (04:29 +0000)
          export format which treats visits as a separate section

citadel/ChangeLog
citadel/serv_test.c
citadel/serv_upgrade.c

index 784ce4cfae01bc29c4497240df5776565607e31b..b9805c2b8f454bf0fd6c8e53531e7c730b471fd0 100644 (file)
@@ -1,3 +1,7 @@
+Thu Nov 19 23:28:33 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * Fixed serv_upgrade.c and export5.c (found elsewhere) to use a new
+         export format which treats visits as a separate section
+
 Wed Nov 18 23:51:17 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Reimplemented 'visit' structs stored globally instead of as
          lists-per-user
index 1808e4595a4000fdc034516d75aa3d4d7517a1ae..8d6888f952113977399ba9a561a886befca5568e 100644 (file)
@@ -67,7 +67,7 @@ void LoginTest(void) {
 
 
 void Ygorl(char *username, long usernum) {
-       if (!strcasecmp(username, "Hexslinger")) {
+       if (!strcasecmp(username, "Unsuspecting User")) {
                strcpy(username, "Flaming Asshole");
                }
        }
index c0df947919589e6215dee54303d1cafca67819f3..0be9dcd54c781ed7b0b34d095736318ef890d8e8 100644 (file)
@@ -618,7 +618,34 @@ void export_usersupp(void) {
 
        fprintf(exfp, "endsection%c", 0);
        }
-       
+
+
+void export_visits(void) {
+       struct cdbdata *cdbvisit;
+       struct visit vbuf;
+
+       lprintf(9, "Visits\n");
+       fprintf(exfp, "visits%c", 0);
+
+       cdb_rewind(CDB_VISIT);
+       while(cdbvisit = cdb_next_item(CDB_VISIT), cdbvisit != NULL) {
+               memset(&vbuf, 0, sizeof(struct visit));
+               memcpy(&vbuf, cdbvisit->ptr,
+                       ( (cdbvisit->len > sizeof(struct visit)) ?
+                       sizeof(struct visit) : cdbvisit->len) );
+               cdb_free(cdbvisit);
+
+               fprintf(exfp, "visit%c", 0);
+               fprintf(exfp, "vrnum%c%ld%c", 0, vbuf.v_roomnum, 0);
+               fprintf(exfp, "vgen%c%ld%c", 0, vbuf.v_roomgen, 0);
+               fprintf(exfp, "vunum%c%ld%c", 0, vbuf.v_usernum, 0);
+               fprintf(exfp, "flags%c%d%c", 0, vbuf.v_flags, 0);
+               fprintf(exfp, "lastseen%c%ld%c", 0, vbuf.v_lastseen, 0);
+               fprintf(exfp, "endvisit%c", 0);
+               }
+
+       fprintf(exfp, "endsection%c", 0);
+       }       
 
 void do_export(char *argbuf) {
        char export_filename[PATH_MAX];
@@ -680,6 +707,7 @@ void do_export(char *argbuf) {
        export_rooms();
        export_floors();
        export_usersupp();
+       export_visits();
 
        fprintf(exfp, "endfile%c", 0);
        fclose(exfp);