Raised This Month: $32 Target: $400
 8% 

CS:GO client-side coding question to get game stats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadim
Junior Member
Join Date: Jan 2015
Old 01-28-2015 , 05:00   CS:GO client-side coding question to get game stats
Reply With Quote #1

Hi everyone,

I need to modify CS:GO in order to intercept some game related events (like bomb is planted and ticking, player of either team dies and etc). I don't need to change the behavior, so we can assume that logging information to the file would be enough for my needs.

I have some c++ experience and I have absolutely no HL or Source Engine experience. So I was very confused with all those tools available in Steam (Source SDK, Source SDK Base 2006/2007, Source SDK Base 2013 Singleplayer/Multiplayer/Dedicated Server) and then also source code named source-sdk-2013 on github (https://github.com/ValveSoftware/source-sdk-2013) and then hl2sdk-sdk2013 and hl2sdk-csgo (https://github.com/alliedmodders/hl2sdk/tree/csgo) from alliedmodders and then MetaMode:Source source codes (https://github.com/alliedmodders/metamod-source). So it looks like there is a lot of programmability options however I don't see how they all are connected and if any of them fit my needs.

Also it looks like CS:GO is not as "open" as other games (https://developer.valvesoftware.com/...The_Source_SDK) so I guess it's not open-source and I can't build original CS:GO client.dll by myself, correct me if I'm wrong.



So far I was able to compile and install Metamod:Source plugin. And then modify, compile and launch sample_mm metamod-plugin (https://github.com/alliedmodders/met...ster/sample_mm).

There I was able to intercept some of events using IGameEventManager2, but I catch all the events (when running CS:GO locally with bots), while I need only those that are related to my player. Also I was not able to find where I get information on, for example, which players are still alive and which are dead.


So my question would be:
1. Is this the right forum to ask such kind of questions?
2. Are there any tutorials or samples available for what I try to achieve (google helped, but I'm too confused with number of approaches)
3. I wonder if metamod-plugin IGameEventManager2 information that I get is in scope of client or server. It looks like it's server information, but I can't check because I can have only one instance running. If that is true then how do I access similar information on client (I understand that maybe not all information is available to the client application - that is OK).

Thank you!
kadim is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-28-2015 , 07:38   Re: CS:GO client-side coding question to get game stats
Reply With Quote #2

Quote:
Originally Posted by kadim View Post
1. Is this the right forum to ask such kind of questions?
No. We don't support clientside plugins here due to the number one use for them being cheats. While that doesn't seem to be your goal, you still won't get help here with it.

Additionally, we don't keep any of the client-specific headers up to date in our reversed SDK for the same reason, and because we don't use/need them.
psychonic is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-28-2015 , 08:24   Re: CS:GO client-side coding question to get game stats
Reply With Quote #3

Quote:
Originally Posted by psychonic View Post
No. We don't support clientside plugins here due to the number one use for them being cheats. While that doesn't seem to be your goal, you still won't get help here with it.

Additionally, we don't keep any of the client-specific headers up to date in our reversed SDK for the same reason, and because we don't use/need them.
Is there a reason why client only headers are included?
__________________
WildCard65 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-28-2015 , 10:17   Re: CS:GO client-side coding question to get game stats
Reply With Quote #4

Quote:
Originally Posted by WildCard65 View Post
Is there a reason why client only headers are included?
Valve included them with the SDKS that ours are based off of. It's not worth the effort to remove them.
psychonic is offline
kadim
Junior Member
Join Date: Jan 2015
Old 01-28-2015 , 10:37   Re: CS:GO client-side coding question to get game stats
Reply With Quote #5

Quote:
Originally Posted by psychonic View Post
No. We don't support clientside plugins here due to the number one use for them being cheats. While that doesn't seem to be your goal, you still won't get help here with it.

Additionally, we don't keep any of the client-specific headers up to date in our reversed SDK for the same reason, and because we don't use/need them.


Thank you, then I'll keep digging on client plugins even though they are hardly documented and building a server metamod-plugin that would send information to every client (I'll need to know how to connect user-names to userIds to entities, but at least it's doable)
kadim is offline
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 01-28-2015 , 17:08   Re: CS:GO client-side coding question to get game stats
Reply With Quote #6

Don't know if this is useful to you but I think the demo files have event data(svc_GameEvent?). There are some Dota2 demo parsers so it shouldn't be too different to do something similar for CSGO.

Last edited by donrevan; 01-28-2015 at 17:08.
donrevan is offline
kadim
Junior Member
Join Date: Jan 2015
Old 01-28-2015 , 22:04   Re: CS:GO client-side coding question to get game stats
Reply With Quote #7

Quote:
Originally Posted by donrevan View Post
Don't know if this is useful to you but I think the demo files have event data(svc_GameEvent?). There are some Dota2 demo parsers so it shouldn't be too different to do something similar for CSGO.

Yeah, there is event information in demo files (it took me quite a while to understand that demo files are game demos with *.dem extension). And there is demo player for Source games https://code.google.com/p/coldemoplayer/ (it does not support CS:GO though). But that is only for recorded games. What I need is real-time processing.


To me it is very strange that having all the programmability options on server side there is no open interfaces on the client side. Valve could have restricted events so that they cannot be used for cheating.... But anyway, thanks to everyone who tried to help.
kadim is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-28-2015 , 22:19   Re: CS:GO client-side coding question to get game stats
Reply With Quote #8

Quote:
Originally Posted by kadim View Post
Yeah, there is event information in demo files (it took me quite a while to understand that demo files are game demos with *.dem extension). And there is demo player for Source games https://code.google.com/p/coldemoplayer/ (it does not support CS:GO though). But that is only for recorded games. What I need is real-time processing.


To me it is very strange that having all the programmability options on server side there is no open interfaces on the client side. Valve could have restricted events so that they cannot be used for cheating.... But anyway, thanks to everyone who tried to help.
Actually, it does support CSGO: https://github.com/jpcy/coldemoplayer/commits/master
__________________
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-28-2015 , 23:33   Re: CS:GO client-side coding question to get game stats
Reply With Quote #9

Quote:
Originally Posted by kadim View Post
To me it is very strange that having all the programmability options on server side there is no open interfaces on the client side.
It's all reverse-engineered, the Valve-provided API is tiny and mostly useless (even for the engines where they provided headers).
__________________
asherkin is offline
kadim
Junior Member
Join Date: Jan 2015
Old 01-29-2015 , 00:57   Re: CS:GO client-side coding question to get game stats
Reply With Quote #10

Quote:
Originally Posted by WildCard65 View Post


Thanks, I've been looking at the older version. Anyway this is demo player, it has nothing to do with real-time event processing. So there is some information in it regarding event subsystem, but I can't use it.



Anyway it appeared that if I start a dedidacated CS:GO server (with -insecure flag) and connect to it using client with my metamod-plugin I still do recieve all the events using IGameEventManager2. And this setup is enough for me (so basically all the clients will get information about all the events. Everything is insecure, which is fine for me).

The only thing left to do for me is to identify on the client which of events are related to the user that is playing, since I receive not only user-relevant events, but all server events.

Last edited by kadim; 01-29-2015 at 00:58.
kadim is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode