10 void draw_ext_info(
int flags,
int pri,
const object *pl, uint8_t type, uint8_t subtype,
const char *message);
36 void look_at(
object *op,
int dx,
int dy);
119 void play_sound_map(int8_t sound_type,
object *emitter,
int dir, const
char *action);
static event_registration c
void SockList_AddPrintf(SockList *sl, const char *format,...)
Adds a printf like formatted string.
void do_server(void)
This checks the sockets for input and exceptions, does the right thing.
void SockList_Reset(SockList *sl)
Resets the length of the stored data for writing.
This represents one animation.
void SockList_Init(SockList *sl)
Initializes the SockList instance.
void esrv_send_item(object *pl, object *op)
Sends item's info to player.
void send_skill_extra(socket_struct *ns, char *params)
Send extra skill information.
void metaserver2_exit()
Stop metaserver updates.
void set_face_mode_cmd(char *buf, int len, socket_struct *ns)
void account_login_cmd(char *buf, int len, socket_struct *ns)
Handles the account login.
void request_info_cmd(char *buf, int len, socket_struct *ns)
request_info_cmd is sort of a meta command.
void SockList_ResetRead(SockList *sl)
Resets the length of the stored data for reading.
int GetInt_String(const unsigned char *data)
Basically does the reverse of SockList_AddInt, but on strings instead.
void mark_item_cmd(uint8_t *data, int len, player *pl)
Client wants to mark some object.
void look_at_cmd(char *buf, int len, player *pl)
Client wants to look at some object.
void version_cmd(char *buf, int len, socket_struct *ns)
Client tells its version.
void metaserver_update(void)
Updates our info in the metaserver Note that this is used for both metaserver1 and metaserver2 - for ...
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
New face structure - this enforces the notion that data is face by face only - you can not change the...
void print_ext_msg(socket_struct *ns, int color, uint8_t type, uint8_t subtype, const char *message)
Draws an extended message on the client.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
void magic_mapping_mark(object *pl, char *map_mark, int strength)
Creates magic map for player.
void send_map_info(socket_struct *ns)
Send information on available start maps.
void send_image_sums(socket_struct *ns, char *params)
Sends requested face information.
void init_server(void)
This sets up the listening socket.
void SockList_AddShort(SockList *sl, uint16_t data)
Adds a 16 bit value.
Socket structure, represents a client-server connection.
void SockList_AddLen16Data(SockList *sl, const void *data, size_t len)
Adds a data block prepended with an 16 bit length field.
void esrv_send_inventory(object *pl, object *op)
Sends inventory of a container.
void update_players(void)
Send updates to players.
void send_account_players(socket_struct *ns)
Upon successful login/account creation, we send a list of characters associated with the account to t...
void new_player_cmd(uint8_t *buf, int len, player *pl)
This handles the commands issued by the player (ie, north, fire, cast, etc.).
void SockList_AddInt(SockList *sl, uint32_t data)
Adds a 32 bit value.
void draw_magic_map(object *pl)
Creates and sends magic map to player.
void inscribe_scroll_cmd(char *buf, int len, player *pl)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
Sends message to player(s).
void send_skill_info(socket_struct *ns, char *params)
This sends the skill number to name mapping.
#define PRINTF_ARGS(x, y)
Used for printf-like functions, mostly LOG and draw_ext_info_format.
void esrv_add_spells(player *pl, object *spell)
This tells the client to add the spell *spell, if spell is NULL, then add all spells in the player's ...
void free_newsocket(socket_struct *ns)
Frees a socket.
void free_all_newserver(void)
Free's all the memory that ericserver allocates.
void esrv_del_item(player *pl, object *ob)
Tells the client to delete an item.
void map_newmap_cmd(socket_struct *ns)
Sound related function.
void esrv_new_player(player *pl, uint32_t weight)
Tells the client that here is a player it should start using.
void send_plugin_custom_message(object *pl, char *buf)
GROS: The following one is used to allow a plugin to send a generic cmd to a player.
void SockList_AddData(SockList *sl, const void *data, size_t len)
Adds a data block.
int is_valid_faceset(int fsn)
Checks specified faceset is valid.
void send_query(socket_struct *ns, uint8_t flags, const char *text)
Asks the client to query the user.
void send_background_music(player *pl, const char *music)
Sends background music to client.
short GetShort_String(const unsigned char *data)
void SockList_Term(SockList *sl)
Frees all resources allocated by a SockList instance.
void send_exp_table(socket_struct *ns)
This sends the experience table the sever is using.
void account_password(char *buf, int len, socket_struct *ns)
Handles the account password change.
void init_listening_socket(socket_struct *ns)
This opens *ns for listening to connections.
void ext_info_map_except(int color, const mapstruct *map, const object *op, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the map except *op.
void SockList_AddString(SockList *sl, const char *data)
Adds a string without length.
void look_at(object *op, int dx, int dy)
Prints items on the specified square.
void account_new_cmd(char *buf, int len, socket_struct *ns)
Handles the account creation This function shares a fair amount of the same logic as account_login_cm...
size_t SockList_Avail(const SockList *sl)
Returns the available bytes in a SockList instance.
void send_race_info(socket_struct *ns, char *params)
Sends information on specified race to the client.
uint32_t tag_t
Object tag, unique during the whole game.
void reset_stats(struct CS_Stats *stats)
void send_image_info(socket_struct *ns)
Sends the number of images, checksum of the face file, and the image_info file information.
void esrv_map_scroll(socket_struct *ns, int dx, int dy)
void send_class_info(socket_struct *ns, char *params)
Send information on the specified class.
void set_sound_cmd(char *buf, int len, socket_struct *ns)
void set_up_cmd(char *buf, int len, socket_struct *ns)
This is the Setup cmd - easy first implementation.
static const flag_definition flags[]
Flag mapping.
void SockList_AddChar(SockList *sl, unsigned char c)
Adds an 8 bit value.
void draw_client_map(object *pl)
Draws client map.
void toggle_extended_infos_cmd(char *buf, int len, socket_struct *ns)
void esrv_draw_look(object *pl)
Send the look window.
void send_spell_paths(socket_struct *ns)
This sends the spell path to name mapping.
void esrv_send_animation(socket_struct *ns, const Animations *anim)
Need to send an animation sequence to the client.
void play_sound_player_only(player *pl, int8_t sound_type, object *emitter, int dir, const char *action)
Plays a sound for specified player only.
void esrv_send_face(socket_struct *ns, const Face *face, int nocache)
Sends a face to a client if they are in pixmap mode, nothing gets sent in bitmap mode.
void init_connection(socket_struct *ns, const char *from_ip)
Initializes a connection.
void send_tick(player *pl)
void send_class_list(socket_struct *ns)
Sends the list of classes to the client.
void send_race_list(socket_struct *ns)
Send the list of player races to the client.
void lock_item_cmd(uint8_t *data, int len, player *pl)
Client wants to apply some object.
void write_cs_stats(void)
Statistics for the last CS_LOGTIME seconds on the server.
bool handle_client(socket_struct *ns, player *pl)
Handle commands from a client.
void ask_smooth_cmd(char *buf, int len, socket_struct *ns)
Tells client the picture it has to use to smooth a picture number given as argument.
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
Adds a data block prepended with an 8 bit length field.
void esrv_remove_spell(player *pl, object *spell)
void send_file(socket_struct *ns, const char *file)
Sends the desired file to the client.
void toggle_extended_text_cmd(char *buf, int len, socket_struct *ns)
void examine_cmd(char *buf, int len, player *pl)
Client wants to examine some object.
void ext_info_map_except2(int color, const mapstruct *map, const object *op1, const object *op2, int type, int subtype, const char *str1)
Writes to everyone on the map except op1 and op2.
void apply_cmd(char *buf, int len, player *pl)
Client wants to apply some object.
void account_add_player_cmd(char *buf, int len, socket_struct *ns)
Handle accountaddplayer from server (add a character to this account).
void esrv_send_pickup(player *pl)
Sends the "pickup" state to pl if client wants it requested.
void final_free_player(player *pl)
Sends the 'goodbye' command to the player, and closes connection.
void player_update_bg_music(object *player)
void add_me_cmd(char *buf, int len, socket_struct *ns)
The client has requested to be added to the game.
void set_title(const object *pl, char *buf, size_t len)
Sets player title.
void reply_cmd(char *buf, int len, player *pl)
This is a reply to a previous query.
void send_new_char_info(socket_struct *ns)
Sends information related to creating a new character to the client.
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
Plays a sound on a map.
void SockList_AddStringBuffer(SockList *sl, StringBuffer *sb)
Deallocates string buffer instance and appends its contents.
A buffer that will be expanded as content is added to it.
int metaserver2_init(void)
This initializes the metaserver2 logic - it reads the metaserver2 file, storing the values away...
void rangetostring(const object *pl, char *obuf, size_t len)
Get player's current range attack in obuf.
void esrv_update_spells(player *pl)
This looks for any spells the player may have that have changed their stats.
Contains the base information we use to make up a packet we want to send.
void SockList_AddInt64(SockList *sl, uint64_t data)
Adds a 64 bit value.
void SockList_NullTerminate(SockList *sl)
Adds a NUL byte without changing the length.
void void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the specified map.
void esrv_update_stats(player *pl)
Sends a statistics update.
int SockList_ReadPacket(int fd, SockList *sl, int len)
This reads from fd and puts the data in sl.
void send_face_cmd(char *buff, int len, socket_struct *ns)
Client has requested pixmap that it somehow missed getting.
void move_cmd(char *buf, int len, player *pl)
Moves an object (typically, container to inventory).
void create_player_cmd(char *buf, int len, socket_struct *ns)
We have received a createplayer command.
void Send_With_Handling(socket_struct *ns, SockList *sl)
Calls Write_To_Socket to send data to the client.
void esrv_move_object(object *pl, tag_t to, tag_t tag, long nrof)
Move an object to a new location.
void account_play_cmd(char *buf, int len, socket_struct *ns)
We have received an accountplay command.