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

Comparing deliantra/server/socket/item.C (file contents):
Revision 1.104 by root, Sun Jan 29 02:47:06 2017 UTC vs.
Revision 1.105 by root, Wed Nov 14 23:24:27 2018 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2018 Marc Alexander Lehmann / the Deliantra team
4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 5 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team 6 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 7 * Copyright (©) 1992 Frank Tore Johansen
7 * 8 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 9 * Deliantra is free software: you can redistribute it and/or modify it under
134 if (!head->custom_name) 135 if (!head->custom_name)
135 { 136 {
136 const char *name; 137 const char *name;
137 uint8 *len = sl.cur++; // patch up length later 138 uint8 *len = sl.cur++; // patch up length later
138 139
139 name = query_base_name (head, 0); sl << data (name, min (127, strlen (name))); 140 name = query_base_name (head, 0); sl << data_n (name, min (127, strlen (name)));
140 sl << uint8 (0); 141 sl << uint8 (0);
141 name = query_base_name (head, 1); sl << data (name, min (127, strlen (name))); 142 name = query_base_name (head, 1); sl << data_n (name, min (127, strlen (name)));
142 143
143 *len = sl.cur - len - 1; 144 *len = sl.cur - len - 1;
144 } 145 }
145 else 146 else
146 { 147 {
147 int len = min (127, head->custom_name.length ()); 148 int len = min (127, head->custom_name.length ());
148 149
149 sl << uint8 (len * 2 + 1) 150 sl << uint8 (len * 2 + 1)
150 << data (head->custom_name, len) 151 << data_n (head->custom_name, len)
151 << uint8 (0) 152 << uint8 (0)
152 << data (head->custom_name, len); 153 << data_n (head->custom_name, len);
153 } 154 }
154 155
155 sl << uint16 (head->animation_id); 156 sl << uint16 (head->animation_id);
156 157
157 int anim_speed = !head->flag [FLAG_ANIMATE] ? 0 158 int anim_speed = !head->flag [FLAG_ANIMATE] ? 0
607 { 608 {
608 std::string s = op->describe (pl->ob); 609 std::string s = op->describe (pl->ob);
609 610
610 packet sl ("ex"); 611 packet sl ("ex");
611 sl << ber32 (tag) 612 sl << ber32 (tag)
612 << data (*pl->expand_cfpod (s.c_str ())); 613 << data_n (*pl->expand_cfpod (s.c_str ()));
613 614
614 pl->ns->send_packet (sl); 615 pl->ns->send_packet (sl);
615 } 616 }
616} 617}
617 618

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines