39 #include <sys/types.h> 41 #include <netinet/in.h> 42 #include <netinet/tcp.h> 77 len = 16+strlen(skill_names[i]);
79 LOG(
llevError,
"Buffer overflow in send_skill_info, not sending all skill information\n");
83 if (params != NULL && *params ==
'1') {
109 LOG(
llevError,
"Buffer overflow in send_spell_paths, not sending all spell information\n");
132 LOG(
llevError,
"Buffer overflow in send_exp_table, not sending all information\n");
145 #define AddShortAttr(New, Type) \ 147 SockList_AddChar(sl, Type); \ 148 SockList_AddShort(sl, New); \ 197 if (op->type == CLASS || op->type == PLAYER) {
200 const char *value, *value1;
201 char *lasts, *mychoices, *token;
204 if (op->type == PLAYER) {
216 if (value && value1) {
231 token =
strtok_r(mychoices,
" ", &lasts);
239 strlen(arch->clone.name));
241 LOG(
llevError,
"send_arch_info: Unable to find archetype %s\n", token);
243 token =
strtok_r(NULL,
" ", &lasts);
270 if (race->clone.type == PLAYER) {
301 static int sl_initialized = 0;
303 if (!sl_initialized) {
330 if (race && race->clone.type == PLAYER) {
339 if (cl->clone.type == CLASS) {
371 static int sl_initialized = 0;
373 if (!sl_initialized) {
391 archetype *
class = try_find_archetype(params);
400 if (
class && class->clone.type == CLASS) {
461 if (!strcmp(file,
"motd"))
463 else if (!strcmp(file,
"rules"))
465 else if (!strcmp(file,
"news"))
468 LOG(
llevError,
"send_file requested to send unknown file: %s\n", file);
471 fp = fopen(buf,
"r");
479 while (fgets(buf,
MAX_BUF, fp) != NULL) {
void SockList_AddPrintf(SockList *sl, const char *format,...)
static void do_map_info(archetype *m)
const char * skill_names[MAX_SKILLS]
void SockList_Reset(SockList *sl)
#define INFO_MAP_ARCH_NAME
void SockList_Init(SockList *sl)
uint8_t starting_stat_min
void archetypes_for_each(arch_op op)
const Face * skill_faces[MAX_SKILLS]
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)
static void do_race_list(archetype *race)
void SockList_AddLen16Data(SockList *sl, const void *data, size_t len)
void send_skill_info(socket_struct *ns, char *params)
void send_spell_paths(socket_struct *ns, char *params)
void send_map_info(socket_struct *ns)
uint8_t starting_stat_max
static void do_class_list(archetype *cl)
void send_race_list(socket_struct *ns, char *params)
#define INFO_MAP_DESCRIPTION
const char *const spellpathnames[NRSPELLPATHS]
archetype * try_find_archetype(const char *name)
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)
void send_race_info(socket_struct *ns, char *params)
#define AddShortAttr(New, Type)
void SockList_AddChar(SockList *sl, unsigned char c)
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen)
void esrv_send_face(socket_struct *ns, const Face *face, int nocache)
void send_exp_table(socket_struct *ns, char *params)
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)
#define CS_STAT_SKILLINFO
void Send_With_Handling(socket_struct *ns, SockList *sl)