--- deliantra/server/socket/request.c 2006/04/21 05:13:28 1.7 +++ deliantra/server/socket/request.c 2006/06/19 10:15:44 1.10 @@ -141,6 +141,11 @@ } } +void ExtCmd (char *buf, int len, player *pl) +{ + execute_global_event (EVENT_EXTCMD, pl, buf, len); +} + void MapInfoCmd (char *buf, int len, player *pl) { // mapinfocmd = atoi(param); - safe_strcat(cmdback, param, &slen, HUGE_BUF); + safe_strcat(cmdback, "1", &slen, HUGE_BUF); + } else if (!strcmp(cmd,"extcmd")) { + ns->extcmd = atoi(param); + safe_strcat(cmdback, "1", &slen, HUGE_BUF); } else if (!strcmp(cmd,"facecache")) { ns->facecache = atoi(param); safe_strcat(cmdback, param, &slen, HUGE_BUF); @@ -1605,8 +1613,7 @@ ax=0; for(x=pl->x-pl->contr->socket.mapx/2;x MAXSOCKBUF) { + if (sl.len >= MAXSOCKBUF) { LOG(llevError,"Buffer overflow in send_skill_info!\n"); fatal(0); } @@ -2075,7 +2082,7 @@ for(i=0; i MAXSOCKBUF) { + if (sl.len >= MAXSOCKBUF) { LOG(llevError,"Buffer overflow in send_spell_paths!\n"); fatal(0); } @@ -2219,7 +2226,7 @@ * like it will fix this */ if (spell->type != SPELL) continue; - if (sl.len > (MAXSOCKBUF - (26 + strlen(spell->name) + + if (sl.len >= (MAXSOCKBUF - (26 + strlen(spell->name) + (spell->msg?strlen(spell->msg):0)))) { Send_With_Handling(&pl->socket, &sl); strcpy((char*)sl.buf,"addspell "); @@ -2233,7 +2240,7 @@ return; } else append_spell(pl, &sl, spell); - if (sl.len > MAXSOCKBUF) { + if (sl.len >= MAXSOCKBUF) { LOG(llevError,"Buffer overflow in esrv_add_spells!\n"); fatal(0); }