ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/request.C
(Generate patch)

Comparing deliantra/server/socket/request.C (file contents):
Revision 1.95 by root, Thu May 3 09:29:45 2007 UTC vs.
Revision 1.98 by root, Fri May 18 15:05:09 2007 UTC

1/* 1/*
2 * CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
5 * Copyright (C) 2001 Mark Wedel 5 * Copyright (C) 2001 Mark Wedel
6 * Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
7 * 7 *
735rangetostring (player *pl, char *obuf) 735rangetostring (player *pl, char *obuf)
736{ 736{
737 dynbuf_text buf; 737 dynbuf_text buf;
738 738
739 if (pl->ranged_ob) 739 if (pl->ranged_ob)
740 buf << " Range: " << pl->ranged_ob->name; 740 buf << " Range" << (pl->ob->current_weapon == pl->ranged_ob ? "*" : "") << ": " << pl->ranged_ob->name;
741 741
742 if (pl->combat_ob) 742 if (pl->combat_ob)
743 buf << " Combat: " << pl->combat_ob->name; 743 buf << " Combat" << (pl->ob->current_weapon == pl->combat_ob ? "*" : "") << ": " << pl->combat_ob->name;
744 744
745 //TODO: maybe golem should become the current_weapon, quite simply?
745 if (pl->golem) 746 if (pl->golem)
746 buf << " Golem: " << pl->golem->name; 747 buf << " Golem*: " << pl->golem->name;
747 748
748 buf.linearise (obuf); 749 buf.linearise (obuf);
749 obuf [buf.size ()] = 0; 750 obuf [buf.size ()] = 0;
750} 751}
751 752
762#define AddIfShort(Old,New,Type) if (Old != New) {\ 763#define AddIfShort(Old,New,Type) if (Old != New) {\
763 Old = New; \ 764 Old = New; \
764 sl << uint8 (Type) << uint16 (New); \ 765 sl << uint8 (Type) << uint16 (New); \
765 } 766 }
766 767
767#define AddIfFloat(Old,New,Type) if (Old != New) {\ 768#define AddIfFloat(Old,New,Type,mult) if (Old != New) {\
768 Old = New; \ 769 Old = New; \
769 sl << uint8 (Type) << uint32 (New*FLOAT_MULTI); \ 770 sl << uint8 (Type) << uint32 (New*FLOAT_MULTI*mult); \
770 } 771 }
771 772
772#define AddIfString(Old,New,Type) if (Old == NULL || strcmp(Old,New)) {\ 773#define AddIfString(Old,New,Type) if (Old == NULL || strcmp(Old,New)) {\
773 free(Old); Old = strdup (New);\ 774 free(Old); Old = strdup (New);\
774 sl << uint8 (Type) << data8 (New); \ 775 sl << uint8 (Type) << data8 (New); \
827 AddIfInt64 (ns->last_stats.exp, ob->stats.exp, CS_STAT_EXP64); 828 AddIfInt64 (ns->last_stats.exp, ob->stats.exp, CS_STAT_EXP64);
828 AddIfShort (ns->last_level, ob->level, CS_STAT_LEVEL); 829 AddIfShort (ns->last_level, ob->level, CS_STAT_LEVEL);
829 AddIfShort (ns->last_stats.wc, ob->stats.wc, CS_STAT_WC); 830 AddIfShort (ns->last_stats.wc, ob->stats.wc, CS_STAT_WC);
830 AddIfShort (ns->last_stats.ac, ob->stats.ac, CS_STAT_AC); 831 AddIfShort (ns->last_stats.ac, ob->stats.ac, CS_STAT_AC);
831 AddIfShort (ns->last_stats.dam, ob->stats.dam, CS_STAT_DAM); 832 AddIfShort (ns->last_stats.dam, ob->stats.dam, CS_STAT_DAM);
832 AddIfFloat (ns->last_speed, ob->speed, CS_STAT_SPEED); 833 AddIfFloat (ns->last_speed, ob->speed, CS_STAT_SPEED, 1.f/TICK);
833 AddIfShort (ns->last_stats.food, ob->stats.food, CS_STAT_FOOD); 834 AddIfShort (ns->last_stats.food, ob->stats.food, CS_STAT_FOOD);
834 AddIfFloat (ns->last_weapon_sp, pl->weapon_sp, CS_STAT_WEAP_SP); 835 AddIfFloat (ns->last_weapon_sp, pl->weapon_sp, CS_STAT_WEAP_SP, 1.f/TICK);
835 AddIfInt (ns->last_weight_limit, weight_limit[ob->stats.Str], CS_STAT_WEIGHT_LIM); 836 AddIfInt (ns->last_weight_limit, weight_limit[ob->stats.Str], CS_STAT_WEIGHT_LIM);
836 837
837 flags = 0; 838 flags = 0;
838 839
839 if (pl->fire_on) 840 if (pl->fire_on)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines