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

Comparing deliantra/server/socket/info.C (file contents):
Revision 1.52 by root, Mon Oct 12 14:00:59 2009 UTC vs.
Revision 1.53 by root, Thu Oct 15 21:09:32 2009 UTC

178 * client/server bandwidth (client could keep track of various strings 178 * client/server bandwidth (client could keep track of various strings
179 */ 179 */
180void 180void
181new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...) 181new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...)
182{ 182{
183 char buf[HUGE_BUF];
184
185 va_list ap; 183 va_list ap;
186 va_start (ap, format); 184 va_start (ap, format);
187 vsnprintf (buf, HUGE_BUF, format, ap); 185 new_draw_info (flags, pri, pl, vformat (format, ap));
188 va_end (ap); 186 va_end (ap);
189
190 new_draw_info (flags, pri, pl, buf);
191} 187}
192 188
193void 189void
194draw_ext_info (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage) 190draw_ext_info (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
195{ 191{
216} 212}
217 213
218void 214void
219draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) 215draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...)
220{ 216{
221 char buf[HUGE_BUF]; 217 va_list ap;
218 va_start (ap, new_format);
222 219
223 if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) 220 if (!pl || !pl->is_player ())
224 return; 221 return;
225 222
223 // TODO: just assume, and rip out?
226 if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type)) 224 if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type))
227 { 225 {
228 va_list ap;
229
230 LOG (llevDebug, "Non supported extension text type for client.\n"); 226 LOG (llevDebug, "Non supported extension text type for client.\n");
231 va_start (ap, new_format);
232 vsnprintf (buf, HUGE_BUF, old_format, ap);
233 va_end (ap);
234 new_draw_info (flags, pri, pl, buf); 227 new_draw_info (flags, pri, pl, vformat (old_format, ap));
235 return;
236 } 228 }
237 else 229 else
238 { 230 {
239 va_list ap; 231 char *buf = vformat (new_format, ap);
240
241 va_start (ap, new_format);
242 vsnprintf (buf, HUGE_BUF, new_format, ap);
243 va_end (ap);
244 strip_media_tag (buf); 232 strip_media_tag (buf);
245 esrv_print_ext_msg (pl->contr->ns, flags & NDI_COLOR_MASK, type, subtype, buf); 233 esrv_print_ext_msg (pl->contr->ns, flags & NDI_COLOR_MASK, type, subtype, buf);
246 } 234 }
235
236 va_end (ap);
247} 237}
248 238
249/** 239/**
250 * Writes to everyone on the map *except* op. This is useful for emotions. 240 * Writes to everyone on the map *except* op. This is useful for emotions.
251 */ 241 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines