LoadXRoomPic() and the XHaveRoomPicLoaded conditional moved from OIMG to DLRI server...
authorArt Cancro <ajc@citadel.org>
Wed, 20 Apr 2016 14:17:22 +0000 (10:17 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 20 Apr 2016 14:17:22 +0000 (10:17 -0400)
webcit/roomops.c

index 2ea692862e01c572c76ffe6b0be416b7db1d8f83..3aa28ea91e4fbd73be78761a7e4c293f48e08633 100644 (file)
@@ -590,22 +590,24 @@ void LoadXRoomPic(void)
 {
        wcsession *WCC = WC;
        StrBuf *Buf;
+       off_t bytes;
        
-       if (WCC->CurRoom.XHaveRoomPicLoaded)
+       if (WCC->CurRoom.XHaveRoomPicLoaded) {
                return;
+       }
 
        WCC->CurRoom.XHaveRoomPicLoaded = 1;
        Buf = NewStrBuf();
-       serv_puts("OIMG _roompic_");
+       serv_puts("DLRI");
        StrBuf_ServGetln(Buf);
-       if (GetServerStatus(Buf, NULL) != 2) {
-               WCC->CurRoom.XHaveRoomPic = 0;
-       } else {
+       if (GetServerStatus(Buf, NULL) == 6) {
+               StrBufCutLeft(Buf, 4);
+               bytes = StrBufExtract_long(Buf, 0, '|');
                WCC->CurRoom.XHaveRoomPic = 1;
+               StrBuf_ServGetBLOBBuffered(Buf, bytes);         // discard the data
+       } else {
+               WCC->CurRoom.XHaveRoomPic = 0;
        }
-       serv_puts("CLOS");
-       StrBuf_ServGetln(Buf);
-       GetServerStatus(Buf, NULL);
        FreeStrBuf (&Buf);
 }