SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 03/01/2014, 04:41 AM   #1
Dr.Einstein
Huge Clucker
 
Dr.Einstein's Avatar
 
Join Date: Oct 2012
Location: How long can a location string be and why is the max length of this field 100 chars long?
Posts: 380
Reputation: 121
Default RemoveBuildingForPlayer - crash if player reconnects

OK, so this is very weird. I have placed on OnPlayerConnect the function to remove the buildings for players. If a player loses connection and reconnects, that player's game will either crash or freeze. I did a lot of tests with this and still the game got stuck. I called the function once on OnPlayerSpawn but that still crashed me after I 'gmxed' the server. I also used a timer for this, but it gave me the same result. Moreover, I ran the function only one time for each player, meaning the first time the player connects, but the second time of connection, the server doesn't remove the objects.

PS: There are at least 600 objects that get removed.
Dr.Einstein is offline   Reply With Quote
Old 03/01/2014, 05:33 AM   #2
Excelize
Huge Clucker
 
Join Date: May 2013
Location: wowe plz giev me rep i wil get 50 scoer end rep u 2 : - )(It's sarcasm FFS)
Posts: 361
Reputation: 25
Default Re: RemoveBuildingForPlayer - crash if player reconnects

Just put it into a filterscript, it makes it much easier.(Atleast for me.)

So you can load/unload if it's bugged
__________________
I left SA:MP, not active on forums anymore either. Might be on the forums once in a while. If you want to contact me, email me, or use my Skype name provided on my profile. And no, I'm not going to join your project, so please only contact me if you have something reasonably important to say.
----------------------------------------------------------
Enjoy:
All my Works
Excelize is offline   Reply With Quote
Old 03/01/2014, 10:03 AM   #3
ikey07
High-roller
 
ikey07's Avatar
 
Join Date: Jul 2010
Location: Latvia,Riga
Posts: 1,371
Reputation: 180
Default Re: RemoveBuildingForPlayer - crash if player reconnects

Remove only on spawn and once, after it, add stat which tells that player's objs is removed.

like

new Removed[MAX_PLAYERS];


OnPlayerSpawn()
{
if(!Removed[playerid])
{
//Remove script
Removed[playerid] = 1;
}


}
__________________
ikey07 is offline   Reply With Quote
Old 03/01/2014, 12:57 PM   #4
BigETI
Gangsta
 
BigETI's Avatar
 
Join Date: Mar 2010
Location: Germany
Posts: 879
Reputation: 174
Default AW: RemoveBuildingForPlayer - crash if player reconnects

We can't be sure, if a player has actually close his/her game or just loose his/her connection to the server and reconnects. (Sometimes bugged players can't send a quit request to the server, so they are going to be shown as "timed out"). A lot of RemoveBuildingForPlayer code can crash a player indeed, and if a player times out for a short period of time and reconnects, the script will execute RemoveBuildingForPlayer, even if the player has already the objects removed from his/her game.

It can be useful to unload "remove building" code after a player calls OnPlayerDisconnect(), but we don't have this feature yet in SA:MP.

Also a lot of "remove building" code can mess up dialog sync (a feature to prevent cheaters executing invalid/forbidden dialog IDs), making dialogs unable to use in the server.
BigETI is offline   Reply With Quote
Old 03/01/2014, 04:21 PM   #5
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,176
Reputation: 1126
Default Re: RemoveBuildingForPlayer - crash if player reconnects

Another reason here why gmx is crappy anyways it's likely that your trying to remove objects too many times 600 is quite a lot to remove and it will usually start crashing players around 1000 objects.
Pottus is offline   Reply With Quote
Old 03/01/2014, 06:59 PM   #6
Dr.Einstein
Huge Clucker
 
Dr.Einstein's Avatar
 
Join Date: Oct 2012
Location: How long can a location string be and why is the max length of this field 100 chars long?
Posts: 380
Reputation: 121
Default Re: RemoveBuildingForPlayer - crash if player reconnects

I see, thanks for the extra info fellas. Well, at least I fixed the issue with Windows 8 players, whose game would freeze.
__________________
RAGE Paradise, new and improved
Stunt, Mini-games, freeroam, race, cops and robbers, parkour, protect the president, team death matches, zombies, capture the flag


play.bestsampserver.com:7777
Dr.Einstein is offline   Reply With Quote
Old 04/01/2014, 06:50 PM   #7
DaRk_RaiN
High-roller
 
DaRk_RaiN's Avatar
 
Join Date: Sep 2012
Posts: 994
Reputation: 207
Default Re: RemoveBuildingForPlayer - crash if player reconnects

Yep also happened to me in my server, only about 200 removed objects.
DaRk_RaiN is offline   Reply With Quote
Old 04/01/2014, 08:17 PM   #8
ikey07
High-roller
 
ikey07's Avatar
 
Join Date: Jul 2010
Location: Latvia,Riga
Posts: 1,371
Reputation: 180
Default Re: RemoveBuildingForPlayer - crash if player reconnects

Well if you remove such area as LS docks, where is alot of same containers or lights, you can increase removed obj range, so you don't have to remove each one light/container.
__________________
ikey07 is offline   Reply With Quote
Old 04/01/2014, 09:27 PM   #9
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,176
Reputation: 1126
Default Re: RemoveBuildingForPlayer - crash if player reconnects

Quote:
Originally Posted by ikey07 View Post
Well if you remove such area as LS docks, where is alot of same containers or lights, you can increase removed obj range, so you don't have to remove each one light/container.
Thumbs up to that suggestion, just take a look at the mapping section some of those maps could have some lines reduced by doing this.
Pottus is offline   Reply With Quote
Old 15/05/2017, 12:41 PM   #10
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montréal, Québec, Canada
Posts: 240
Reputation: 18
Default Re: RemoveBuildingForPlayer - crash if player reconnects

Still the main problem is that if a player loose connection for a second, it will crash him on reconnect, because if you remove the same building twice for a player he crashes, I'm trying to find a fix to it...
__________________
rt-2
My hardcore first person 1994 simulation in development:
SA Advance Roleplay
rt-2 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
[Include] :: Anti-Reconnect Script. Avoid Auto Reconnects made by * tools! iPLEOMAX Includes 18 27/12/2013 01:53 PM
zGaming - reconnects. JizZy00 Scripting Help 1 25/05/2013 05:19 PM
Weapons after player reconnects ajwar Scripting Help 0 24/02/2013 05:34 PM
Player Crash DonWade Server Support 0 25/04/2012 11:19 PM
[Client Crash] RemoveBuildingForPlayer BigETI Bug Reports 0 08/04/2012 11:19 PM


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


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