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.90 by root, Fri Apr 27 00:49:58 2007 UTC vs.
Revision 1.96 by root, Sat May 12 19:30:18 2007 UTC

726send_query (client *ns, uint8 flags, const char *text) 726send_query (client *ns, uint8 flags, const char *text)
727{ 727{
728 ns->send_packet_printf ("query %d %s", flags, text ? text : ""); 728 ns->send_packet_printf ("query %d %s", flags, text ? text : "");
729} 729}
730 730
731/**
732 * Get player's current range attack in obuf.
733 */
734static void
735rangetostring (player *pl, char *obuf)
736{
737 dynbuf_text buf;
738
739 if (pl->ranged_ob)
740 buf << " Range" << (pl->ob->current_weapon == pl->ranged_ob ? "*" : "") << ": " << pl->ranged_ob->name;
741
742 if (pl->combat_ob)
743 buf << " Combat" << (pl->ob->current_weapon == pl->combat_ob ? "*" : "") << ": " << pl->combat_ob->name;
744
745 //TODO: maybe golem should become the current_weapon, quite simply?
746 if (pl->golem)
747 buf << " Golem*: " << pl->golem->name;
748
749 buf.linearise (obuf);
750 obuf [buf.size ()] = 0;
751}
752
731#define AddIfInt64(Old,New,Type) if (Old != New) {\ 753#define AddIfInt64(Old,New,Type) if (Old != New) {\
732 Old = New; \ 754 Old = New; \
733 sl << uint8 (Type) << uint64 (New); \ 755 sl << uint8 (Type) << uint64 (New); \
734 } 756 }
735 757
840 AddIfInt (ns->last_path_attuned, ob->path_attuned, CS_STAT_SPELL_ATTUNE); 862 AddIfInt (ns->last_path_attuned, ob->path_attuned, CS_STAT_SPELL_ATTUNE);
841 AddIfInt (ns->last_path_repelled, ob->path_repelled, CS_STAT_SPELL_REPEL); 863 AddIfInt (ns->last_path_repelled, ob->path_repelled, CS_STAT_SPELL_REPEL);
842 AddIfInt (ns->last_path_denied, ob->path_denied, CS_STAT_SPELL_DENY); 864 AddIfInt (ns->last_path_denied, ob->path_denied, CS_STAT_SPELL_DENY);
843 } 865 }
844 866
845 rangetostring (ob, buf); /* we want use the new fire & run system in new client */ 867 rangetostring (pl, buf); /* we want use the new fire & run system in new client */
846 AddIfString (ns->stats.range, buf, CS_STAT_RANGE); 868 AddIfString (ns->stats.range, buf, CS_STAT_RANGE);
847 set_title (ob, buf); 869 set_title (ob, buf);
848 AddIfString (ns->stats.title, buf, CS_STAT_TITLE); 870 AddIfString (ns->stats.title, buf, CS_STAT_TITLE);
849 871
850 /* Only send it away if we have some actual data */ 872 /* Only send it away if we have some actual data */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines