Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Server crash (MX0_MissionStart_DME)
Server crash [message #470991] Mon, 09 July 2012 04:35 Go to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
I have found the problem in MX0_MissionStart_DME that causes the server crash. (If I remember correctly it didn't crash in 3.4.4?)
I was able to find it by decompiling it and looking into what it could crash.
The command that is causing the crash is Commands->Select_Weapon.
Use these settings to make any server crash: Commands->Select_Weapon(0, "");
Such command as this is in MX0_MissionStart_DME. If you aren't in the game (OnLevelLoad, you aren't in the game yet but Created event of scripts is called so Commands->Select_Weapon in MissionStart_DME aswell.).
So MissionStart_DME uses Commands->Get_A_Star to find the closest star, that would return 0 when there is none I suppose.

EDIT: In the past I used level reedit to get M13.mix I put it on my server as it got out so no changes. It used to work without a crash but now it crashes on MissionStart_DME.


Also Known As: Neijwiert

[Updated on: Mon, 09 July 2012 04:39]

Report message to a moderator

Re: Server crash [message #470993 is a reply to message #470991] Mon, 09 July 2012 04:39 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
It's passing a NULL pointer as first argument to Select_Weapon(), the second argument can also have issues with certain code running on a server, you should clone the script and have it select a valid weapon. If you clone the script you can register your clone as "MX0_MissionStart_DME", if you do that you can release your fix as an SSGM 4.0 plugin.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: Server crash [message #470994 is a reply to message #470991] Mon, 09 July 2012 04:41 Go to previous messageGo to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Quote:

It's passing a NULL pointer as first argument to Select_Weapon()


No shit sherlock Surprised. But I could release a clone indeed. The point is it worked before but now it doesn't.
Also it doesn't matter what you fill in at weapon_name. You can pass in an empty string or a NULL pointer doesn't crash. only if you pass a NULL pointer in the GameObject variable it starts to whine.


Also Known As: Neijwiert
Re: Server crash [message #470995 is a reply to message #470991] Mon, 09 July 2012 04:47 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
Yes but the functions that return the name of a weapon a guy has might return a NULL pointers and some code doesn't work correctly with it will cause the server to crash.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: Server crash [message #470996 is a reply to message #470991] Mon, 09 July 2012 04:52 Go to previous messageGo to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
I know but I'm trying to point this out so they can script safeguards or something in those commands that will prevent invalid passing on of information. And also prevent server crashes.

Also Known As: Neijwiert
Re: Server crash [message #470997 is a reply to message #470991] Mon, 09 July 2012 05:00 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3555
Registered: February 2003
Karma: 0
General (3 Stars)

ok, this should be fixed for the next build now so that Select_Weapon wont crash when passed 0 for the first parameter.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Server crash [message #470998 is a reply to message #470991] Mon, 09 July 2012 05:01 Go to previous messageGo to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Also, Westwood uses these settings Iran:
Vector3 Pos = Commands->Get_Position(obj);
GameObject *Star = Commands->Get_A_Star(Pos);
Commands->Select_Weapon(Star, "");


Also Known As: Neijwiert
Re: Server crash [message #470999 is a reply to message #470991] Mon, 09 July 2012 05:19 Go to previous message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
I know they do, on certain levels you start with no weapon selected.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Previous Topic: Translation_Overrides
Next Topic: Bogus Credits in SP
Goto Forum:
  


Current Time: Fri Apr 19 17:08:54 MST 2024

Total time taken to generate the page: 0.00690 seconds