Page 1 of 1

Automatic Junks removal

Posted: Sat Oct 12, 2019 4:15 pm
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.

Re: Automatic Junks removal

Posted: Sat Oct 12, 2019 6:12 pm
by SC]-[WARTZ_{HoF}
Nice work Nels.

Re: Automatic Junks removal

Posted: Sun Oct 13, 2019 11:05 am
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...

Re: Automatic Junks removal

Posted: Tue Oct 15, 2019 5:45 pm
by Evil-1
Nelsona why isn't the UT-stealth working with any maps or weapons on sniper sever now ?

Re: Automatic Junks removal

Posted: Wed Oct 16, 2019 5:36 am
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.

Re: Automatic Junks removal

Posted: Wed Oct 16, 2019 4:37 pm
by SC]-[WARTZ_{HoF}
Is there a way to fix the UT_Stealth mod so it doesn’t crash the server.

Re: Automatic Junks removal

Posted: Wed Oct 16, 2019 6:00 pm
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...

Re: Automatic Junks removal

Posted: Wed Oct 16, 2019 8:00 pm
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.

Re: Automatic Junks removal

Posted: Thu Oct 17, 2019 5:42 am
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...

Re: Automatic Junks removal

Posted: Fri Oct 18, 2019 3:03 pm
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...