mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 11:12:23 +01:00
<feat: New project structure>
<feat: New release>
This commit is contained in:
57
dependencies/reboot/Project Reboot 3.0/PlayerState.cpp
vendored
Normal file
57
dependencies/reboot/Project Reboot 3.0/PlayerState.cpp
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
#include "PlayerState.h"
|
||||
|
||||
#include "reboot.h"
|
||||
|
||||
FString& APlayerState::GetSavedNetworkAddress()
|
||||
{
|
||||
static auto SavedNetworkAddressOffset = GetOffset("SavedNetworkAddress");
|
||||
return Get<FString>(SavedNetworkAddressOffset);
|
||||
}
|
||||
|
||||
FString APlayerState::GetPlayerName()
|
||||
{
|
||||
static auto GetPlayerNameFn = FindObject<UFunction>(L"/Script/Engine.PlayerState.GetPlayerName");
|
||||
|
||||
if (GetPlayerNameFn)
|
||||
{
|
||||
FString PlayerName;
|
||||
this->ProcessEvent(GetPlayerNameFn, &PlayerName);
|
||||
return PlayerName;
|
||||
}
|
||||
|
||||
static auto PlayerNameOffset = GetOffset("PlayerName");
|
||||
return Get<FString>(PlayerNameOffset);
|
||||
}
|
||||
|
||||
int& APlayerState::GetPlayerID()
|
||||
{
|
||||
static auto PlayerIDOffset = FindOffsetStruct("/Script/Engine.PlayerState", "PlayerID", false);
|
||||
|
||||
if (PlayerIDOffset == -1)
|
||||
{
|
||||
static auto PlayerIdOffset = FindOffsetStruct("/Script/Engine.PlayerState", "PlayerId", false);
|
||||
return Get<int>(PlayerIdOffset);
|
||||
}
|
||||
|
||||
return Get<int>(PlayerIDOffset);
|
||||
}
|
||||
|
||||
bool APlayerState::IsBot()
|
||||
{
|
||||
static auto bIsABotOffset = GetOffset("bIsABot");
|
||||
static auto bIsABotFieldMask = GetFieldMask(GetProperty("bIsABot"));
|
||||
return ReadBitfieldValue(bIsABotOffset, bIsABotFieldMask);
|
||||
}
|
||||
|
||||
void APlayerState::SetIsBot(bool NewValue)
|
||||
{
|
||||
static auto bIsABotOffset = GetOffset("bIsABot");
|
||||
static auto bIsABotFieldMask = GetFieldMask(GetProperty("bIsABot"));
|
||||
return SetBitfieldValue(bIsABotOffset, bIsABotFieldMask, NewValue);
|
||||
}
|
||||
|
||||
void APlayerState::OnRep_PlayerName()
|
||||
{
|
||||
static auto OnRep_PlayerNameFn = FindObject<UFunction>("/Script/Engine.PlayerState.OnRep_PlayerName");
|
||||
this->ProcessEvent(OnRep_PlayerNameFn);
|
||||
}
|
||||
Reference in New Issue
Block a user