added cmd_trace and cmd_wipeinfo
[NeonServV5.git] / UserNode.c
index a20fb1e49b9ee1dd4627f24f4079e0f091663d72..dccdad9d7a14579c958159af4225b100924de22d 100644 (file)
@@ -128,6 +128,21 @@ char *getAuthFakehost(char *auth) {
     return NULL;
 }
 
+struct UserNode* getAllUsers(struct UserNode *last) {
+    if(last == NULL || last->next == NULL) {
+        int cindex;
+        if(last == NULL)
+            cindex = 0;
+        else
+            cindex = get_nicklist_entry(last->nick[0]) + 1;
+        while(userList[cindex] == NULL && cindex <= VALID_NICK_CHARS_FIRST_LEN)
+            cindex++;
+        if(cindex > VALID_NICK_CHARS_FIRST_LEN) return NULL;
+        return userList[cindex];
+    } else
+        return last->next;
+}
+
 struct UserNode* addUser(const char *nick) {
     int userListIndex = get_nicklist_entry(*nick);
     if(userListIndex == -1 || !is_valid_nick(nick))