dysphie / nmrih-qol-ex

Fork of Ryan's Quality of Life plugin with NMRiH 1.13.0 support
GNU General Public License v3.0
8 stars 1 forks source link

Remove MAXPLAYERS_NMRIH 9 #1

Closed mostten closed 3 years ago

mostten commented 3 years ago

Remove Line 126 #define MAXPLAYERS_NMRIH 9, Replace playerData[MAXPLAYERS_NMRIH +1] with playerData[MAXPLAYERS+1],

Use dynamic array for example:

int[] others = new int[MaxClients]; int count = GetOtherClients(client, others);

int GetOtherClients(int client, int[] others){...}

dysphie commented 3 years ago

Replace playerData[MAXPLAYERS_NMRIH +1] with playerData[MAXPLAYERS+1]

The reasoning behind using MAXPLAYERS_NMRIH is that the client and server binaries are compiled with a MAXPLAYERS definition of 9. You can never surpass this limit, so using Sourcemod's MAXPLAYERS (which evaluates to 65) would be a waste of memory.

I do plan to rework GetOtherClients at some point, though :)

mostten commented 3 years ago

Replace playerData[MAXPLAYERS_NMRIH +1] with playerData[MAXPLAYERS+1]

The reasoning behind using MAXPLAYERS_NMRIH is that the client and server binaries are compiled with a MAXPLAYERS definition of 9. You can never surpass this limit, so using Sourcemod's MAXPLAYERS (which evaluates to 65) would be a waste of memory.

I do plan to rework GetOtherClients at some point, though :)

Its have 64 players in some servers IMG_20201222_083551

dysphie commented 3 years ago

Its have 64 players in some servers

You can hack the server's max, but clients will simply crash when a 10th player connects. A lot of the server-side logic falls apart too, stuff like respawning ceases to work completely.

mostten commented 3 years ago

Its have 64 players in some servers

You can hack the server's max, but clients will simply crash when a 10th player connects

at an early stage in player num was 8,at a later stage game turnon TV solt,it increase to 9,at least I don't worry about it for game update.

dysphie commented 3 years ago

Yeah no worries, if the game ever updates to support more clients, I'll make sure to update the code accordingly. Closing this for now