예제 #1
0
void deluser(USERS *user, acetables *g_ape)
{

	if (user == NULL) {
		return;
	}

	FIRE_EVENT_NULL(deluser, user, user->istmp, g_ape);

	left_all(user, g_ape);

	char *uin = GET_UIN_FROM_USER(user);

	/* kill all users connections */
	
	clear_subusers(user, g_ape);

	hashtbl_erase(g_ape->hSessid, user->sessid);
	if (uin != NULL && GET_USER_TBL(g_ape) != NULL) {
		hashtbl_erase(GET_USER_TBL(g_ape), uin);
	}
	if (uin != NULL && GET_ONLINE_TBL(g_ape) != NULL) {
		hashtbl_erase(GET_ONLINE_TBL(g_ape), uin);
	}

	if (user->istmp == 0) g_ape->nConnected--;
	
	if (user->prev == NULL) {
		g_ape->uHead = user->next;
	} else {
		user->prev->next = user->next;
	}
	if (user->next != NULL) {
		user->next->prev = user->prev;
	}

	clear_sessions(user);
	clear_properties(&user->properties);

	destroy_pipe(user->pipe, g_ape);
	
	HOOK_EVENT(deluser, user, g_ape);

	/* TODO Add Event */
	free(user);

}
예제 #2
0
파일: users.c 프로젝트: jabis/APE_Server
void deluser(USERS *user, acetables *g_ape)
{

	if (user == NULL) {
		return;
	}

	FIRE_EVENT_NULL(deluser, user, g_ape);
	

	left_all(user, g_ape);
	
	/* kill all users connections */
	
	clear_subusers(user);

	hashtbl_erase(g_ape->hSessid, user->sessid);

	
	g_ape->nConnected--;

	
	if (user->prev == NULL) {
		g_ape->uHead = user->next;
	} else {
		user->prev->next = user->next;
	}
	if (user->next != NULL) {
		user->next->prev = user->prev;
	}

	clear_sessions(user);
	clear_properties(&user->properties);
	destroy_pipe(user->pipe, g_ape);
	
	free(user);

	user = NULL;
}