… | |
… | |
793 | { |
793 | { |
794 | LOG (llevDebug, "Corrupt ncom command <%s> not long enough - discarding\n", buf); |
794 | LOG (llevDebug, "Corrupt ncom command <%s> not long enough - discarding\n", buf); |
795 | return; |
795 | return; |
796 | } |
796 | } |
797 | |
797 | |
798 | packet = GetShort_String (buf); |
798 | packet = net_uint16 (buf); |
799 | repeat = GetInt_String (buf + 2); |
799 | repeat = net_uint32 (buf + 2); |
|
|
800 | |
800 | /* -1 is special - no repeat, but don't update */ |
801 | /* -1 is special - no repeat, but don't update */ |
801 | if (repeat != -1) |
802 | if (repeat != -1) |
802 | pl->count = repeat; |
803 | pl->count = repeat; |
803 | |
804 | |
804 | if ((len - 4) >= MAX_BUF) |
805 | if ((len - 4) >= MAX_BUF) |
… | |
… | |
961 | /* these are old dxclients */ |
962 | /* these are old dxclients */ |
962 | /* Version 1024 added support for singular + plural name values - |
963 | /* Version 1024 added support for singular + plural name values - |
963 | * requiing this minimal value reduces complexity of that code, and it |
964 | * requiing this minimal value reduces complexity of that code, and it |
964 | * has been around for a long time. |
965 | * has been around for a long time. |
965 | */ |
966 | */ |
966 | if (!strcmp (" CF DX CLIENT", cp) || ns->sc_version < 1024) |
967 | if (ns->sc_version < 1026) |
967 | { |
968 | { |
968 | sprintf (version_warning, "drawinfo %d %s", NDI_RED, |
969 | sprintf (version_warning, "drawinfo %d %s", NDI_RED, |
969 | "**** VERSION WARNING ****\n**** CLIENT IS TOO OLD!! UPDATE THE CLIENT!! ****"); |
970 | "**** VERSION WARNING ****\n**** CLIENT IS TOO OLD!! UPDATE THE CLIENT!! ****"); |
970 | Write_String_To_Socket (ns, version_warning, strlen (version_warning)); |
971 | Write_String_To_Socket (ns, version_warning, strlen (version_warning)); |
971 | } |
972 | } |
… | |
… | |
1482 | else |
1483 | else |
1483 | face_num = 0; |
1484 | face_num = 0; |
1484 | |
1485 | |
1485 | if (face_num != ns.lastmap.cells[ax][ay].faces[layer]) |
1486 | if (face_num != ns.lastmap.cells[ax][ay].faces[layer]) |
1486 | { |
1487 | { |
1487 | SockList_AddShort (&sl, face_num); |
1488 | sl << uint16 (face_num); |
1488 | if (face_num && !(ns.faces_sent[face_num] & NS_FACESENT_FACE)) |
1489 | if (face_num && !(ns.faces_sent[face_num] & NS_FACESENT_FACE)) |
1489 | esrv_send_face (&ns, face_num, 0); |
1490 | esrv_send_face (&ns, face_num, 0); |
1490 | |
1491 | |
1491 | heads[(ay * MAX_HEAD_POS + ax) * MAX_LAYERS + layer] = NULL; |
1492 | heads[(ay * MAX_HEAD_POS + ax) * MAX_LAYERS + layer] = NULL; |
1492 | ns.lastmap.cells[ax][ay].faces[layer] = face_num; |
1493 | ns.lastmap.cells[ax][ay].faces[layer] = face_num; |
… | |
… | |
2354 | { |
2355 | { |
2355 | SockList sl (MAXSOCKBUF); |
2356 | SockList sl (MAXSOCKBUF); |
2356 | sl << "replyinfo skill_info\n"; |
2357 | sl << "replyinfo skill_info\n"; |
2357 | |
2358 | |
2358 | for (int i = 1; i < NUM_SKILLS; i++) |
2359 | for (int i = 1; i < NUM_SKILLS; i++) |
2359 | sl.len += sprintf ((char *)sl.buf + sl.len, "%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names[i]); |
2360 | sl.printf ("%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names[i]); |
2360 | |
2361 | |
2361 | if (sl.len >= MAXSOCKBUF) |
2362 | if (sl.len >= MAXSOCKBUF) |
2362 | { |
2363 | { |
2363 | LOG (llevError, "Buffer overflow in send_skill_info!\n"); |
2364 | LOG (llevError, "Buffer overflow in send_skill_info!\n"); |
2364 | fatal (0); |
2365 | fatal (0); |
… | |
… | |
2378 | SockList sl (MAXSOCKBUF); |
2379 | SockList sl (MAXSOCKBUF); |
2379 | |
2380 | |
2380 | sl << "replyinfo spell_paths\n"; |
2381 | sl << "replyinfo spell_paths\n"; |
2381 | |
2382 | |
2382 | for (int i = 0; i < NRSPELLPATHS; i++) |
2383 | for (int i = 0; i < NRSPELLPATHS; i++) |
2383 | sl.len += sprintf ((char *)sl.buf + sl.len, "%d:%s\n", 1 << i, spellpathnames[i]); |
2384 | sl.printf ("%d:%s\n", 1 << i, spellpathnames[i]); |
2384 | |
2385 | |
2385 | if (sl.len >= MAXSOCKBUF) |
2386 | if (sl.len >= MAXSOCKBUF) |
2386 | { |
2387 | { |
2387 | LOG (llevError, "Buffer overflow in send_spell_paths!\n"); |
2388 | LOG (llevError, "Buffer overflow in send_spell_paths!\n"); |
2388 | fatal (0); |
2389 | fatal (0); |