What functions are called after PostLogin

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

forrestmark9

FNG / Fresh Meat
Nov 29, 2011
1,110
40
0
I need to know what functions are called after PostLogin, I made a VIP system that sets certain things when the player joins but I need GetPlayerIDHash() to return the players SteamID and not his CD-Key hash and this seems to only happen after PostLogin is called. I currently have the function call in Tick on the PRI but it has rpoven unreliable as it seems to skip players and sometimes doesn't work

Here is the code if you could improve it in anyway

PRI
Code:
function Tick(float DT)
{
	Super.Tick(DT);

    if( !bGotVIPValues )
    {
        bGotVIPValues = true;
        if( FMXPlayerController(Owner) != none )
            FMXPlayerController(Owner).InitVIPInfo();
    }
}

PlayerController
Code:
function InitVIPInfo()
{
    local int i;
    local ForrestPRI FPlayerRepInfo;
    local string SteamID;
    local FMXScrnMut FScrnMut;
    
    FPlayerRepInfo = ForrestPRI(PlayerReplicationInfo);
    if( FPlayerRepInfo == none )
        return;

    SteamID = GetPlayerIDHash();
    FScrnMut = FMXScrnMut(Mut);
    
    for(i=0;i<FScrnMut.SteamIDs.Length;i++)
    {
        if( FScrnMut.SteamIDs[i].ID == SteamID )
        {
            FPlayerRepInfo.IsVIP = true;
            FPlayerRepInfo.bSuperVIP = True;
            FPlayerRepInfo.MedalMaterial = Material(DynamicLoadObject(FScrnMut.SteamIDs[i].MedalMaterial, class'Material', true));
            FPlayerRepInfo.PlayerNameColor = FScrnMut.SteamIDs[i].VIPColor;
            BecomeVIP();
        }
    }
}
 

Dr_Killjoy

FNG / Fresh Meat
Sep 30, 2012
260
0
0
CheckReplacement, adding actor to pending array, calling timer or setting time when to update in tick, something like it works in ServerPerks. Why dont use this scheme?

And if talk about improving existing code, maybe something like this:
...
if( !bGotVIPValues && InitVIPInfo() )
bGotVIPValues = true;
...

function bool InitVIPInfo()
{
local FMXPlayerController PC;

PC = FMXPlayerController(Owner);
if ( PC != none ) return PC.InitVIPInfo(Self);
return false;
}

...

Controller

...

function bool InitVIPInfo(FPlayerRepInfo FPRI)
{
if ( FPRI == none ) return false;
...
return true;
}
 
Last edited:

forrestmark9

FNG / Fresh Meat
Nov 29, 2011
1,110
40
0
In which cases PC->GetPlayerIDHash() is not returning the steamid? I'm using this in GameType->PostLogin() and it works like a charm...

Before PostLogin which is when PostBeginPlay and all that is called in the playercontroller and pawn, GetPlayerIDHash() returns the players CD-Key Hash