--- deliantra/server/socket/request.C 2007/06/09 20:07:50 1.107
+++ deliantra/server/socket/request.C 2007/07/01 05:00:20 1.112
@@ -1,23 +1,22 @@
/*
- * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game.
+ * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
*
* Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
* Copyright (©) 2001,2007 Mark Wedel
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Crossfire TRT is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Crossfire TRT is free software: you can redistribute it and/or modify
+ * it under the terms of the 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.
+ * 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 GNU General Public License along
- * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*
* The authors can be reached via e-mail to
*/
@@ -473,27 +472,6 @@
}
/**
- * client requested an image. send it rate-limited
- * before flushing.
- */
-void
-AskFaceCmd (char *buf, int len, client *ns)
-{
- ns->askface.push_back (atoi (buf));
-}
-
-/**
- * Tells client the picture it has to use
- * to smooth a picture number given as argument.
- */
-void
-AskSmooth (char *buf, int len, client *ns)
-{
- ns->send_face (atoi (buf));
- ns->flush_fx ();
-}
-
-/**
* This handles the general commands from the client (ie, north, fire, cast,
* etc.)
*/
@@ -749,8 +727,8 @@
if (pl->golem)
buf << " Golem*: " << pl->golem->name;
+ buf << '\0';
buf.linearise (obuf);
- obuf [buf.size ()] = 0;
}
#define AddIfInt64(Old,New,Type) if (Old != New) {\
@@ -1032,12 +1010,10 @@
return;
int x, y, ax, ay, startlen, max_x, max_y, oldlen;
- sint16 nx, ny;
int estartlen, eoldlen;
uint8 eentrysize;
uint16 ewhatstart, ewhatflag;
uint8 extendedinfos;
- maptile *m;
check_map_change (pl);
prefetch_surrounding_maps (pl->ob);
@@ -1113,9 +1089,25 @@
for (y = ob->y - socket.mapy / 2; y < max_y; y++, ay++)
{
+ sint16 nx, ny;
+ maptile *m = 0;
+
ax = 0;
for (x = ob->x - socket.mapx / 2; x < max_x; x++, ax++)
{
+ // check to see if we can simply go one right quickly
+ ++nx;
+ if (m && nx >= m->width)
+ m = 0;
+
+ if (!m)
+ {
+ nx = x; ny = y; m = plmap;
+
+ if (!xy_normalise (m, nx, ny))
+ m = 0;
+ }
+
int emask, mask;
emask = mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4;
@@ -1124,10 +1116,6 @@
/* If the coordinates are not valid, or it is too dark to see,
* we tell the client as such
*/
- nx = x;
- ny = y;
- m = get_map_from_coord (plmap, &nx, &ny);
-
if (!m)
{
/* space is out of map. Update space and clear values