0% found this document useful (0 votes)
24 views2 pages

Gameserver Docs

The document outlines various debugging and coding issues related to player movement, inventory management, and game state in a game engine. Key points include ensuring proper initialization of player controls, fixing inventory item addition, and addressing world teardown errors. Additionally, it provides code snippets for resolving specific problems and optimizing gameplay mechanics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Gameserver Docs

The document outlines various debugging and coding issues related to player movement, inventory management, and game state in a game engine. Key points include ensuring proper initialization of player controls, fixing inventory item addition, and addressing world teardown errors. Additionally, it provides code snippets for resolving specific problems and optimizing gameplay mechanics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

0x488 - hook net debug to fix this crash

Keyboard input not moving player - AFortPlayerController::bHasInitiallySpawned


bitfield must be set so the player can move
SetActiveLevelCollection out of date: GameNetDriver - make sure to place the
ReadyToStartMatch bool outside of the function call
Item won't add to inventory on client, but works on the server player - Make sure
to do AFortPlayerController::WorldInventory::Inventory::MarkArrayDirty()
SpawnActor failed because we are tearing down the world - Don't use UWorld*
World/UObject* World, as a global make it into a function so UObject* GetWorld(),
to grab the world dynamically.
Hitching before joining into the game on ReadyToStartMatch - might have an issue
with setting playlist, don't call StartMatch() and or StartPlay()
Don't set GetWorld()->NetDriver to BeaconHost->NetDriver
Change OnlineBeaconHost to FortOnlineBeaconHost random error with FindObject
->SetOwner must be set or inventory item won't be added | Example inventory code: "
auto QuickBars =
SpawnActor(UObject::Object("/Script/FortniteGame.FortQuickBars"));
PlayerController->Property("QuickBars") = QuickBars;
QuickBars->Function("SetOwner", PlayerController);

auto WorldInventory = PlayerController->Property("WorldInventory");

auto ItemDefinition =
UObject::Object("/Game/Athena/Items/Weapons/WID_Harvest_Pickaxe_Athena_C_T01.WID_Ha
rvest_Pickaxe_Athena_C_T01");
auto ItemInstance = ItemDefinition-
>Function<UObject*>("CreateTemporaryItemInstanceBP", 1, 1);
ItemInstance->Function("SetOwningControllerForTemporaryItem",
PlayerController);

auto ItemEntry = &ItemInstance->Property<void*>("ItemEntry");


auto FortItemEntry =
UObject::Object<UStruct>("/Script/FortniteGame.FortItemEntry");
GetAtPointer<int>(ItemEntry, FortItemEntry-
>StructPropertyOffset("Count")) = 1;

auto Inventory = &WorldInventory->Property<__int64>("Inventory");


auto FortItemList =
UObject::Object<UStruct>("/Script/FortniteGame.FortItemList");
GetAtPointer<TArray<UObject*>>(Inventory, FortItemList-
>StructPropertyOffset("ItemInstances")).Add(ItemInstance);
GetAtPointer<TArray<UObject*>>(Inventory, FortItemList-
>StructPropertyOffset("ReplicatedEntries")).Add(FortItemEntry->Size(), ItemEntry);

PlayerController->Property("QuickBars")->Function(
"ServerAddItemInternal",
GetAtPointer<FGuid>(ItemEntry, FortItemEntry-
>StructPropertyOffset("ItemGuid")),
char(0),
0
);

WorldInventory->Function("HandleInventoryLocalUpdate");
PlayerController->Function("OnRep_QuickBar");" (Works for singleplayer)

Can't use StaticFindObject without Realloc Free ToString


can't call GIsServer or GIsClient without doing if (GIsServer) *(bool*)(GIsServer)
= true if (GIsClient) *(bool*)(GIsClient) = false
Code to find the ServerReplicateActors offset: " auto SRAI =
NetDriver->Property("ReplicationDriver")->VTable[0x53];
Decl(ServerReplicateActorsInternal, SRAI);
ServerReplicateActorsInternal(NetDriver-
>Property("ReplicationDriver"));
std::cout << "ServerReplicateActors: 0x" << std::hex <<
int64(ServerReplicateActorsInternal) - int64(GetModuleHandle(0)) << std::endl;"

Skip bus code: " float Duration = 100000;


float EarlyDuration = Duration;

float TimeSeconds = GetGameplayStatics()-


>Function<float>("GetTimeSeconds", GetWorld()) + GameState-
>Property<float>("ServerWorldTimeSecondsDelta");

static auto WarmupCountdownEndTimeOffset = GameState-


>Property<float>("WarmupCountdownEndTime");
static auto WarmupCountdownStartTimeOffset = GameState-
>Property<float>("WarmupCountdownStartTime");
static auto WarmupCountdownDurationOffset = GameMode-
>Property<float>("WarmupCountdownDuration");
static auto WarmupEarlyCountdownDurationOffset = GameMode-
>Property<float>("WarmupEarlyCountdownDuration");

WarmupCountdownEndTimeOffset = TimeSeconds + Duration;


WarmupCountdownDurationOffset = Duration;

WarmupCountdownStartTimeOffset = TimeSeconds;
WarmupEarlyCountdownDurationOffset = EarlyDuration;

static auto GameSession = GameMode-


>Property("GameSession");
GameSession->Property<int>("MaxPlayers") = 100;"

You might also like