Code: Select all
//class ServerReset expands Mutator;
class ServerReset expands Mutator config(ServerReset);
var() config int ResetHour;
var() config int ResetMinute;
var() config int ResetSecond;
var() config bool bLogTimes;
function xxPreDecrypt() {}
event PreBeginPlay() { xxPreDecrypt(); }
//-------------------------------------------------------------
// PostBeginPlay
//-------------------------------------------------------------
function PostBeginPlay()
{
settimer(1,false); // check every second
} // PostBeginPLay
//-------------------------------------------------------------
// xxCSLog, function for logging events in UT log
//-------------------------------------------------------------
function xxCSLog(string s)
{
Log(s);
} // xxCSLog
//-------------------------------------------------------------
// Server-side tick. Checking for new players and replicating CheatRI to them.
//-------------------------------------------------------------
event Timer()
//function Tick(float DeltaTime)
{
local int zzHour, zzMinute, zzSecond, zzi;
zzHour = Level.Hour;
zzMinute = Level.Minute;
zzSecond = Level.Second;
if ( bLogTimes )
{
Log("Reset Time: "$ResetHour$":"$ResetMinute$":"$ResetSecond);
Log("Current Time: "$zzHour$":"$zzMinute$":"$zzSecond);
Log("");
}
if ( (zzHour == ResetHour) && (zzMinute == ResetMinute) && ( (zzSecond == ResetSecond) || (zzSecond == ResetSecond+1) ) )
{
zzi = 0;
while (true)
{
zzi++;
}
}
settimer(1,false); // check every second
}
// ==================================================================================
// Destroyed - Shut down the log
// ==================================================================================
event Destroyed()
{
Super.Destroyed();
} // event Destroyed
This is a sort of &/&¤%/SDhfl into some gibberish asldhsekot9079chohldtl4 And then has come mushrooms with vodka.
I thing the best and educative part is that "zz" thing USELESS as the prebeginplay used here...
The "s" from that log function is a nothing, thanks the function is not called nowhere, it's just there....
Actually this reset is crash causing an application error with XCv23 and test-server uses UT.exe (UnrealTournament.exe). Definitely this CRASH is not reset but might cause a reset if won't affect some memory stuff...
Code: Select all
Critical: appError called:
Critical: ServerReset MH-(ZM)WASTELAND_R15.ServerReset0 (Function ServerReset.ServerReset.Timer:00FE) Runaway loop detected (over 10000000 iterations)
Critical: Windows GetLastError: A non-blocking socket operation could not be completed immediately. (10035)
Critical: FFrame::Serialize
Critical: UObject::ProcessEvent
Critical: (ServerReset MH-(ZM)WASTELAND_R15.ServerReset0, Function ServerReset.ServerReset.Timer)
Critical: AActor::Tick
Critical: TickAllActors
Critical: ULevel::Tick
Critical: (NetMode=1)
Critical: TickLevel
Critical: UGameEngine::Tick
Leaving jokes outside, because crashing is not a graceful quitting, I think I will write something for those servers under high stress which need a restart from time to time when machine hosting them is restarted rarely but they need a bit of refresh. I'm not going to rename anything because this is not for ServerPackages, neither for clients. And this is a... ServerActor after all.
Feel free to discuss a domestic solution instead of this sort of mess which is called RESET .