Set the number of server list sockets based on the number of concurrent updates divided by 4

This commit is contained in:
smallmodel 2025-04-27 20:32:41 +02:00
parent d07093fd96
commit e3ebedc5e4
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -184,7 +184,10 @@ GServerList ServerListNew(const char *gamename, const char *enginename, const ch
list->encryptdata = 1;
list->async = 0;
list->numslsockets = 2;
list->numslsockets = maxconcupdates / 4;
if (list->numslsockets < 1) {
list->numslsockets = 1;
}
list->slsockets = (GServerListSocket)malloc(sizeof(struct GServerListSocketImplementation) * list->numslsockets);
memset(list->slsockets, 0, sizeof(struct GServerListSocketImplementation) * list->numslsockets);
list->startslindex = 0;