8#ifndef N_USER_MANAGEMENT
10#define N_USER_MANAGEMENT
31#define USERLIST_ALL_EXCEPT 1
Structure of a generic LIST container.
A box including a string and his lenght.
char name[1024]
User Name.
VECTOR3D * last_positions
Last nb_rec_pos position messages, for a better dead reckoning / lag simulation.
int only_last_pos
1 => keep only_last_position in waitlist , 0 => send all the positions, default: 1
int max
Maximum of user inside the list.
LIST * netw_waitlist
N_STR *messages waiting to be sent.
pthread_rwlock_t user_rwbolt
Mutex for thread safe user management.
int state
State of the current user.
VECTOR3D position
actual position
NETWORK * netw
Associated NETWORK.
int highter
Position of the highter user inside the list.
int id
Unique world ident.
int nb_rec_pos
Number of saved positions , default: 10.
N_USER * list
Pointer to the allocated list of user.
int userlist_del_user(N_USERLIST *ulist, int id)
delete an user from the list
int userlist_add_msg_to(N_USERLIST *ulist, N_STR *msg, int id)
add a N_STR *message to user list (USERLIST_ONE)
int userlist_add_msg_to_ex(N_USERLIST *ulist, N_STR *msg, int mode, int id)
add a N_STR *message to user list
int userlist_user_send_waiting_msgs(N_USERLIST *ulist, int id)
send all waiting messages in user 'id' waiting list
N_USERLIST * userlist_new(int max)
create a new N_USERLIST user list with 'max' users
int userlist_add_msg_to_all(N_USERLIST *ulist, N_STR *msg)
add a N_STR *message to user list (USERLIST_ALL)
int userlist_send_waiting_msgs(N_USERLIST *ulist)
send all waiting messages ofr each user of the lsit
int userlist_set_position_behavior(N_USERLIST *ulist, int id, int nb_rec_pos, int only_last_pos)
set the position parameters for trajectory processing for user 'id'
int userlist_add_user(N_USERLIST *ulist, NETWORK *netw)
add an user to the list
int userlist_add_msg_to_all_except(N_USERLIST *ulist, N_STR *msg, int id)
add a N_STR *message to user list except user 'id' (USERLIST_ALL_EXCEPT)
int userlist_destroy(N_USERLIST **ulist)
destroy and free a N_USERLIST *userlist
int userlist_user_add_waiting_msg(N_USERLIST *ulist, int id, N_STR *netmsg)
add a newtork message to specified user 'id'
double VECTOR3D[3]
struct of a point
Simple 3D movement simulation.
Common headers and low-level hugly functions & define.
N_STR and string function declaration.