Atrinik Server 2.5
Functions
socket/info.c File Reference
#include <global.h>
#include <stdarg.h>

Go to the source code of this file.

Functions

int color_notation_to_flag (const char *color)
void new_draw_info (int flags, const char *color, object *pl, const char *buf)
void new_draw_info_format (int flags, const char *color, object *pl, char *format,...)
static void new_info_map_all_except (int flags, const char *color, mapstruct *map, object *op1, object *op, const char *str)
void new_info_map (int flags, const char *color, mapstruct *map, int x, int y, int dist, const char *str)
void new_info_map_except (int flags, const char *color, mapstruct *map, int x, int y, int dist, object *op1, object *op, const char *str)
void send_socket_message (const char *color, socket_struct *ns, 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.


Function Documentation

void new_draw_info ( int  flags,
const char *  color,
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 120 of file info.c.

void new_draw_info_format ( int  flags,
const char *  color,
object pl,
char *  format,
  ... 
)

Similar to new_draw_info() but allows to use printf style formatting.

Parameters:
flagsFlags.
plPlayer.
formatFormat.
See also:
new_draw_info()

Definition at line 183 of file info.c.

void new_info_map ( int  flags,
const char *  color,
mapstruct map,
int  x,
int  y,
int  dist,
const char *  str 
)

Writes to everyone on the specified map.

Tiled maps will be considered.

Parameters:
colorFlags.
mapMap to write on.
xX position.
yY position.
distDistance.
strWhat to write.

Definition at line 228 of file info.c.

static void new_info_map_all_except ( int  flags,
const char *  color,
mapstruct map,
object op1,
object op,
const char *  str 
) [static]

Give message to all people on one, specified map.

Parameters:
colorFlags.
mapThe map.
op1Will not write to this object.
opWill not write to this object.
strWhat to write.

Definition at line 202 of file info.c.

void new_info_map_except ( int  flags,
const char *  color,
mapstruct map,
int  x,
int  y,
int  dist,
object op1,
object op,
const char *  str 
)

Writes to everyone on the map *except* op and op1. This is useful for emotions.

Tiled maps will be considered.

Parameters:
colorFlags.
mapMap to write on.
xX position.
yY position.
distDistance.
op1Will not write to this object.
opWill not write to this object.
strWhat to write.

Definition at line 382 of file info.c.

void send_socket_message ( const char *  color,
socket_struct ns,
const char *  buf 
)

Send a socket message, similar to new_draw_info() but the message will be sent using Write_String_To_Socket() instead.

Used for messages that are sent to player before they have finished logging in.

Parameters:
flagsFlags to send.
nsSocket to send to.
bufMessage to send.

Definition at line 533 of file info.c.