[Steam] The Hook when player click upload button

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
This prefix applies to all threads that are designed for this platform.

LiuYuJin

Well-known member
Joined
Oct 30, 2020
Messages
6
Hi,guys!
I want to do some verification before players transfer to other cluster servers.i just find this hook:

void ServerUploadCurrentCharacterAndItems_Implementation(UPrimalInventoryComponent* inventoryComp) { NativeCall<void, UPrimalInventoryComponent*>(this, "AShooterPlayerController.ServerUploadCurrentCharacterAndItems_Implementation", inventoryComp); }

my code:

void Hook_AShooterPlayerController_ServerUploadCurrentCharacterAndItems_Implementation(AShooterPlayerController* _this, UPrimalInventoryComponent* FromInventory) {
Log::GetLog()->info("Current hook :{}", __FUNCTION__);
bool bPreventUploadSurvivorsField = true;
AShooterGameMode* shooterGameMode = ArkApi::GetApiUtils().GetShooterGameMode();
if (shooterGameMode) {
bPreventUploadSurvivorsField = shooterGameMode->bPreventUploadSurvivorsField();
//do some validate ,and prevent upload
shooterGameMode->bPreventUploadSurvivorsField()=true;
}
AShooterPlayerController_ServerUploadCurrentCharacterAndItems_Implementation_original(_this,FromInventory);
if (shooterGameMode) {
shooterGameMode->bPreventUploadSurvivorsField() = bPreventUploadSurvivorsField;
}
}

It's working, which blocked uploading,but the dialog of cluster server can't be closed. so is there anyone give me some suggestions. thanks a lot!
 
Back
Top