Drek282 / PsychoStats

This is an update to Stormtrooper's PsychoStats to fix obsolete and deprecated code as well as fix as many issues as possible and add support for games that interest me.
GNU General Public License v3.0
24 stars 10 forks source link

Have headshot% accuracy and shots per kill round to the nearest single digit. #50

Open Drek282 opened 3 years ago

huobage commented 1 year ago

@Drek282 My mod is cstrike stats.pl has been run normally Unable to calculate headshot rate and number of headshots. What is the reason? All files are up to date!

Drek282 commented 1 year ago

You have to run a game server side mod that adds hit location and damage stats to the logs, such as AMX Mod X:

https://www.amxmodx.org/

Specifically you need the Counter Strike addons.

huobage commented 1 year ago

@Drek282 The stats plugin is turned on, and there are no headshots in hlds/cstrike/logs. server.cfg is enabled log on mp_logfile 1 mp_logdetail 3

Is there any specific setting parameters?

Drek282 commented 1 year ago

Ok, in server.cfg:

Add to the end of that file: exec autoexec.cfg

Create a text file called autoexec.cfg, put that in your cstrike folder, the root mod folder, the same folder that contains server.cfg.

That file, the autoexec.cfg file, should contain the line: log on

In cstrike/addons/amxmodx/configs/plugins.ini you need the following lines:

stats.amxx stats_logging.amxx

The other question I have is, are you seeing damage statistics and accuracy stats on the player pages? Are you using the default or cc_default theme? Have you enabled the "mod_hld" or "mod_hldff" plugins? If you have enabled those, those need to be disabled.

huobage commented 1 year ago

@Drek282 The theme defaults, and the plugins are not enabled. I have set according to what you said, but the log still cannot record headshot records AMXX1.8.2 AMXX1.9.5273 have been tested ; Counter-Strike ;restmenu.amxx ;restrict weapons menu statsx.amxx ; stats on death or round end (CSX Module required!) ;miscstats.amxx ; bunch of events announcement for Counter-Strike stats_logging.amxx ; weapons stats logging (CSX Module required!)

server.cfg only keeps exec autoexec.cfg autoexec.cfg set log on The above settings log can never get the headshot log

Drek282 commented 1 year ago

Are you seeing damage statistics and accuracy in the stats? Go to a player page and look at the kill profile on the left. If you can screenshot it, even better.

huobage commented 1 year ago

@Drek282 343

Drek282 commented 1 year ago

Something is wrong with the way you have AMXX installed and configured. Either that or you haven't generated any stats since you installed it. You aren't getting any damage, accuracy or headshot stats.

Your first step should be to make sure AMXX is actually loading and the stats plugins are actually loading. I believe entering "meta list" into the console will tell you whether or not metamod is loading properly and whether or not AMXX is loading properly. It's been a while since I've hosted a server.

Your first server log after you start your server should look something like this:

L 06/16/2021 - 18:10:36: Log file started (file "logs/L0616000.log") (game "cstrike") (version "48/1.1.2.7/Stdio/8684") L 06/16/2021 - 18:10:36: [META] Metamod v1.21p-APG 2020/03/30 L 06/16/2021 - 18:10:36: [META] by Will Day L 06/16/2021 - 18:10:36: [META] http://www.metamod.org/ L 06/16/2021 - 18:10:36: [META] Patch: Metamod-P (mm-p) v39 L 06/16/2021 - 18:10:36: [META] by Jussi Kivilinna & RoboCop L 06/16/2021 - 18:10:36: [META] https://apg-clan.org/ L 06/16/2021 - 18:10:36: [META] compiled: Sep 21 2020, 13:21:19 GMT (optimized) L 06/16/2021 - 18:10:36: Server cvar "metamod_version" = "1.21p39" L 06/16/2021 - 18:10:36: [META] Autodetected game 'cstrike'; using dllfile 'cs.so' L 06/16/2021 - 18:10:36: [META] Game DLL for 'cs.so (autodetect)' loaded successfully L 06/16/2021 - 18:10:36: [META] ini: Begin reading plugins list: /home/drek/.local/share/Steam/steamcmd/hlds/cstrike/addons/metamod/plugins.ini L 06/16/2021 - 18:10:36: [META] ini: Read plugin config for: L 06/16/2021 - 18:10:36: [META] ini: Read plugin config for: L 06/16/2021 - 18:10:36: [META] ini: Finished reading plugins list: /home/drek/.local/share/Steam/steamcmd/hlds/cstrike/addons/metamod/plugins.ini; Found 2 plugins to load L 06/16/2021 - 18:10:36: [META] dll: Loading plugins... L 06/16/2021 - 18:10:36: [PODBOTMM] POD-Bot mm: plugin attaching L 06/16/2021 - 18:10:36: Server cvar "pb_version" = "V3B21" L 06/16/2021 - 18:10:36: [META] dll: Loaded plugin 'POD-Bot mm': POD-Bot mm vV3B21 Jun 13 2010, Count Floyd & Bots United L 06/16/2021 - 18:10:36: [META] dll: Loaded plugin 'Fun': Fun v1.8.2 Feb 14 2013, AMX Mod X Dev Team L 06/16/2021 - 18:10:36: [META] dll: Loaded plugin 'CStrike': CStrike v1.8.2 Feb 14 2013, AMX Mod X Dev Team L 06/16/2021 - 18:10:36: [META] dll: Loaded plugin 'CSX': CSX v1.8.2 Feb 14 2013, AMX Mod X Dev Team L 06/16/2021 - 18:10:36: [META] dll: Loaded plugin 'AMX Mod X': AMX Mod X v1.8.2 Feb 14 2013, AMX Mod X Dev Team L 06/16/2021 - 18:10:36: [META] WARNING: dll: Not loading plugin 'Fun'; already loaded (status=running) L 06/16/2021 - 18:10:36: [META] WARNING: dll: Failed to load plugin 'fun_amxx_i386.so' L 06/16/2021 - 18:10:36: [META] WARNING: dll: Not loading plugin 'CStrike'; already loaded (status=running) L 06/16/2021 - 18:10:36: [META] WARNING: dll: Failed to load plugin 'cstrike_amxx_i386.so' L 06/16/2021 - 18:10:36: [META] WARNING: dll: Not loading plugin 'CSX'; already loaded (status=running) L 06/16/2021 - 18:10:36: [META] WARNING: dll: Failed to load plugin 'csx_amxx_i386.so' L 06/16/2021 - 18:10:36: [META] dll: Finished loading 2 plugins L 06/16/2021 - 18:10:36: Log file closed

You should google "troubleshoot amxmodx plugins", or something of that nature.

huobage commented 1 year ago

Both hlds windows and liunx have been tested, but there is still no way to get it Already searched and tried to solve it to no avail I don't see where there is a problem with the configuration. I have a basic plug-in configuration foundation and should not make this mistake.

L 06/04/2023 - 00:11:05: Log file started (file "logs\L0604000.log") (game "cstrike") (version "48/1.1.2.7/8308") L 06/04/2023 - 00:11:05: [META] Metamod v1.21p37 2013/05/30 L 06/04/2023 - 00:11:05: [META] by Will Day L 06/04/2023 - 00:11:05: [META] http://www.metamod.org/ L 06/04/2023 - 00:11:05: [META] Patch: Metamod-P (mm-p) v37 L 06/04/2023 - 00:11:05: [META] by Jussi Kivilinna L 06/04/2023 - 00:11:05: [META] http://metamod-p.sourceforge.net/ L 06/04/2023 - 00:11:05: [META] compiled: May 30 2013, 11:41:14 EET (optimized) L 06/04/2023 - 00:11:05: [META] Recognized game 'cstrike'; using dllfile 'mp.dll' L 06/04/2023 - 00:11:05: [META] Game DLL for 'Counter-Strike' loaded successfully L 06/04/2023 - 00:11:05: [META] ini: Begin reading plugins list: e:/server/服务器/服务端/windows/8308/cstrike/addons/metamod/plugins.ini L 06/04/2023 - 00:11:05: [META] ini: Read plugin config for: L 06/04/2023 - 00:11:05: [META] ini: Read plugin config for: L 06/04/2023 - 00:11:05: [META] ini: Read plugin config for: L 06/04/2023 - 00:11:05: [META] ini: Read plugin config for: L 06/04/2023 - 00:11:05: [META] ini: Read plugin config for: L 06/04/2023 - 00:11:05: [META] ini: Read plugin config for: L 06/04/2023 - 00:11:05: [META] ini: Finished reading plugins list: e:/server/服务器/服务端/windows/8308/cstrike/addons/metamod/plugins.ini; Found 6 plugins to load L 06/04/2023 - 00:11:05: [META] dll: Loading plugins... L 06/04/2023 - 00:11:05: [META] dll: Loaded plugin 'AMX Mod X': AMX Mod X v1.9.0.5263 Oct 27 2019, AMX Mod X Dev Team L 06/04/2023 - 00:11:05: [DPROTO]: Loading config './dproto.cfg' L 06/04/2023 - 00:11:05: [DPROTO]: LoggingMode = 2 L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for HLTV: HLTV L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for No-steam p47 clients: STEAM_ID_LAN L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for No-steam p48 clients: VALVE_ID_LAN L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for steam clients: Real STEAM_x:x:x L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for steam unauthorized clients: STEAM_ID_PENDING L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for RevEmu clients: Real STEAM_x:x:x L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for Old RevEmu clients: Real STEAM_x:x:x L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for SteamEmu clients: Real STEAM_x:x:x L 06/04/2023 - 00:11:05: [DPROTO]: AuthID for SETTI server scanner: STEAM id generated by ip L 06/04/2023 - 00:11:05: [DPROTO]: P47 emulator SteamEmuCompatMode: ON L 06/04/2023 - 00:11:05: [DPROTO]: Disable fix for steamids generated by eST in 0.3.1 version: No L 06/04/2023 - 00:11:05: [DPROTO]: First prefix of authids generated by ip: 0 L 06/04/2023 - 00:11:05: [DPROTO]: Second prefix of authids generated by ip: 4 L 06/04/2023 - 00:11:05: [DPROTO]: Disable Native Auth (Steam/Valve): OFF L 06/04/2023 - 00:11:05: [DPROTO]: ServerInfo answer type: Hybrid (Old first) L 06/04/2023 - 00:11:05: [DPROTO]: Setting game name to: (Native game name) L 06/04/2023 - 00:11:05: [DPROTO]: Enable Fix for player ids on hlstats monitoring: OFF L 06/04/2023 - 00:11:05: [DPROTO]: dp_version cvar will be exported: Yes L 06/04/2023 - 00:11:05: [DPROTO]: Config sucessfully loaded. L 06/04/2023 - 00:11:05: [DPROTO]: Server port: 27018 L 06/04/2023 - 00:11:05: [DPROTO]: Found swds.dll at 02BC0000 L 06/04/2023 - 00:11:05: [DPROTO]: Patching for: ... L 06/04/2023 - 00:11:05: [DPROTO]: Done. L 06/04/2023 - 00:11:05: [META] dll: Loaded plugin 'dproto_EF': dproto_EF v0.9.543 2015-04-12, Crock L 06/04/2023 - 00:11:05: [META] dll: Loaded plugin 'MasterServer': MasterServer v1.0 Sep 10 2013, 201724 L 06/04/2023 - 00:11:05: [META] dll: Loaded plugin 'VoiceTranscoder': VoiceTranscoder v2017RC4 2019.11.02, WPMG.PRoSToC0der L 06/04/2023 - 00:11:05: [MMTIMER]: ParseEngine_Win: WARNING: Unable to locate 1000FPS limitation code L 06/04/2023 - 00:11:05: [META] dll: Loaded plugin 'mmtimer': mmtimer v1.6 2010/03/25, Crock L 06/04/2023 - 00:11:05: [META] dll: Loaded plugin 'YaPB': YaPB v4.0.0 Aug 22 2020, YaPB Development Team L 06/04/2023 - 00:11:05: [META] dll: Finished loading 6 plugins L 06/04/2023 - 00:11:05: Log file closed

Drek282 commented 1 year ago

One possibility is that you are running a hacked non-Steam version of CS. If that's the case, you're on your own. I have no experience or knowledge of what's involved to get those working properly, or what plugins are available or what needs to be done to get them working properly.

Drek282 commented 1 year ago

Right, I see from your log that you are running "No-steam". I can't help you. This isn't a problem with PS and I have no experience with hosting "No-steam" servers.

huobage commented 1 year ago

@Drek282 I will find a way to solve the above problems, and ask a PS question I have tried to modify the language file and build ch_CN.php How to solve the error when running pslang.pl?

Base directory: . Theme directory: themes/default/ Base language: en_US

Theme directory does not exist! Use -dir to specify the base directory where the PsychoStats PHP front-end is located.

Drek282 commented 1 year ago

I've never actually used that script. But I'm guessing "pslang.pl -dir [full path to your root PS web folder]" So I'm guessing that script won't work if you aren't hosting your stats and running your stats script on the same machine.

As far as your "No-steam" server questions. It isn't just a matter of me being anal about this. I don't have much of a philosophical problem with anyone hosting an ancient Valve game outside of the Steam ecosystem. But if anyone officially connected with this repo starts offering support for what is essentially an IP and copyright infringement, I am certain that is a violation of the GitHub ToS and could even, potentially, lead to legal problems.

huobage commented 1 year ago

The above hlds server is just a test environment for research, and the ancient games are just hobbies, thank you for still paying! Can you provide source files with headshot logging? I'll check it out.

Drek282 commented 1 year ago

I don't know what you mean by "Can you provide source files with headshot logging?"

This is what the logging looks like in your game server logs:

L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats" (weapon "grenade") (shots "1") (hits "0") (kills "0") (headshots "0") (tks "0") (damage "0") (deaths "1") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats2" (weapon "grenade") (head "0") (chest "0") (stomach "0") (leftarm "0") (rightarm "0") (leftleg "0") (rightleg "0") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats" (weapon "xm1014") (shots "2") (hits "2") (kills "0") (headshots "0") (tks "0") (damage "52") (deaths "1") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats2" (weapon "xm1014") (head "1") (chest "0") (stomach "0") (leftarm "1") (rightarm "0") (leftleg "0") (rightleg "0") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats" (weapon "aug") (shots "177") (hits "28") (kills "7") (headshots "2") (tks "0") (damage "783") (deaths "1") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats2" (weapon "aug") (head "2") (chest "1") (stomach "2") (leftarm "12") (rightarm "3") (leftleg "2") (rightleg "6") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats" (weapon "famas") (shots "84") (hits "23") (kills "5") (headshots "2") (tks "0") (damage "524") (deaths "0") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats2" (weapon "famas") (head "2") (chest "3") (stomach "2") (leftarm "10") (rightarm "2") (leftleg "1") (rightleg "3") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats" (weapon "deagle") (shots "14") (hits "2") (kills "2") (headshots "1") (tks "0") (damage "221") (deaths "0") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats2" (weapon "deagle") (head "1") (chest "0") (stomach "0") (leftarm "0") (rightarm "0") (leftleg "0") (rightleg "1") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats" (weapon "ak47") (shots "34") (hits "10") (kills "3") (headshots "0") (tks "0") (damage "254") (deaths "0") L 06/16/2021 - 18:30:21: "[PD]Tommy_Lee_Jones (77)<1>" triggered "weaponstats2" (weapon "ak47") (head "0") (chest "0") (stomach "2") (leftarm "5") (rightarm "0") (leftleg "2") (rightleg "1")

AMXX is open source and the source code is available from the AMXX site. Obviously this repo is also open source.

huobage commented 1 year ago

Yes, this is the log with detailed attack data! I'm doing my own research, and it should be that cstrike's plug-in fails to work.

Drek282 commented 1 year ago

This issue should not have been closed. Will play closer attention to where "stuff" is posted in future.

Drek282 commented 1 year ago

@huobage I'm told that your problem likely has to do with the order your plugins are loaded in. Plugin order matters both in the metamod/plugins.ini and in amxmodx/configs/plugins.ini

In my metamod/plugins.ini the bot plugin needed to load first. In amxxmodx plugins.ini you can try messing around with the plugin order, but it's probably smart to keep them in the default order and load your 3rd party plugins last. If something doesn't work, try changing the order.

My rule of thumb for the amxmodx plugins order was to load the most complex, core functionality plugins first. So I had a plugin that added AdminMod style commands load first in the 3rd party plugin section, but I did have deagsmapmanager loading second to last.

Rosenstein commented 1 year ago

And without example log, nothing can be done

Drek282 commented 1 year ago

Some plugins also simply either don't work well, or don't work well with other plugins. I would suggest that you start with the basics, and add plugins one at a time. You may have to drop certain plugins or reorder them. I would suggest that you start with the plugins you consider to be the most important.

It's been a while since I set up a server, but I had to go through this process every time I did, and I have set up a lot of servers...

huobage commented 1 year ago

@Drek282 The lack of headshot logs may be due to the BUG of the robot program, just replace it There is a new problem at present. If the background log synchronization source is not the local machine, multiple hlds folders cannot be synchronized using FTP and SFTP. Whether the log path can search for all files in the root directory. For example hlds1:/cs/hlds1/cstrike/logs hlds2:/cs/hlds2/cstrike/logs Just enter /cs/. in the log path to complete the subdirectory search? The inability of SFTP to connect to multiple log sources should be a limitation of peri-Net::SFTP. WARNING] Error connecting to SFTP server: Net::SSH: Can't bind socket to port 1023: Address already in use at /usr/local/share/perl5/Net/SFTP.pm line 62.

Rosenstein commented 1 year ago

If I understand you correctly, you want to use one Psychostats install for multiple HLDS servers?

Psychostats was always designed to be used for one instance of HLDS server with one gameplay mod.

Supporting multimod servers or multiple HLDS instances is out of scope.

Please setup separate Psychostats instance for every server you plan to use.

huobage commented 1 year ago

https://www.dt-club.net/thread-73209-1-1.html I hope the PS statistics plugin can count multiple HLDS in multiple modes like it does. I don't have the technical ability to change the PS, please refer to it.

Drek282 commented 1 year ago

@huobage I think we're getting into language problems here. @Rosenstein is correct. PS handles logs sequentially, attempting to parse logs from multiple sources will break that. If you want to have stats for multiple servers you will have to install a separate PS instance for each server.

"The lack of headshot logs may be due to the BUG of the robot program, just replace it"

I don't know what you mean by that. I'm guessing your bot plugin caused the conflict with AMXX and you replaced it?

huobage commented 1 year ago

@Drek282 Yes, replaced the BOT plugin. This is how PS statistics are currently used. Looking forward to future updates to make it even better!

Rosenstein commented 1 year ago

https://www.dt-club.net/thread-73209-1-1.html I hope the PS statistics plugin can count multiple HLDS in multiple modes like it does. I don't have the technical ability to change the PS, please refer to it.

This is different statistics software that you have linked.

huobage commented 1 year ago

@Drek282 Would it be a hassle to make such a change for PsychoStats to support multiple HLDS and multiple game modes? Do you have any plans for this in the future?

Drek282 commented 1 year ago

Yes, it would be a huge change, and no, there are no plans to do this in future. PS is on mothballs and even when it wasn't, my work on it was never about adding functionality, it was only about getting what was there working well.