SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 21/01/2019, 03:40 PM   #11
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

That's really weird, I just tested it on both linux & windows, vehicles created with both CreateVehicle and AddStaticVehicle worked fine.
The current value shown (0.0) is not valid, and it appears like the plugin couldn't initialize properly and didn't call
Code:
HandlingDefault::Initialize()
Check your logs, are there any errors? The plugin needs to hook a few things in the server in order to work properly, it's possible that other plugins like YSF or SampAC are affecting this. Although I just checked with YSF and there's no problem with loading it either before or after chandlingsvr.
What's your plugins line in server.cfg? Are you running the server on linux or windows? What version of the server are you running? Are other vehicles, or attributes in the same vehicle working fine?

This definitely looks like some initialization problem.

Edit: however if IsPlayerUsingCHandling() returns true, then the RakNet hook must be working, so that'd mean the initialization was successful, which makes it even more weird.
dotSILENT is offline   Reply With Quote
Old 21/01/2019, 05:32 PM   #12
Nathan94
Little Clucker
 
Join Date: Mar 2015
Posts: 12
Reputation: 0
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Quote:
Originally Posted by dotSILENT View Post
That's really weird, I just tested it on both linux & windows, vehicles created with both CreateVehicle and AddStaticVehicle worked fine.
The current value shown (0.0) is not valid, and it appears like the plugin couldn't initialize properly and didn't call
Code:
HandlingDefault::Initialize()
Check your logs, are there any errors? The plugin needs to hook a few things in the server in order to work properly, it's possible that other plugins like YSF or SampAC are affecting this. Although I just checked with YSF and there's no problem with loading it either before or after chandlingsvr.
What's your plugins line in server.cfg? Are you running the server on linux or windows? What version of the server are you running? Are other vehicles, or attributes in the same vehicle working fine?

This definitely looks like some initialization problem.

Edit: however if IsPlayerUsingCHandling() returns true, then the RakNet hook must be working, so that'd mean the initialization was successful, which makes it even more weird.
Yes IsPlayerUsingCHandling() does return true. I tried other vehicles (tried only cars) and none is working, I tried all attributes - all giving the same error.

Running it on windows with only these plugins: "sscanf streamer sampp_server chandlingsvr".

About errors - definitely no erros. The logs are as following:
Code:
[17:38:21]   Loaded.
[17:38:21]  Loading plugin: sampp_server
[17:38:21] [SA-MP+] Loaded
[17:38:21]   Loaded.
[17:38:21]  Loading plugin: chandlingsvr
[17:38:23] [###] CHandlingSvr v1.0-dev by .silent loaded [###]
[17:38:23]   Loaded.
[17:38:23]  Loaded 4 plugins.
Edit
Perhaps it's the sampp plugin and its asi? Will try and then will update the post.
Nathan94 is offline   Reply With Quote
Old 21/01/2019, 06:55 PM   #13
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

It's very likely, however afaik it's not hooking the server's raknet but creating it's own instance so I don't know what would be the problem. Is it even being updated? I think it's outdated for a few years already unless someone updated it. I'm running crashdetect, YSF, sscanf, mysql, streamer and pawncmd together with this plugin without any problems.

The hooking procedure starts when the gamemode is being loaded, thats where errors should be thrown (if any)
You can send me the dll for that sampp plugin @ pm if you want me to check it out.
dotSILENT is offline   Reply With Quote
Old 21/01/2019, 08:36 PM   #14
Nathan94
Little Clucker
 
Join Date: Mar 2015
Posts: 12
Reputation: 0
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Quote:
Originally Posted by dotSILENT View Post
It's very likely, however afaik it's not hooking the server's raknet but creating it's own instance so I don't know what would be the problem. Is it even being updated? I think it's outdated for a few years already unless someone updated it. I'm running crashdetect, YSF, sscanf, mysql, streamer and pawncmd together with this plugin without any problems.

The hooking procedure starts when the gamemode is being loaded, thats where errors should be thrown (if any)
You can send me the dll for that sampp plugin @ pm if you want me to check it out.
I tested it now and I can confirm that it is due to the sampp plugin. It's working fine now, without it. Then I put it back and it started giving me the same bugs.
Nathan94 is offline   Reply With Quote
Old 21/01/2019, 09:05 PM   #15
nickdodd25
Huge Clucker
 
nickdodd25's Avatar
 
Join Date: Jan 2012
Location: Unknown
Posts: 444
Reputation: 109
Default Re: CHandling - Server control of handlings & per-vehicle handlings

I tried this last night. Its pretty fun to play around with!

But i found an odd issue. I keep getting a sampgdk warning when using this. It appears to happen when CallRemoteFunction is used inside the gamemode or filterscripts. Example...
Code:
[sampgdk:warning] Index mismatch for OnServerTimeUpdate (-10058 != -10057)
[sampgdk:warning] Index mismatch for Speedo_SetVehicleFuel (-10071 != -10070)
Something like this. Them are just two of the ones that get called by callremotefunction.

Also i need to load the plugin before any other plugins, otherwise it will not load.
__________________
Nick
nickdodd25 is offline   Reply With Quote
Old 21/01/2019, 09:30 PM   #16
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

That's caused by sampgdk, although I don't know why would it happen with CallRemoteFunction. I just tested it and called a remote function from the filterscript and nothing happened. Only index mismatches I'm getting are for OnPlayerStatsAndWeaponUpdate coming from YSF, probably because I'm using some older version.

I'm not that experienced with sampgdk, but does it happen for every CallRemoteFunction you do, or just these 2?
One thing I noticed is that the indexes are off by just one.

As for the issue with loading the plugins, I'd like to know the list of plugins you are loading. There must be some that conflict with this one, I have no problem with loading it in any place despite using YSF, streamer and a few others.


Update:
That earlier problem with SAMP+ plugin causing CHandling to stop working is caused entirely by SAMP+, I think it's using a very old version of sampgdk which messes up the natives when loaded before other plugins. And since CHandling uses IsValidVehicle() native, it returns false and GetVehicleHandling* thinks the vehicle doesn't exist. It also messed up the streamer plugin, objects attached to vehicles stopped working.

Last edited by dotSILENT; 21/01/2019 at 10:03 PM.
dotSILENT is offline   Reply With Quote
Old 22/01/2019, 01:54 AM   #17
nickdodd25
Huge Clucker
 
nickdodd25's Avatar
 
Join Date: Jan 2012
Location: Unknown
Posts: 444
Reputation: 109
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Quote:
Originally Posted by dotSILENT View Post
That's caused by sampgdk, although I don't know why would it happen with CallRemoteFunction. I just tested it and called a remote function from the filterscript and nothing happened. Only index mismatches I'm getting are for OnPlayerStatsAndWeaponUpdate coming from YSF, probably because I'm using some older version.

I'm not that experienced with sampgdk, but does it happen for every CallRemoteFunction you do, or just these 2?
One thing I noticed is that the indexes are off by just one.

As for the issue with loading the plugins, I'd like to know the list of plugins you are loading. There must be some that conflict with this one, I have no problem with loading it in any place despite using YSF, streamer and a few others.
This seems to be a issue with the sky plugin. As long as i load the chandling before sky it works, but the sampgdk warnings show up. And it only appears to be a select few CallRemoteFunction calls that are affected. And they do not call the remote functions either.

Ill do some more debugging on my end, i will make a issue on github if i find any more info out.

Also if it makes any difference, i am on windows 10.
__________________
Nick
nickdodd25 is offline   Reply With Quote
Old 22/01/2019, 07:56 AM   #18
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

I know why it's not working when you put it after SKY.
It's because SKY uses the exact same GetPacketId hook (which I actually took from Whitetiger's sampACv2). But SKY hooks the function directly in Load(), which overwrites the first 5 bytes with a JMP instruction, causing my FindPattern to fail. That's why I don't install hooks until the first AmxLoad call, so other plugins can use FindPattern under Load(), but SKY is not doing that.
I'll have to workarounnd that somehow, probably increasing the FindPattern signature and ignoring the first 5 bytes, if that will be possible.
As for these sampgdk warnings I'll have to test it out.

Update
I made a small commit (here) which addresses the hook-conflict with SKY (and any other plugin that would hook GetPacketID under Load()). It falls back to an alternate, longer pattern prefixed with a JMP instruction so it should find the correct function even if it was hooked already. Tested it on both windows and linux and it seems to work properly.
Haven't made a release as it's just a tiny change and SKY plugin is also kinda outdated. If someone really needs this then you can compile it yourself, or just load the plugin before SKY as it also does the job.

Last edited by dotSILENT; 22/01/2019 at 02:28 PM.
dotSILENT is offline   Reply With Quote
Old 25/01/2019, 08:26 PM   #19
Chaprnks
Gangsta
 
Chaprnks's Avatar
 
Join Date: Sep 2007
Location: Soviet America
Posts: 567
Reputation: 69
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Excellent effort & great idea.. but the clientside installation requirement makes this fall short from being one of the most useful plugins I've seen. I guess its "as good as it gets" for now
__________________
Chaprnks is offline   Reply With Quote
Old 25/01/2019, 08:42 PM   #20
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

There is no other way to do it unless it's done by Kalcor, and I wouldn't count on that.
In my opinion, client sided modifications (ehm..SAMP Addon, but I'll give a very very bad stare at the guy who made it for not making it open source, which is one of the reasons I'm never ever touching it, especially that afaik it comes from Russia) are the only future for SA:MP considering the frequency of updates. Of course it's not safe to run compiled code from untrusted sources, which is why every modification of such sort should be open source (again, I look at you SAMP Addon)
dotSILENT is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] M-Server Control Panel 1.8 | VPS-Sftp/Shell Control | Rcon/Remote Control Server | + more | park4bmx Tools and Files 264 14/08/2018 04:05 PM
Car handlings are very hard ZombieNest Client Support 13 10/08/2014 10:03 AM
[FilterScript] Server Control Panel V1.0.0 - A simple server control filterscript with dialog chencong Filterscripts 10 27/09/2013 07:31 PM
[FilterScript] SA-MP 0.3c Vehicle Control System (Control everything, you want) Auxxx Filterscripts 78 09/10/2012 10:40 PM


All times are GMT. The time now is 02:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.