--- deliantra/server/socket/request.C 2007/03/14 04:12:29 1.75 +++ deliantra/server/socket/request.C 2007/03/15 16:25:45 1.79 @@ -134,6 +134,8 @@ { memset (&pl->ns->lastmap, 0, sizeof (pl->ns->lastmap)); + pl->ns->force_newmap = false; + if (pl->ns->newmapcmd == 1) pl->ns->send_packet ("newmap"); @@ -148,10 +150,15 @@ object *ob = pl->ob; char buf[MAX_BUF]; /* eauugggh */ - if (socket.current_map != ob->map) + if (socket.force_newmap && 0) { + // force newmap is used for clients that do not redraw their map + // after image uploads. socket.current_map = ob->map; - + clear_map (pl); + } + else if (socket.current_map != ob->map) + { clear_map (pl); if (socket.mapinfocmd) @@ -461,6 +468,7 @@ if (is_valid_faceset (q)) ns->faceset = q; + sprintf (tmpbuf, "%d", ns->faceset); safe_strcat (cmdback, tmpbuf, &slen, HUGE_BUF); /* if the client is using faceset, it knows about image2 command */ @@ -563,8 +571,43 @@ * it either has to be here or init_sockets needs to be exported. */ void -AddMeCmd (char *buf, int len, client * ns) +AddMeCmd (char *buf, int len, client *ns) { + // face caching is mandatory + if (!ns->facecache) + { + ns->send_drawinfo ( + "\n" + "\n" + "***\n" + "*** WARNING:\n" + "*** Your client does not support face/image caching,\n" + "*** or it has been disabled. Face caching is mandatory\n" + "*** so please enable it or use a newer client.\n" + "***\n" + "*** Look at your client preferences:\n" + "***\n" + "*** CFPlus: all known versions automatically enable the facecache.\n" + "*** cfclient: use the -cache commandline option.\n" + "*** cfclient: map will not redraw automatically (bug).\n" + "*** gcfclient: use -cache commandline option, or enable\n" + "*** gcfclient: Client=>Configure=>Map & Image=>Cache Images.\n" + "*** jcrossclient: your client is broken, use CFPlus or gcfclient.\n" + "***\n" + "***\n", + NDI_RED + ); + + if (strstr (ns->version, "jcrossclient")) + /* let them, for now*/; + else + { + ns->flush (); + //ns->destroy (); + } + //ns->facecache = true; + } + INVOKE_CLIENT (ADDME, ns, ARG_DATA (buf, len)); } @@ -685,6 +728,16 @@ } /** + * client requested an image. send it rate-limited + * before flushing. + */ +void +AskFaceCmd (char *buf, int len, client *ns) +{ + ns->askface.push_back (atoi (buf)); +} + +/** * Tells client the picture it has to use * to smooth a picture number given as argument. */ @@ -1252,13 +1305,6 @@ estartlen = esl.length (); } - else - { - /* suppress compiler warnings */ - ewhatstart = 0; - ewhatflag = 0; - estartlen = 0; - } /* x,y are the real map locations. ax, ay are viewport relative * locations. @@ -1271,6 +1317,8 @@ max_x = pl->x + (socket.mapx + 1) / 2; max_y = pl->y + (socket.mapy + 1) / 2; + maptile *plmap = pl->map; + for (y = pl->y - socket.mapy / 2; y < max_y; y++, ay++) { ax = 0; @@ -1286,7 +1334,7 @@ */ nx = x; ny = y; - m = get_map_from_coord (pl->map, &nx, &ny); + m = get_map_from_coord (plmap, &nx, &ny); if (!m) {