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

DHooks (Dynamic Hooks - Dev Preview)


Post New Thread Reply   
 
Thread Tools Display Modes
ShadowAN
Junior Member
Join Date: Aug 2016
Old 08-19-2016 , 09:31   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #481

Where to put the files? help pls

Last edited by ShadowAN; 08-19-2016 at 09:31.
ShadowAN is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 08-19-2016 , 09:35   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #482

Quote:
Originally Posted by ShadowAN View Post
Where to put the files? help pls
https://forums.alliedmods.net/showpo...&postcount=451
__________________
coding & free software
shanapu is offline
ShadowAN
Junior Member
Join Date: Aug 2016
Old 08-19-2016 , 11:16   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #483

Quote:
Originally Posted by shanapu View Post
I want to install this on my CS:GO server.
ShadowAN is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 08-19-2016 , 11:42   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #484

Copy->Paste
Dr!fter is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 08-21-2016 , 01:36   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #485

Found server crash:

Code:
GAMEDATA:

"Games"
{
    "csgo"
    {
        "Offsets"
        {
            "AcceptInput"
            {
                "windows"    "40"
                "linux"        "41"
            }
        }
    }
}

CODE:

#pragma semicolon 1

#include <sourcemod>
#include <dhooks>

#pragma newdecls required

Handle hAcceptInput;

public void OnPluginStart()
{
    Handle conf = LoadGameConfigFile("acceptinput.games");
    if(conf == INVALID_HANDLE) {
        SetFailState("No gamedata?");
    }

    int offset = GameConfGetOffset(conf, "AcceptInput");
    hAcceptInput = DHookCreate(offset, HookType_Entity, ReturnType_Bool, ThisPointer_CBaseEntity, AcceptInput);
    DHookAddParam(hAcceptInput, HookParamType_CharPtr);
    DHookAddParam(hAcceptInput, HookParamType_CBaseEntity);
    DHookAddParam(hAcceptInput, HookParamType_CBaseEntity);
    DHookAddParam(hAcceptInput, HookParamType_Object, 20); //varaint_t is a union of 12 (float[3]) plus two int type params 12 + 8 = 20
    DHookAddParam(hAcceptInput, HookParamType_Int);
}

public void OnEntityCreated (int entity, const char[] classname)
{
    if(StrEqual(classname, "player_weaponstrip", false))
        DHookEntity(hAcceptInput, false, entity);
}

public MRESReturn AcceptInput(int pThis, Handle hReturn, Handle hParams)
{
    return MRES_Ignored; // no matter what I put in here it crashes
}
Tested map: Pick football in mg_yolo_multigames_v1 = insta-crash.
dilalmon is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 08-21-2016 , 02:00   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #486

Quote:
Originally Posted by dilalmon View Post
Tested map: Pick football in mg_yolo_multigames_v1 = insta-crash.
Might be unrelated, but map is an old version. Here is latest version: http://gamebanana.com/maps/185938
sneaK is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 08-21-2016 , 02:10   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #487

Quote:
Originally Posted by blackhawk74 View Post
Might be unrelated, but map is an old version. Here is latest version: http://gamebanana.com/maps/185938
It happens on some other maps like awp_multigames as well.
I put some debugging messages inside the hooked function and it seems like it crashes after we return MRESReturn (let that be MRES_Ignored, etc.) from the hook.

I checked the map in hammer and noticed that there's a logic_relay that kills "aim_*" after that input.
Note that the entity hooked has a targetname of "aim_stripper".
I wonder if that has anything to do with it?
dilalmon is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 08-21-2016 , 09:10   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #488

what os? And does it work on other maps? Is it fired on those other maps?

Last edited by Dr!fter; 08-21-2016 at 09:14.
Dr!fter is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 08-21-2016 , 10:19   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #489

Quote:
Originally Posted by Dr!fter View Post
what os? And does it work on other maps? Is it fired on those other maps?
Windows. It can happen on any maps. I'll explain since I found when it exactly crashes.

When you return pretty much anything, but MRES_Supercede, the server would crash when the input is "Kill".
dilalmon is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 08-26-2016 , 21:31   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #490

Quote:
Originally Posted by dilalmon View Post
Windows. It can happen on any maps. I'll explain since I found when it exactly crashes.

When you return pretty much anything, but MRES_Supercede, the server would crash when the input is "Kill".
Ive fixed it in the latest build. There is another issue with trying to get params after an object which im looking into fixing soon.
Dr!fter 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 21:30.


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