Go to the documentation of this file.
39 #include <sys/types.h>
41 #include <netinet/in.h>
42 #include <netinet/tcp.h>
81 LOG(
llevError,
"Buffer overflow in send_skill_info, not sending all skill information\n");
112 LOG(
llevError,
"Buffer overflow in send_spell_paths, not sending all spell information\n");
137 LOG(
llevError,
"Buffer overflow in send_exp_table, not sending all information\n");
150 #define AddShortAttr(New, Type) \
152 SockList_AddChar(sl, Type); \
153 SockList_AddShort(sl, New); \
206 const char *
value, *value1;
207 char *lasts, *mychoices, *
token;
211 snprintf(
buf,
MAX_BUF,
"race_choice_description_%d", i);
216 snprintf(
buf,
MAX_BUF,
"class_choice_description_%d", i);
222 if (
value && value1) {
237 token = strtok_r(mychoices,
" ", &lasts);
245 strlen(
arch->clone.name));
249 token = strtok_r(NULL,
" ", &lasts);
307 static int sl_initialized = 0;
309 if (!sl_initialized) {
328 LOG(
llevError,
"send_race_info: IP '%s' sent bogus race_info command.\n", ns->
host);
377 static int sl_initialized = 0;
379 if (!sl_initialized) {
398 LOG(
llevError,
"send_class_info: IP '%s' sent bogus class_info request.\n", ns->
host);
401 archetype *
class = try_find_archetype(params);
410 if (
class && class->clone.type ==
CLASS) {
475 if (!strcmp(
file,
"motd"))
477 else if (!strcmp(
file,
"rules"))
479 else if (!strcmp(
file,
"news"))
485 fp = fopen(
buf,
"r");
542 snprintf(
buf,
MAX_BUF,
"R class requestinfo");
545 snprintf(
buf,
MAX_BUF,
"O startingmap requestinfo");
void SockList_AddInt64(SockList *sl, uint64_t data)
void send_race_list(socket_struct *ns)
void send_class_info(socket_struct *ns, char *params)
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
void archetypes_for_each(arch_op op)
void SockList_AddString(SockList *sl, const char *data)
void send_spell_paths(socket_struct *ns)
uint8_t starting_stat_min
void send_class_list(socket_struct *ns)
void send_file(socket_struct *ns, const char *file)
void SockList_AddLen16Data(SockList *sl, const void *data, size_t len)
void SockList_Reset(SockList *sl)
static void build_class_list_reply(SockList *sl)
size_t SockList_Avail(const SockList *sl)
const char * object_get_value(const object *op, const char *const key)
static event_registration m
void esrv_send_face(socket_struct *ns, const Face *face, int nocache)
static void do_class_list(archetype *cl)
void SockList_AddShort(SockList *sl, uint16_t data)
static void build_race_list_reply(SockList *sl)
void SockList_AddChar(SockList *sl, unsigned char c)
static void do_map_info(archetype *m)
void send_race_info(socket_struct *ns, char *params)
const char * skill_names[MAX_SKILLS]
#define CS_STAT_SKILLINFO
#define INFO_MAP_ARCH_NAME
void SockList_Init(SockList *sl)
static void send_arch_info(SockList *sl, const object *op)
void SockList_Term(SockList *sl)
uint8_t starting_stat_points
void send_map_info(socket_struct *ns)
void SockList_AddData(SockList *sl, const void *data, size_t len)
const char *const spellpathnames[NRSPELLPATHS]
void LOG(LogLevel logLevel, const char *format,...)
#define AddShortAttr(New, Type)
const Face * skill_faces[MAX_SKILLS]
void send_new_char_info(socket_struct *ns)
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
const char *const short_stat_name[NUM_STATS]
static void do_race_list(archetype *race)
void send_skill_info(socket_struct *ns, char *params)
void send_exp_table(socket_struct *ns)
archetype * try_find_archetype(const char *name)
void Send_With_Handling(socket_struct *ns, SockList *sl)
#define INFO_MAP_DESCRIPTION
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen)
void SockList_AddPrintf(SockList *sl, const char *format,...)
uint8_t starting_stat_max