Automatic Junks removal

Development assistance and tutorials here.
Post Reply
Nelsona
Posts: 1693
Joined: Sat Sep 30, 2017 5:03 am

Automatic Junks removal

Post by Nelsona »

Epic were so funny at random, while I could see not a single time servers crashed because or borked actors used in maps we might want to get rid of these getting over all mapper "solutions" when this wasn't really nice. By example we can have a ServerActor having an INI file using a static array where can be defined 8 known names that are causing problems. We nominate UT_Stealth as example and server will get rid of it shortly. Why we discuss in term "shortly" ?
Because this actor will be very polite and very kind - like a pig trough. It will allow replacements and iterators to do what they want first, and... kicking them in balls a bit later for preventing recursive reactions and crashes. Here is the sample (that can be adjusted):

Code: Select all

class NoBadItems expands Actor config (NoBadItems);

var() config Name Bad[8];
var int j;

const version=1;

/*
	ServerActor used for removal of items crashing game...
	Array has 8 elements, 0 to 7... we could use a dynamic array but...
	Here we defined Bad classes by Epic (or others) like UT_Stealth
	Actor allows replacements done and then will react if something
	is being found later spawned by whatever entity...

	Map has to be checked for trash - evil spawners - for preventing a recursive load
	and developing a lot of garbage objects. Item spawned later not being bStatic is
	removed and stupid thing might keep spawning new ones. For such case we have to 
	do some update. This version is simple, it won't include special checks.

	In configuration file we have to add these names of bad items,
	it's based on searching for names.
*/

event PreBeginPlay()
{
}

event PostBeginPlay()
{
	InitialState = 'Removing';
}

function DoRemoveClass( Name Bad, optional bool bStartUpChecked )
{
	local bool bInvalid;
	local Inventory Inv;
	local bool bLogged;

	bInvalid = ( Bad == '' || Bad == 'None' );

	if (!bInvalid )
	{
		foreach AllActors(class'Inventory',Inv)
		{
			if ( Inv.IsA(Bad) && !Inv.bDeleteMe )
			{
				if ( ( Inv.bStatic || Inv.bNoDelete ) && !bStartUpChecked )
				{
					if ( !bLogged )
					{
						bLogged = True;
						log ("Found dumb set"@Inv.Name$", perform deactivation...",'NoBadItems');
					}
					else
						log ("Still deactivating"@Inv.Name$".",'NoBadItems');
					Inv.bStatic = False;
					Inv.SetCollision(False,False,False);
					Inv.SetCollisionSize(0,0);
					Inv.GotoState('');
					Inv.Disable('Touch');
					Inv.Disable('UnTouch');
					Inv.bHidden = True;
					Inv.SetPhysics(PHYS_None);
					Inv.DrawType = DT_None;
				}
				else
				{
					log ("Deleting"@Inv.Name$".",'NoBadItems');
					if ( !Inv.bDeleteMe && !Inv.bHidden && Inv.DrawType != DT_None )
						Inv.Destroy();
				}
			}
		}
	}
}

state() Removing
{
Begin:
	Sleep (0.1);
	log ( "Actor version "$version$" is active...",'NoBadItems');
	log ( "Checking list...",'NoBadItems');
	j = 0;
LittleLoop:
		if ( Bad[j] != '' || Bad[j] != 'None' )
			DoRemoveClass(Bad[j]);
	j++;
	Sleep(0.15);
	if ( j < 8 )
		GoTo('LittleLoop');
	log ("Initial check has been finished... Will stay resident in background.",'NoBadItems');
BigLoop:
	j = 0;
	Sleep(2.5);
	if ( Level.Game != None && !Level.Game.bGameEnded )
	{
		for (j=0; j < 8; j++)
		{
			if ( Bad[j] != '' || Bad[j] != 'None' )
				DoRemoveClass(Bad[j],True);
			Sleep(0.1);
		}
		GoTo('BigLoop');
	}
	else
		Stop;
}

defaultproperties
{
	RemoteRole=ROLE_None
	NetPriority=3.000000
	bGameRelevant=True
}
Code cannot be compiled in normal UT state, there is needed a "fine tuned" one, it won't need remote role because... it is aiming server - that one was crashing. Of course, without item in server, client won't have access to said glitched thing so everyone can feel happy.
To do:
Testing stage when mapper was... "creative" with default properties for borked items...

XC Trivia:
In XCGE environments such list can be a dynamic array like those ServerPackages and ServerActors things - this one doesn't include such thing for now.
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
User avatar
SC]-[WARTZ_{HoF}
Site Admin
Posts: 421
Joined: Wed May 10, 2017 7:08 am

Re: Automatic Junks removal

Post by SC]-[WARTZ_{HoF} »

Nice work Nels.
Nelsona
Posts: 1693
Joined: Sat Sep 30, 2017 5:03 am

Re: Automatic Junks removal

Post by Nelsona »

No wonder. See another one...

Code: Select all

Critical: appError called:
Critical: ALplayer DM-(AMLP)Pirates-Rmx1.ALplayer0 (Function Engine.Pawn.SetDisplayProperties:0000) Infinite script recursion (250 calls) detected
Critical: FFrame::Serialize
Critical: ScriptDebugV
Critical: ALplayer0.SetDisplayProperties
Critical: ScriptDebugV
Critical: UT_invisibility2.SetOwnerDisplay
Critical: ScriptDebugV
Critical: ALplayer0.SetDisplayProperties
Critical: ScriptDebugV
Critical: UT_Stealth0.SetOwnerDisplay
Critical: ScriptDebugV
Time for updating - at next boot Actor will go active...
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
User avatar
Evil-1
Posts: 12
Joined: Fri Oct 13, 2017 11:35 am

Re: Automatic Junks removal

Post by Evil-1 »

Nelsona why isn't the UT-stealth working with any maps or weapons on sniper sever now ?
Nelsona
Posts: 1693
Joined: Sat Sep 30, 2017 5:03 am

Re: Automatic Junks removal

Post by Nelsona »

Did you see post above about crashing server - including quote from log ? All right, we can have crashes back if that's the goal and for future I won't do anything when it's about crashes. UT_Stealth it's a server crusher.
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
User avatar
SC]-[WARTZ_{HoF}
Site Admin
Posts: 421
Joined: Wed May 10, 2017 7:08 am

Re: Automatic Junks removal

Post by SC]-[WARTZ_{HoF} »

Is there a way to fix the UT_Stealth mod so it doesn’t crash the server.
Nelsona
Posts: 1693
Joined: Sat Sep 30, 2017 5:03 am

Re: Automatic Junks removal

Post by Nelsona »

UT_Stealth crusher is not a mod is a STOCK item probably exclusively for such similar-named mutators where EVERY player has it and NOTHING else trying to override player display properties or else will conflict each-other crashing game based on recursive actions.

UT_invisibility has such a purpose, if mapper is using Stealth that's a BAD intention or NOOB mapping, regarding to what you guys are thinking. I don't get why player must have advantage spawning nearby such item and miss-balancing battling.
If you recommend me a solution I'll do what I can and which must be tested first.

Because UT_Stealth has 9999999 charge and UT_invisibility has 100 that is a bullshit excuse for adding it in map. You can easily add invisibility and charging it accordingly from default properties which amazingly can be done ONCE for ALL items in map before doing last file SAVE, simple as that. UT_Shieldbelt recognizes UT_invisibility and will stay hidden. This deal is based on class-name, other classes are not in account. When a shield is adding some display and stealth is trying to modify that, only dumb recursions occur. Do we need crashes ? - remove it from black-list of that ServerActor and have fun...

Solution is using Invisibility or changing shieldbelt with a friendly class - perhaps replacing a function with XCGE... or changing BotPack at once with fixing X+ bugs from it...
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
User avatar
SC]-[WARTZ_{HoF}
Site Admin
Posts: 421
Joined: Wed May 10, 2017 7:08 am

Re: Automatic Junks removal

Post by SC]-[WARTZ_{HoF} »

Well I don’t actually think invisibility should be used on the sniper server but Evil likes the option in some maps. If there is no fix then I would rather have stability over server crashes anyday.
Nelsona
Posts: 1693
Joined: Sat Sep 30, 2017 5:03 am

Re: Automatic Junks removal

Post by Nelsona »

For this "dedicated problem" originally caused by EPIC in their poorly coding style, we can chat with UT_Stealth from maps in order to keep "party" original:
- deactivating it (btw it's not removed, but inactive);
- spawning Invisibility;
- copying charge and all specific features for a perfect clone (okay, okay, I get it, perfection doesn't exist).

PS:
I still believe this is a sort of cheating and then I would recommend Invulnerability with a large charge, perhaps some noob will get lucky winning a match with no "skillz"... as long as cannot be killed - probably telefraging would work...
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
Nelsona
Posts: 1693
Joined: Sat Sep 30, 2017 5:03 am

Re: Automatic Junks removal

Post by Nelsona »

Okay, I have a bit of free time for writing something toward "UT_Stealth" and turning it into a normal Stealth instead a server crusher.
Edit:
DONE ! Evil Sniper Server will have something like UT_Stealth if that's the goal - perhaps now it won't crash like before... will see that...
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
Post Reply