--- deliantra/server/socket/loop.c 2006/04/18 20:05:42 1.5 +++ deliantra/server/socket/loop.c 2006/04/22 15:02:48 1.6 @@ -114,8 +114,8 @@ { "lookat", LookAt, 1}, { "lock", (func_uint8_int_pl)LockItem, 1}, { "mark", (func_uint8_int_pl)MarkItem, 1}, - { "mapredraw", MapRedrawCmd, 0}, /* Added: phil */ - { "mapinfo", MapInfoCmd, 0 }, /* CF+ */ + { "mapredraw", MapRedrawCmd, 2}, /* Added: phil */ + { "mapinfo", MapInfoCmd, 2}, /* CF+ */ { NULL, NULL, 0} /* terminator */ }; @@ -185,7 +185,8 @@ * or no more characters to read. */ do { - if (ns->inbuf.len >= MAXSOCKBUF-1) { + /* hack to disable old socket mode without creating too many conflicts */ + if (1 || ns->inbuf.len >= MAXSOCKBUF-1) { ns->status = Ns_Dead; LOG(llevDebug, "Old input socket sent too much data without newline\n"); return; @@ -330,7 +331,7 @@ /* Loop through this - maybe we have several complete packets here. */ // limit to a few commands only, though, as to not monopolise the server - for (cnt = 16; --cnt; ) { + for (cnt = 16; cnt--; ) { /* If it is a player, and they don't have any speed left, we * return, and will read in the data when they do have time. */ @@ -385,22 +386,25 @@ if (strcmp((char*)ns->inbuf.buf+2,nscommands[i].cmdname)==0) { nscommands[i].cmdproc((char*)data,len,ns); ns->inbuf.len=0; + return;//D goto next_packet; } } /* Player must be in the playing state or the flag on the * the command must be zero for the user to use the command - * otherwise, a player cam save, be in the play_again state, and - * the map they were on getsswapped out, yet things that try to look + * the map they were on gets swapped out, yet things that try to look * at the map causes a crash. If the command is valid, but * one they can't use, we still swallow it up. */ if (pl) for (i=0; plcommands[i].cmdname !=NULL; i++) { if (strcmp((char*)ns->inbuf.buf+2,plcommands[i].cmdname)==0) { - if (pl->state == ST_PLAYING || plcommands[i].flag == 0) + if (pl->state == ST_PLAYING || !(plcommands[i].flag & 1)) plcommands[i].cmdproc((char*)data,len,pl); ns->inbuf.len=0; - goto next_packet; + if (plcommands[i].flag & 2) + goto next_packet; + return; } } /* If we get here, we didn't find a valid command. Logging