keep alive

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@459 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2006-11-01 20:57:12 +00:00
parent b5d3891985
commit f4289660d6
9 changed files with 29 additions and 4 deletions
+11
View File
@@ -204,6 +204,17 @@ void sendpackettoserv(void *packet)
else localclienttoserver((ENetPacket *)packet);
}
void c2skeepalive()
{
if(clientnum<0 || !clienthost) return;
if(lastmillis-lastupdate<40) return;
ENetEvent event;
while(clienthost!=NULL && enet_host_service(clienthost, &event, 0)>0) {}; // fixme
lastupdate = SDL_GetTicks();
};
extern string masterpwd;
void c2sinfo(dynent *d) // send update to the server