avoid bloating pings unless necessary

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4040 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-12-19 03:27:27 +00:00
parent 892803e220
commit e8ae150642
+2 -2
View File
@@ -365,7 +365,7 @@ void pingservers(bool issearch)
if(++lastping >= servers.length()) lastping = 0;
if(si.address.host == ENET_HOST_ANY) continue;
p.len = baselen;
putint(p, si.getnames || issearch ? EXTPING_NAMELIST : EXTPING_NOP);
if(si.getnames || issearch) putint(p, EXTPING_NAMELIST);
buf.data = ping;
buf.dataLength = p.length();
enet_socket_send(pingsock, &si.address, &buf, 1);
@@ -377,7 +377,7 @@ void pingservers(bool issearch)
address.host = ENET_HOST_BROADCAST;
address.port = CUBE_SERVINFO_PORT_LAN;
p.len = baselen;
putint(p, issearch ? EXTPING_NAMELIST : EXTPING_NOP);
if(issearch) putint(p, EXTPING_NAMELIST);
buf.data = ping;
buf.dataLength = p.length();
enet_socket_send(pingsock, &address, &buf, 1);