gamemedev / plugin-sourcemod

gameME Plugin for SourceMod to manage ingame events and to extend gameME Stats!
GNU General Public License v2.0
14 stars 15 forks source link

Improve GetServerMod() Code #2

Open stickz opened 8 years ago

stickz commented 8 years ago

We don't need to keep evaluating more iterations, if the game description or game folder matches.

Also, the mod detection is missing Nuclear Dawn support for some reason.

gamemedev commented 8 years ago

Thank you fore submitting your code. The "if" conditions are as intended and we do not want to change this. Unfortunately, the "game" detection relys on the game description and directory. Both can be "misused", for example you can install csgo gameserver to a tf2 directory. Also, the game description is often changed or have any additions like "Left 4 Dead Counter-Strike Style". In this example the correct game would be "Left 4 Dead" and would match with the current "system" as "Counter-Strike" will be superseeded. This is also the reason we need to check the strings with the function "StrContains" and not "StrEqual". Within the last couple of years we do have seen really everything. While we do admit this is not the smartest way to code, at the moment, we do want to keep the code the current way as it will mostly working fine.

stickz commented 8 years ago

Nuclear Dawn requires separate mod detection because it uses different events. I think around the time things got changed various things broke. Even sourcemod has a separate binary for it now.

Win Ratios for instance disappeared around that time. http://rank.xenogamers.com/mapinfo/560