Raised This Month: $51 Target: $400
 12% 

[solved] SMAC, The Hidden:Source & OnPlayerRunCmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-28-2012 , 18:18   [solved] SMAC, The Hidden:Source & OnPlayerRunCmd
Reply With Quote #1

http://forum.hidden-source.com/showthread.php?11350

We're trying to get SMAC running properly with The Hidden:Source mod but there seems to be an issue where OnPlayerRunCmd does not fire under any circumstances.

This causes the anti-wallhack module to be non functional unless i put...
PHP Code:
    if (g_Game == Game_HIDDEN)    // OnPlayerRunCmd not registered with The Hidden:Source
        
for (new client 1client <= MaxClientsclient++)    // cycle through all players
            
if (IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)    // Only match IRIS player angle
                
GetClientEyeAngles(clientg_vEyeAngles[client]);    // update eye angles 
...in the OnGameFrame function, which is all well and good but it's not idea.

On further investigation it seems that most of the modules seem to rely on OnPlayerRunCmd.

I can't find any offsets for it so am guessing it hooks in some other way? This mod currently runs on the Source SDK Base 2006... so yeah, there's that as well.
Attached Files
File Type: txt ths_offsets.txt (17.8 KB, 271 views)
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 10-30-2012 at 17:15. Reason: resolved
paegus is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-28-2012 , 18:55   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #2

Looks like the gamedata is missing the necessary offsets (bug 1). It probably should have thrown an error when attempting to hook the function in the first place (bug 2). I'll file those later if no one gets around to it.

Try adding these offsets to gamedata / sdktools.games / game.hidden.txt:
Code:
"PlayerRunCmd"
{
	"windows"	"364"
	"linux"		"365"
}
__________________

Last edited by GoD-Tony; 10-28-2012 at 18:56.
GoD-Tony is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-28-2012 , 19:54   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #3

Damn, was ctrl-f-ing the wrong word... I'll give that a go. Cheers.

e: that does seem to do the trick, though it seems to be firing every frame anyway?

Not sure about the error messages. One of us found a dev snapshot of sdkhooks (http://forums.alliedmods.net/showpos...postcount=1687) and added
PHP Code:
            "EntityListeners"
            
{
                
"windows"    "65572"
                "linux"        "65572"
                "mac"        "65572"
            

to both the sdkhooks & sdktools/game.hidden.txt file to get it to load properly.

This is the only version where it doesn't crash the windows server on startup when the anti-wallhack plugin is first loaded or if the plugin is loaded after the server spawn, it crashes when the round starts. No error messages I'm afraid.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 10-28-2012 at 21:06.
paegus is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-29-2012 , 04:41   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #4

Quote:
Originally Posted by paegus View Post
e: that does seem to do the trick, though it seems to be firing every frame anyway?
It fires every time a client sends a command to the server, which is usually every frame.

Quote:
Originally Posted by paegus View Post
This is the only version where it doesn't crash the windows server on startup when the anti-wallhack plugin is first loaded or if the plugin is loaded after the server spawn, it crashes when the round starts. No error messages I'm afraid.
The stable version of SDK Hooks is crashing when UpdateOnRemove is hooked (stack). I'm not sure why since the gamedata looks correct. I'll ask psychonic about this one and then I'll look into the round-start crash.
__________________

Last edited by GoD-Tony; 10-29-2012 at 06:37.
GoD-Tony is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-29-2012 , 04:50   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #5

Fair enough with the OnPlayerRunCmd firing that often. It's still less intensive than OnGameFrame if only by a small margin.

Would be great to get it sorted out, thanks.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-29-2012 , 15:16   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #6

It seems like the startup crash is caused by a changeset in the new MM:S versions. Try MM:S 1.8.7 with SDK Hooks 2.1.
__________________

Last edited by GoD-Tony; 10-29-2012 at 15:17.
GoD-Tony is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-29-2012 , 15:44   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #7

I'll give that a go.

Though we've now run into another issue with the anti-wallhack plugin. There seem to be some concrete world models that are blocking views.

The client should be in plain view in certain areas but isn't: http://www.youtube.com/watch?v=IT-s-XTBmbw

Presumably this would occur on other games that use said models.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-29-2012 , 16:00   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #8

Quote:
Originally Posted by paegus View Post
The client should be in plain view in certain areas but isn't: http://www.youtube.com/watch?v=IT-s-XTBmbw

Presumably this would occur on other games that use said models.
From the video it looks similar to a problem that TF2 used to have. If you'd like to give it a try, edit this line to force Hidden to use the WorldOnly filter similar to TF2.

I'll have to install the client later and see for myself, thanks!
__________________

Last edited by GoD-Tony; 10-29-2012 at 16:01.
GoD-Tony is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-29-2012 , 18:03   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #9

Using the posted versions of mm:s and sdkhooks almost works out of box with only the addition of the PlayerRunCmd offsets. The EntityListeners stuff mentioned above is no longer required using those versions.

Editing IsPointVisible() to
PHP Code:
if (g_Game == Game_TF2 || g_Game == Game_HIDDEN
has fixed the phantom occlusion issue.

Additionally we've changed this line to be
PHP Code:
g_bIgnore[client] = g_bIsFake[client] || ((g_Game == Game_L4D || g_Game == Game_L4D2 || g_Game == Game_HIDDEN) && g_iTeam[client] != 2); 
so that the hidden player isn't prevented from viewing aura.

Thanks a lot for all the help with this. Great to get it all working properly.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 10-29-2012 at 18:10.
paegus is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-30-2012 , 04:09   Re: (SMAC+The Hidden:Source)/OnPlayerRunCmd=False
Reply With Quote #10

Quote:
Originally Posted by paegus View Post
Editing IsPointVisible() ... has fixed the phantom occlusion issue.

Additionally we've changed ... so that the hidden player isn't prevented from viewing aura.
Perfect, thanks for testing! These changes will make it into the next release of SMAC.
__________________
GoD-Tony is offline
Reply



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 03:04.


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