--- deliantra/server/socket/lowlevel.C 2010/10/05 21:40:06 1.79
+++ deliantra/server/socket/lowlevel.C 2012/10/30 17:07:50 1.86
@@ -1,22 +1,22 @@
/*
* This file is part of Deliantra, the Roguelike Realtime MMORPG.
- *
- * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
- *
+ *
+ * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
+ *
* Deliantra is free software: you can redistribute it and/or modify it under
* the terms of the Affero GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the Affero GNU General Public License
* and the GNU General Public License along with this program. If not, see
* .
- *
+ *
* The authors can be reached via e-mail to
*/
@@ -55,9 +55,9 @@
{
if (last_send + IDLE_PING <= NOW && pl && pl->active)
{
- // this is a bit ugly, but map1/map1a seem to be the only
- // nop'able commands and they are quite small.
- packet sl (mapmode == Map1Cmd ? "map1" : "map1a");
+ // this is a bit ugly, but map1a seems to be the only
+ // nop'able command and it is quite small.
+ packet sl ("map1a");
send_packet (sl);
}
else
@@ -312,6 +312,18 @@
return true;
}
+void
+client::inbuf_handle ()
+{
+ if (!handle_packet ())
+ return;
+
+ while (handle_packet ())
+ ;
+
+ flush ();
+}
+
// callback called when socket is either readable or writable
void
client::socket_cb (iow &w, int revents)
@@ -365,14 +377,7 @@
else
{
inbuf_len += amount;
-
- if (handle_packet ())
- {
- while (handle_packet ())
- ;
-
- flush ();
- }
+ inbuf_handle ();
}
}
}