30 lines
1.8 KiB
C
30 lines
1.8 KiB
C
#ifdef WORKBENCH
|
|
modded class ERR_GameMode
|
|
{
|
|
protected override void StartScenario() {}
|
|
protected override void EOnInit(IEntity owner)
|
|
{
|
|
super.EOnInit(owner);
|
|
if (!SCR_Global.IsEditMode()) GetGame().GetCallqueue().CallLater(ReconnectReplacementProbe, 8000, false);
|
|
}
|
|
void ReconnectReplacementProbe()
|
|
{
|
|
ERR_PlayerRoster roster = new ERR_PlayerRoster();
|
|
UUID account = "00e77100-0000-0000-0000-000000000071";
|
|
if (!roster.Bind(71, account)) { Print("ERR SMOKE FAIL: initial roster bind", LogLevel.ERROR); return; }
|
|
ERR_PlayerLife life = roster.Get(71);
|
|
life.UsedLife = true;
|
|
if (roster.AllowReconnectReplacement(71, ERR_Phase.PRISON)) { Print("ERR SMOKE FAIL: connected death granted replacement", LogLevel.ERROR); return; }
|
|
roster.Disconnect(71);
|
|
if (!life.ReconnectPending || roster.AllowReconnectReplacement(71, ERR_Phase.PRISON)) { Print("ERR SMOKE FAIL: disconnected admission guard", LogLevel.ERROR); return; }
|
|
if (!roster.Bind(72, account) || roster.Get(72) != life || roster.AllowReconnectReplacement(72, ERR_Phase.EXTRACTION)) { Print("ERR SMOKE FAIL: reconnect identity or extraction guard", LogLevel.ERROR); return; }
|
|
if (!roster.AllowReconnectReplacement(72, ERR_Phase.RADIO_DEFENCE) || life.UsedLife || life.ReconnectPending || !roster.CanEnter(72, ERR_Phase.RADIO_DEFENCE)) { Print("ERR SMOKE FAIL: missing body fresh admission", LogLevel.ERROR); return; }
|
|
life.UsedLife = true;
|
|
roster.Bind(72, account);
|
|
if (roster.AllowReconnectReplacement(72, ERR_Phase.PRISON)) { Print("ERR SMOKE FAIL: duplicate callback granted another life", LogLevel.ERROR); return; }
|
|
Print("ERR SMOKE PASS: native roster disconnect and rebind grants one missing-body admission; connected death, extraction and duplicate callbacks blocked");
|
|
Print("ERR SMOKE COMPLETE: reconnect-replacement");
|
|
}
|
|
}
|
|
#endif
|