--- deliantra/server/socket/request.C 2007/06/04 13:04:01 1.103
+++ 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.)
*/
@@ -524,7 +502,6 @@
pl->count = 0;
}
-
/**
* This handles the general commands from the client (ie, north, fire, cast,
* etc.). It is a lot like PlayerCmd above, but is called with the
@@ -740,16 +717,18 @@
if (pl->combat_ob)
buf << " Combat" << (pl->ob->current_weapon == pl->combat_ob ? "*" : "") << ": " << pl->combat_ob->name;
+#if 0
//TODO: remove this when slot system is working, this is only for debugging
if (pl->ob->chosen_skill)
buf << " Skill*: " << pl->ob->chosen_skill->name;
+#endif
//TODO: maybe golem should become the current_weapon, quite simply?
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) {\
@@ -797,6 +776,8 @@
if (!ob)
return;
+ player *opl = ob->contr ? static_cast(ob->contr) : pl;
+
packet sl ("stats");
AddIfShort (ns->last_stats.hp, ob->stats.hp, CS_STAT_HP);
@@ -814,7 +795,7 @@
AddIfShort (ns->last_stats.Cha, ob->stats.Cha, CS_STAT_CHA);
for (int s = 0; s < NUM_SKILLS; s++)
- if (object *skill = pl->last_skill_ob[s])
+ if (object *skill = opl->last_skill_ob[s])
if (skill->stats.exp != ns->last_skill_exp [s])
{
ns->last_skill_exp [s] = skill->stats.exp;
@@ -839,10 +820,10 @@
flags = 0;
- if (pl->fire_on)
+ if (opl->fire_on)
flags |= SF_FIREON;
- if (pl->run_on)
+ if (opl->run_on)
flags |= SF_RUNON;
AddIfShort (ns->last_flags, flags, CS_STAT_FLAGS);
@@ -866,7 +847,7 @@
AddIfInt (ns->last_path_denied, ob->path_denied, CS_STAT_SPELL_DENY);
}
- rangetostring (pl, buf); /* we want use the new fire & run system in new client */
+ rangetostring (opl, buf); /* we want use the new fire & run system in new client */
AddIfString (ns->stats.range, buf, CS_STAT_RANGE);
set_title (ob, buf);
AddIfString (ns->stats.title, buf, CS_STAT_TITLE);
@@ -1029,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);
@@ -1110,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;
@@ -1121,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
@@ -1215,6 +1206,7 @@
lastcell.count = d;
mapspace &ms = m->at (nx, ny);
+ ms.update ();
if (socket.extmap)
{