39 #include <sys/types.h>
41 #include <netinet/in.h>
42 #include <netinet/tcp.h>
78 LOG(
llevError,
"Buffer overflow in send_skill_info, not sending all skill information\n");
82 if (params != NULL && *params ==
'1') {
108 LOG(
llevError,
"Buffer overflow in send_spell_paths, not sending all spell information\n");
131 LOG(
llevError,
"Buffer overflow in send_exp_table, not sending all information\n");
144 #define AddShortAttr(New, Type) \
146 SockList_AddChar(sl, Type); \
147 SockList_AddShort(sl, New); \
199 const char *value, *value1;
200 char *lasts, *mychoices, *token;
215 if (value && value1) {
230 token =
strtok_r(mychoices,
" ", &lasts);
240 LOG(
llevError,
"send_arch_info: Unable to find archetype %s\n", token);
242 token =
strtok_r(NULL,
" ", &lasts);
294 static int sl_initialized = 0;
296 if (!sl_initialized) {
361 static int sl_initialized = 0;
363 if (!sl_initialized) {
381 archetype *
class = try_find_archetype(params);
390 if (
class && class->clone.type ==
CLASS) {
448 if (!strcmp(file,
"motd"))
450 else if (!strcmp(file,
"rules"))
452 else if (!strcmp(file,
"news"))
455 LOG(
llevError,
"send_file requested to send unknown file: %s\n", file);
458 fp = fopen(buf,
"r");
466 while (fgets(buf,
MAX_BUF, fp) != NULL) {
void SockList_AddPrintf(SockList *sl, const char *format,...)
void SockList_Reset(SockList *sl)
#define INFO_MAP_ARCH_NAME
void esrv_send_face(socket_struct *ns, uint16_t face_num, int nocache)
void SockList_Init(SockList *sl)
uint8_t starting_stat_min
const char * object_get_value(const object *op, const char *const key)
static void send_arch_info(SockList *sl, const object *op)
void SockList_AddShort(SockList *sl, uint16_t data)
void SockList_AddLen16Data(SockList *sl, const void *data, size_t len)
void send_skill_info(socket_struct *ns, char *params)
const char * skill_names[NUM_SKILLS]
void send_spell_paths(socket_struct *ns, char *params)
void send_map_info(socket_struct *ns)
uint8_t starting_stat_max
void send_race_list(socket_struct *ns, char *params)
#define INFO_MAP_DESCRIPTION
const char *const spellpathnames[NRSPELLPATHS]
void send_new_char_info(socket_struct *ns)
#define strtok_r(x, y, z)
void SockList_AddData(SockList *sl, const void *data, size_t len)
void send_file(socket_struct *ns, const char *file)
void SockList_Term(SockList *sl)
void SockList_AddString(SockList *sl, const char *data)
void send_class_list(socket_struct *ns, char *params)
size_t SockList_Avail(const SockList *sl)
archetype * try_find_archetype(const char *name)
void send_race_info(socket_struct *ns, char *params)
void SockList_AddChar(SockList *sl, char c)
#define AddShortAttr(New, Type)
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen)
void send_exp_table(socket_struct *ns, char *params)
int skill_faces[NUM_SKILLS]
uint8_t starting_stat_points
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
void LOG(LogLevel logLevel, const char *format,...)
static void build_race_list_reply(SockList *sl)
void SockList_AddInt64(SockList *sl, uint64_t data)
static void build_class_list_reply(SockList *sl)
const char *const short_stat_name[NUM_STATS]
void send_class_info(socket_struct *ns, char *params)
EXTERN archetype * first_archetype
#define CS_STAT_SKILLINFO
void Send_With_Handling(socket_struct *ns, SockList *sl)