Atrinik Server  4.0
Macros | Functions
info.c File Reference
#include <global.h>
#include <stdarg.h>
#include <toolkit/packet.h>
#include <player.h>
#include <object.h>

Go to the source code of this file.

Macros

#define DRAW_INFO_FORMAT_CONSTRUCT()
 

Functions

void draw_info_send (uint8_t type, const char *name, const char *color, socket_struct *ns, const char *buf)
 
void draw_info_full (uint8_t type, const char *name, const char *color, StringBuffer *sb_capture, object *pl, const char *buf)
 
void draw_info_full_format (uint8_t type, const char *name, const char *color, StringBuffer *sb_capture, object *pl, const char *format,...)
 
void draw_info_type (uint8_t type, const char *name, const char *color, object *pl, const char *buf)
 
void draw_info_type_format (uint8_t type, const char *name, const char *color, object *pl, const char *format,...)
 
void draw_info (const char *color, object *pl, const char *buf)
 
void draw_info_format (const char *color, object *pl, const char *format,...)
 
static int draw_info_map_internal (mapstruct *tiled, mapstruct *map, uint8_t type, const char *name, const char *color, object *op, object *op2, const char *buf, int dist, int x, int y)
 
void draw_info_map (uint8_t type, const char *name, const char *color, mapstruct *map, int x, int y, int dist, object *op, object *op2, const char *buf)
 

Detailed Description

This file is the one and only DRAWINFO output module.

All player communication using drawinfo is handled here - except the few messages we send to the client using DRAWINFO before we had setup any player structure - for example when an outdated client logs in and we send "update your client" directly to the info windows.

But if the player is logged in, all DRAWINFO are generated here.

Definition in file info.c.

Macro Definition Documentation

#define DRAW_INFO_FORMAT_CONSTRUCT ( )
Value:
char buf[HUGE_BUF]; \
va_list ap; \
va_start(ap, format); \
vsnprintf(buf, sizeof(buf), format, ap); \
va_end(ap);

Definition at line 43 of file info.c.

Function Documentation

void draw_info_full ( uint8_t  type,
const char *  name,
const char *  color,
StringBuffer *  sb_capture,
object pl,
const char *  buf 
)

Draw a message in the text windows for player's client.

Parameters
flagsVarious flags. Mostly color, but also some others.
plThe player object to write the information to - if flags has NDI_ALL, this is unused and can be NULL.
bufThe message to draw.

Definition at line 85 of file info.c.

void draw_info_full_format ( uint8_t  type,
const char *  name,
const char *  color,
StringBuffer *  sb_capture,
object pl,
const char *  format,
  ... 
)

Similar to draw_info_full but allows using printf style formatting.

Parameters
flagsFlags.
plPlayer.
formatFormat.
See Also
draw_info_full

Definition at line 125 of file info.c.

void draw_info_map ( uint8_t  type,
const char *  name,
const char *  color,
mapstruct map,
int  x,
int  y,
int  dist,
object op,
object op2,
const char *  buf 
)

Writes to everyone on the specified map.

Tiled maps will be considered.

Parameters
flagsA combination of NDI_xxx.
colorOne of COLOR_xxx.
mapMap to write on.
xX position where the message is coming from.
xY position where the message is coming from.
distMaximum distance from xy a player may be in order to see the message.
opWill not write to this player.
op2Will not write to this player either.
bufWhat to write.

Definition at line 195 of file info.c.