This commit is contained in:
2025-07-14 22:24:27 +08:00
parent daacc18ecf
commit 4af19ef574
7722 changed files with 72086 additions and 0 deletions

View File

@ -0,0 +1,34 @@
// Copyright 2023 Dexter.Wan. All Rights Reserved.
// EMail: 45141961@qq.com
#include "Clients.h"
#include <string.h>
#include <stdio.h>
/**
* List callback function for comparing clients by clientid
* @param a first integer value
* @param b second integer value
* @return boolean indicating whether a and b are equal
*/
int clientIDCompare(void* a, void* b)
{
Clients* client = (Clients*)a;
/*printf("comparing clientdIDs %s with %s\n", client->clientID, (char*)b);*/
return strcmp(client->clientID, (char*)b) == 0;
}
/**
* List callback function for comparing clients by socket
* @param a first integer value
* @param b second integer value
* @return boolean indicating whether a and b are equal
*/
int clientSocketCompare(void* a, void* b)
{
Clients* client = (Clients*)a;
/*printf("comparing %d with %d\n", (char*)a, (char*)b); */
return client->net.socket == *(SOCKET*)b;
}