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

[ISSUE][AMXX + REGAME] get_gamerules_*


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-02-2017 , 17:52   [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #1

I don't know if this should be fixed on amxx or regame side
It seems that the get_gamerules_* natives works properly without ReGame, but when you use them with ReGame they don't return the proper values

ITerrors - value seems to equal 0 even tho i am a terrorist while i call it
iRoundTime - value some crazy long int number
iSpawnPoints - value equals the number of terrorists instead of terrorist spawn points

Also, i noticed m_flRestartRoundTime offset is missing from CHalfLifeMultiplay gamedata
https://github.com/s1lentq/ReGameDLL...ls/gamerules.h

PHP Code:
public plugin_init()
{
    
register_plugin("Plugin Test""1.0""Depresie")

    
register_clcmd("say test1""clcmdtest1")
}


public 
clcmdtest1(iPlayer)
{
    new 
iRoundTerminating get_gamerules_int("CHalfLifeMultiplay""m_bRoundTerminating")
    new 
iTerrors get_gamerules_int("CHalfLifeMultiplay""m_iNumTerrorist")
    new 
iRoundTime get_gamerules_int("CHalfLifeMultiplay""m_iRoundTime")
    new 
iSpawnPoints get_gamerules_int("CHalfLifeMultiplay""m_iSpawnPointCount_Terrorist")


    
client_print(0print_chat"Round Time -> %i"iRoundTime)
    
client_print(0print_chat"Terrorists -> %i"iTerrors)
    
client_print(0print_chat"Spawn Points -> %i"iSpawnPoints)


__________________

Last edited by Depresie; 12-02-2017 at 20:39.
Depresie is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 12-03-2017 , 12:00   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #2

AFAK get_gamerules relies on specific memory adresses, and unfortunately ReGameDLL obviosuly have different adresses. And AFAIK ReGameDLL has it's own natives to access the gamerules members.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-03-2017 , 12:49   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #3

Quote:
Also, i noticed m_flRestartRoundTime offset is missing from CHalfLifeMultiplay gamedata
https://github.com/s1lentq/ReGameDLL...ls/gamerules.h
Read the comment next to member's definition:
Code:
// The global time when the round is supposed to end, if this is not 0 (deprecated name m_fTeamCount)

Last edited by klippy; 12-03-2017 at 12:49.
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-03-2017 , 13:04   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #4

So basically the offsets related to game rules are different in ReGame ? the ones related to CBasePlayer are the same tho

Well, i guess i will switch out from ReGame until it is fully compatible with amxmodx
__________________
Depresie is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-03-2017 , 13:32   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #5

It should work, there's support for ReGameDLL and AMXX does get the address of the gamerules object. When you use those gamerules natives, if they don't throw any runtime error then the gamerules object was successfully found.
Offsets may be different though.

Last edited by klippy; 12-03-2017 at 13:33.
klippy is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-03-2017 , 15:38   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #6

^ this and if you're using ReGameDLL, you should probably use ReAPI module instead, there is less chance you face a wrong offset since it has been designed to work directly with ReGameDLL. In AMXX, the compatibility is just about getting the gamerules object. The offsets that you have in your gamedata/ dir are from a dump of the original CS version.
__________________
Arkshine is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-03-2017 , 17:10   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #7

I'd rather rely mainly on amxx than on regame, amxx is mandatory for a server while regame is not, so in case things get screwed and i have to use the stock dll, i don't have to rewrite everything..
__________________
Depresie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-03-2017 , 17:37   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #8

As said Klippy, it should work. It doesn't matter if the name has changed as long the position (offset) is the same. Check with and without ReGameDLL in the same context, or try to use ReAPI just to see if you get the same value.
__________________
Arkshine is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 12-03-2017 , 20:35   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #9

Unfortunately, ReGameDLL has 2 custom fields in CGameRules. So looks like all fields of CHalfLifeMultiplay are shifted by 8 bytes.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-03-2017 , 22:22   Re: [ISSUE][AMXX + REGAME] get_gamerules_*
Reply With Quote #10

I specified that i tried with and without regame
Without regame the values that were returned are correct
With regame the values that were returned were incorrect

As Prostostem@ said, the get_gamerules_* natives are incompatible with regame, since the offsets were shifted by 8 bytes..
__________________
Depresie 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 04:17.


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