register_touch crashes server
I have server running with some plugins, 2 of them have register_touch in them. Once a while I get crash. No idea why, in crash log it say something about sv_touchlinks.
Plugin 1: PHP Code:
Plugin 2: PHP Code:
So what I have noticed is that crash happens when knife (so plugin 2, but cant be sure) hits player, BUT rarely. So I don't know whats wrong. :( |
Re: register_touch crashes server
you need to start debugging by adding prints at every action
see if code#1 is called when a thrown knife hits a player, that would probably cause some issues because this right here "else if(get_user_class(id) == CLASS_MURDERER) return PLUGIN_HANDLED;", if your first plugin is above the second one in plugins.ini, would completely block other plugins from using the touch |
Re: register_touch crashes server
As you can see, both register different classname. So they can't block each other, but.. The thing that could happen is, when knife hit player which carries deagle, then both touches could occur - dropping gun, hit by knife.
Also, codes are orderered as they are in plugins.ini. Thanks for your reply. :) |
Re: register_touch crashes server
I still suggest adding server prints to everything, then check logs for crash, see what happens exactly, it's the easiest way to solve all problems
post exact crash error |
Re: register_touch crashes server
Touch called is not called 1 time, as I see on your first code, if an user walks over the entity the forward will be called every frame when moving on it, and overflowing and overflowing..
Start by debuging your code with messages, and see how it is working. |
Re: register_touch crashes server
Here is the crash log:
Code:
CRASH: Sun May 18 19:26:21 EEST 2014 |
Re: register_touch crashes server
He means that when touch something, touch will be called a lot of times. The problem might be inside pickup_weapon function.
|
Re: register_touch crashes server
pickup_weapon is just stock for hud sprite, WeapPickup message.
|
Re: register_touch crashes server
I don't know what the functions in your first callback do, but you're not removing the weapon or checking if the user already has it, so the WeapPickup message will be sent 60 times per second to the player.
|
Re: register_touch crashes server
Quote:
or it would spout out a netchan error, not something like this add a print after each and every line in order, eg server_print 1, 2 , 3 etc and when it crashes you will se exactly which was the last line that was run, probably the bogus one |
| All times are GMT -4. The time now is 09:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.