KillerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
(edited)float Hook_APrimalStructure_TakeDamage(APrimalStructure* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this && EventInstigator && !EventInstigator->IsLocalController() && EventInstigator->IsA(AShooterPlayerController::StaticClass()))
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (WeaponName.Contains(L"Flamethrower")) return 0;
}
}
APrimalStructure_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
(edited)float Hook_APrimalStructure_TakeDamage(APrimalStructure* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
Load();
break;
case DLL_PROCESS_DETACH:
Unload(); <----------------------------------
break;
}
return TRUE;
}
void Load()
{
Log::Get().Init("MyPlugin");
LoadConfiguration();
MyPluginDatabase::InitDatabase();
ArkApi::GetHooks().SetHook("AShooterGameMode.HandleNewPlayer_Implementation", &Hook_AShooterGameMode_HandleNewPlayer, &AShooterGameMode_HandleNewPlayer_original);
ArkApi::GetCommands().AddChatCommand("/myplugin", &MyPluginFunction);
}
void Unload()
{
ArkApi::GetHooks().DisableHook("AShooterGameMode.HandleNewPlayer_Implementation", &Hook_AShooterGameMode_HandleNewPlayer);
ArkApi::GetCommands().RemoveChatCommand("/myplugin");
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
Load();
break;
case DLL_PROCESS_DETACH:
Unload();
break;
}
return TRUE;
}
11/28/18 09:02 [API][info] Loaded plugin - myplugin
11/28/18 09:03 [API][info] Unloaded plugin - myplugin
11/28/18 09:04 [API][info] Loaded plugin - myplugin
"settings":{
"AutomaticPluginReloading":false,
"AutomaticPluginReloadSeconds":5,
"SaveWorldBeforePluginReload":true
},
11/28/18 11:29 [API][warning] (ArkApi::PluginManager::UnloadPluginCmd) Plugin extendedrcon is not loaded
11/28/18 11:31 [API][info] Loaded plugin - extendedrcon
11/28/18 11:34 [API][info] Unloaded plugin - extendedrcon
[API][info] Unloaded plugin - ExtendedRcon
struct TribeScore
{
uint64 PlayerSteamID;
uint64 PlayerTribeID;
int Score;
TribeScore(uint64 PlayerSteamID, uint64 PlayerTribeID, int Score) : PlayerSteamID(PlayerSteamID), PlayerTribeID(PlayerTribeID), Score(Score) {}
};
typedef std::vector<TribeScore> TribeScoreA;
TribeScoreA TribeScoreData;
I have this which loads up from a file at first.
I want to get which player has the highest score of a certain tribe.
Kind of like: void GetTribeBestScorer(uint64 tribeID)
Do correct me if anything above is not how it is usually done.struct TribeScore
{
TribeScore(uint64 PlayerSteamID, int Score)
: PlayerSteamID(PlayerSteamID),
Score(Score)
{
}
uint64 PlayerSteamID;
int Score;
};
std::unordered_map<uint64, std::vector<TribeScore>> TribeScoreData;
uint64 GetTribeBestScorer(uint64 tribeID)
{
auto& tribe_scores = TribeScoreData[tribeID];
const auto result = std::max_element(tribe_scores.begin(), tribe_scores.end(),
[](const TribeScore& a, const TribeScore& b)
{
return a.Score < b.Score;
});
return result != tribe_scores.end() ? result->PlayerSteamID : 0;
}
(edited)int ownerPlayerId = _this->OwningPlayerIDField();
if (ownerPlayerId == 0) // Owner is tribe
(edited)DEBUG: Hook_APrimalStructure_TakeDamage - damageReceiverPlayerID: 564558341
bool RequiresNotFollowing;
bool RequiresPassiveFlee;
bool RequiresIgnoreWhistle;
bool RequiresNeutered;
My inner hook variables: int following;
bool passiveflee;
bool ignorewhistle;
bool neutered;
(edited)if (RequiresNotFollowing && following) Do1();
(edited)if ((RequiresNotFollowing && following) && (RequiresPassiveFlee && passiveflee) && (...)) Do1();
bool config[10];
bool hook[10];
for (int i = 0; i < 10; ++i)
{
if (config[i] && !hook[i])
return false;
}
//check for enemy structures nearby
TArray<AActor*> AllStructures;
UGameplayStatics::GetAllActorsOfClass(reinterpret_cast<UObject*>
(ArkApi::GetApiUtils().GetWorld()), APrimalStructure::GetPrivateStaticClass(), &AllStructures);
for (AActor* StructureActor : AllStructures)
{
if (StructureActor)
{
if (StructureActor->TargetingTeamField() > 0 && _this->TargetingTeamField() != StructureActor->TargetingTeamField())
{
APrimalStructure* Structure = static_cast<APrimalStructure*>(StructureActor);
if (FVector::Distance(_this->RootComponentField()->RelativeLocationField(), Structure->RootComponentField()->RelativeLocationField()) <= DinoPassiveProtection::MinimumEnemyStructureDistance)
{
isNotNearEnemyStructures = false;
break;
}
else
{
isNotNearEnemyStructures = true;
}
}
}
}
//build config array
bool configConditions[] = {
DinoPassiveProtection::RequiresNotFollowing,
DinoPassiveProtection::RequiresPassiveFlee,
DinoPassiveProtection::RequiresIgnoreWhistle,
DinoPassiveProtection::RequiresNeutered,
DinoPassiveProtection::RequiresNoRider,
DinoPassiveProtection::RequiresNoInventory,
DinoPassiveProtection::RequiresNoNearbyEnemyStructures,
true
};
//build hook vars array
bool hookActuals[] = {
isNotFollowing,
(isPassiveAggressive && isPassiveFlee),
isIgnoringWhistles,
isNeutered,
hasNoRider,
hasNoInventory,
isNotNearEnemyStructures,
isHealthAboveMin
};
for (int i = 0; i < 8 ; ++i)
{
if (configConditions[i] && !hookActuals[i])
return APrimalDinoCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
//check for enemy structures nearby
TArray<AActor*> AllStructures;
UGameplayStatics::GetAllActorsOfClass(reinterpret_cast<UObject*>
(ArkApi::GetApiUtils().GetWorld()), APrimalStructure::GetPrivateStaticClass(), &AllStructures);
for (AActor* StructureActor : AllStructures)
{
if (StructureActor)
{
if (StructureActor->TargetingTeamField() > 0 && _this->TargetingTeamField() != StructureActor->TargetingTeamField())
{
APrimalStructure* Structure = static_cast<APrimalStructure*>(StructureActor);
if (FVector::Distance(_this->RootComponentField()->RelativeLocationField(), Structure->RootComponentField()->RelativeLocationField()) <= DinoPassiveProtection::MinimumEnemyStructureDistance)
{
isNotNearEnemyStructures = false;
break;
}
else
{
isNotNearEnemyStructures = true;
}
}
}
}
(edited)#include "AtlasShop.h"
(edited)player_controller->GiveItem(&out_items, &fblueprint, default_amount, quality, force_blueprint,
false, 0);
//bool GiveItem(FString * blueprintPath, int quantityOverride, float qualityOverride, bool bForceBlueprint) { return NativeCall<bool, FString *, int, float, bool>(this, "AShooterPlayerController.GiveItem", blueprintPath, quantityOverride, qualityOverride, bForceBlueprint); }
//bool GiveItem(FString * blueprintPath, int quantityOverride, float qualityOverride, bool bForceBlueprint) { return NativeCall<bool, FString *, int, float, bool>(this, "AShooterPlayerController.GiveItem", blueprintPath, quantityOverride, qualityOverride, bForceBlueprint); }
Creating library ArkApi\Ark Server API\x64\Release\ArkApi.lib and object ArkApi\Ark Server API\x64\Release\ArkApi.exp
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_multi_remove_handle
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_multi_add_handle
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_global_init
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_multi_info_read
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_global_cleanup
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_easy_init
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_multi_init
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_easy_cleanup
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_easy_setopt
Requests.obj : error LNK2001: unresolved external symbol __imp_curl_multi_perform
ArkApi\Ark Server API\x64\Release\version.dll : fatal error LNK1120: 10 unresolved externals
libcurl.lib(asyn-thread.obj) : warning LNK4099: PDB 'libcurl.pdb' was not found with 'libcurl.lib(asyn-thread.obj)' or at 'ArkApi\Ark Server API\x64\Ark\libcurl.pdb'; linking object as if no debug info
libcurl.lib(base64.obj) : warning LNK4099: PDB 'libcurl.pdb' was not found with 'libcurl.lib(base64.obj)' or at 'ArkApi\Ark Server API\x64\Ark\libcurl.pdb'; linking object as if no debug info
libcurl.lib(conncache.obj) : warning LNK4099: PDB 'libcurl.pdb' was not found with 'libcurl.lib(conncache.obj)' or at 'ArkApi\Ark Server API\x64\Ark\libcurl.pdb'; linking object as if no debug info
libcurl.lib(connect.obj) : warning LNK4099: PDB 'libcurl.pdb' was not found with 'libcurl.lib(connect.obj)' or at 'ArkApi\Ark Server API\x64\Ark\libcurl.pdb'; linking object as if no debug info
libcurl.lib(content_encoding.obj) : warning LNK4099: PDB 'libcurl.pdb' was not found with 'libcurl.lib(content_encoding.obj)' or at 'ArkApi\Ark Server API\x64\Ark\libcurl.pdb'; linking object as if no debug info
Should these be an issue?const auto& player_controllers = GetWorld()->PlayerControllerListField();
for (TWeakObjectPtr<APlayerController> player_controller : player_controllers)
{
AShooterPlayerController* shooter_pc = static_cast<AShooterPlayerController*>(player_controller.Get());
}
player->ConsoleCommand(..)
How would I accomplish this using an RCON command method.
As in, I want to use a console command when I issue an rcon command in a plugin. (edited)world->GetFirstPlayerController()
and then you can call ConsoleCommand from him.auto player_controller = ArkApi::GetApiUtils().GetWorld()->GetFirstPlayerController();
player_controller->ConsoleCommand(&result, &fcommand, true);
DECLARE_HOOK(AShooterGameMode_Logout, void, AShooterGameMode*, AController *);
(edited)DECLARE_HOOK(AShooterGameMode_Logout, void, AShooterGameMode*, AController*);
{"response":{"lender_steamid":"0"}}
AShooterGameMode_HandleNewPlayer
void BanPlayer(FString PlayerSteamName) { NativeCall<void, FString>(this, "UShooterCheatManager.BanPlayer", PlayerSteamName); }
DECLARE_HOOK(AShooterGameMode_HandleNewPlayer_Implementation, bool, AShooterGameMode*, AShooterPlayerController *, UPrimalPlayerData *, AShooterCharacter *, bool);
ArkApi::GetApiUtils().GetShooterGameMode()->BannedMapField();
and every time you ban a player it automatically get saved const auto banned = ArkApi::GetApiUtils().GetShooterGameMode()->BannedMapField();
for (const auto currentEntry : banned)
{
if(currentEntry.Value == FString(steamId))
{
// Do something
}
}
currentEntry.Key
would be PlayerName
currentEntry.Value
would be the SteamIdBannedMapField
if (currentEntry.Value == FString(steamId))
{
// Do something
}
{"response":{"lender_steamid":"0"}}
nlohmann::json Json = Response;
if (int LenderSteamID; (LenderSteamID = Json["response"].value("lender_steamid", 0)) != 0)
{
//LenderSteamID
}
(edited)FString URL = FString::Format("YourFullStringHere", steamId);
FString URL = FString::Format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=whateversteamid={}&appid_playing=346110&format=json", steam_id);
&
missing between your key and the steamId parameter but yea ToString()
function from FString URL.ToString()
instead of putting a string with ToString()
in it void GetCallback(bool Success, std::string Result)
{
Log::GetLog()->info("LenderSteamID: {}", Result);
}
{"response":{"lender_steamid":"0"}}
nlohmann::json Json = Result;
if (int LenderSteamID; (LenderSteamID = Json["response"].value("lender_steamid", 0)) != 0)
{
//LenderSteamID
}
{
Log::GetLog()->info("LenderSteamID: {}", Result);
nlohmann::json Json = nlohmann::json::parse(Result);
if (int LenderSteamID; (LenderSteamID = Json["response"].value("lender_steamid", 0)) != 0)
{
//LenderSteamID
}
}
API::Requests::Get().CreateGetRequest("URL", &GetCallback);
const auto banned = ArkApi::GetApiUtils().GetShooterGameMode()->BannedMapField();
and match it against the id we're obtaining from the steam api ?fmt::format("someurl.com?steamid={}", steamid")
void GetCallback(bool Success, std::string Result)
{
Log::GetLog()->info("LenderSteamID: {}", Result);
nlohmann::json Json = nlohmann::json::parse(Result);
if (int LenderSteamID; (LenderSteamID = Json["response"].value("lender_steamid", 0)) != 0)
{
//LenderSteamID
}
}
API::Requests::Get().CreateGetRequest("fmt::format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=86B1steamid={}&appid_playing=346110&format=json", "steam_id")", &GetCallback);
(edited)void GetCallback(bool Success, std::string Result)
{
Log::GetLog()->info("LenderSteamID: {}", Result);
nlohmann::json Json = nlohmann::json::parse(Result);
if (int LenderSteamID; (LenderSteamID = Json["response"].value("lender_steamid", 0)) != 0)
{
//LenderSteamID
}
}
API::Requests::Get().CreateGetRequest(fmt::format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=F2D86B1steamid={}&appid_playing=346110&format=json", "steam_id"), &GetCallback);
}
(edited)const auto banned = ArkApi::GetApiUtils().GetShooterGameMode()->BannedMapField();
for (auto& Elem : FruitMap)
{
FPlatformMisc::LocalPrint(
*FString::Printf(
TEXT("(%d, \"%s\")\n"),
Elem.Key,
*Elem.Value
)
);
}
FruitMap
to BannedMap
will it work ? TEXT("(%d, \"%s\")\n"),
bool bHas7 = FruitMap.Contains(7);
bool bHas8 = FruitMap.Contains(8);
// bHas7 == true
// bHas8 == false
//Steam API Request
void GetCallback(bool Success, std::string Result)
API::Requests::Get().CreateGetRequest(fmt::format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=B1steamid={}&appid_playing=346110&format=json", steam_id), &GetCallback);
{
void GetCallback(bool Success, std::string Result)
}
API::Requests::Get().CreateGetRequest(fmt::format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=162F2D86B1steamid={}&appid_playing=346110&format=json", steam_id), &GetCallback);
#include
the headerProject Settings
--> C/C++
--> General
and called Additional Includedirectories
(edited)#include "sqlite/sqlite_modern_cpp.h"
(edited)ArkPluginLibrary.lib
from? Even the whole Library?()()
- I think you can figgure it out on your own ARKPluginLibray
fix it first and then generate a static Library from it to later include it into your current projectvoid Hook_AShooterGameMode_StartNewShooterPlayer(AShooterGameMode* _this, APlayerController* new_player,
bool force_create_new_player_data, bool is_from_login,
FPrimalPlayerCharacterConfigStruct* char_config,
UPrimalPlayerData* ark_player_data)
(edited) UShooterCheatManager* cheatManager = static_cast<UShooterCheatManager*>(OtherPlayer->CheatManagerField());
if (cheatManager)
{
}
(edited)std::fstream file(config_path, fstream::out);
01/14/19 20:46 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
01/14/19 20:51 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
01/14/19 20:56 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
01/14/19 21:17 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
01/14/19 21:22 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
01/14/19 21:27 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
01/14/19 21:32 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
01/14/19 21:37 [ArkShop][error] (d:\programs\ark\plugins\arkshop\arkshop\private\points.cpp ArkShop::Points::GetPoints) Unexpected DB error not all rows extracted
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRANSACTION' at line 1
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AUTOINCREMENT,
`SteamId` integer DEFAULT 0,
`Groups` text DEFAULT 'Default,' C' at line 2
AUTO_INCREMENT
ERROR 1101 (42000) at line 1: BLOB, TEXT, GEOMETRY or JSON column 'Groups' can't have a default value
ERROR 1273 (HY000) at line 1: Unknown collation: 'NOCASE'
COLLATE NOCASE
ERROR 1062 (23000) at line 6: Duplicate entry '1' for key 'PRIMARY'
`CREATE TABLE IF NOT EXISTS `Players` (`Id`integer NOT NULL PRIMARY KEY AUTO_INCREMENT,`SteamId`integer DEFAULT 0,`Groups`text);`
`CREATE TABLE IF NOT EXISTS `Groups` (`Id`integer NOT NULL PRIMARY KEY AUTO_INCREMENT,`GroupName`text NOT NULL,`Permissions` text);`
(edited)CREATE TABLE
command from your SQL file. It will work then DELETE FROM PermissionGroups WHERE Id = <ID OF YOUR GROUP>
(edited) {
db_.execute(fmt::format("DELETE FROM PermissionGroups WHERE GroupName = '?';", group.ToString()));
}
UPDATE Players SET PermissionGroups = '' WHERE PermissionGroups LIKE "%<YOURGROUP>%";
Though it's not 100% perfect. if some has the group and something else they will loose the other groups. But i yeah it's something that could be for use.bool Hook_APrimalDinoCharacter_CancelCurrentAttack(APrimalDinoCharacter* _this, bool bStopCurrentAttackAnim, float AttackAnimBlendOutTime, AController* EventInstigator, AShooterPlayerController* player_controller)
bool Hook_APrimalDinoCharacter_CancelCurrentAttack(APrimalDinoCharacter* _this, bool bStopCurrentAttackAnim, float AttackAnimBlendOutTime)
DECLARE_HOOK(APrimalDinoCharacter_CancelCurrentAttack, bool, APrimalDinoCharacter*, bool, float);
bool Hook_APrimalDinoCharacter_CancelCurrentAttack(APrimalDinoCharacter* _this, bool bStopCurrentAttackAnim, float AttackAnimBlendOutTime)
{
return APrimalDinoCharacter_CancelCurrentAttack_original(_this, bStopCurrentAttackAnim, AttackAnimBlendOutTime);
}
ArkApi::GetHooks().SetHook("APrimalDinoCharacter.CancelCurrentAttack", &Hook_APrimalDinoCharacter_CancelCurrentAttack, &APrimalDinoCharacter_CancelCurrentAttack_original);
ArkApi::GetHooks().DisableHook("APrimalDinoCharacter.CancelCurrentAttack", &Hook_APrimalDinoCharacter_CancelCurrentAttack);
DECLARE_HOOK(APrimalDinoCharacter_CanAttack, bool, APrimalDinoCharacter*, int);
DECLARE_HOOK(APrimalDinoCharacter_DoAttack, bool, APrimalDinoCharacter*, int, bool, bool);
?bool Hook_APrimalDinoCharacter_DoAttack(APrimalDinoCharacter* _this, int AttackIndex, bool bSetCurrentAttack, bool bInterruptCurrentAttack)
bool Hook_APrimalDinoCharacter_DoAttack(APrimalDinoCharacter* _this, int AttackIndex, bool bSetCurrentAttack, bool bInterruptCurrentAttack)
UWorld* world = ArkApi::GetApiUtils().GetWorld();
TArray<AActor*> new_actors;
TArray<AActor*> actors_ignore;
TArray<TEnumAsByte<enum EObjectTypeQuery>> types;
UKismetSystemLibrary::SphereOverlapActors_NEW(world, _this->RootComponentField()->RelativeLocationField(),
static_cast<float>((DinoPassiveProtection::MinimumEnemyStructureDistanceInFoundations * 300)), &types,
APrimalStructure::GetPrivateStaticClass(), &actors_ignore,
&new_actors);
for (const auto& actor : new_actors)
{
APrimalStructure* structure = static_cast<APrimalStructure*>(actor);
//Log::GetLog()->warn(FVector::Distance(_this->RootComponentField()->RelativeLocationField(), actor->RootComponentField()->RelativeLocationField()));
if (structure->TargetingTeamField() != _this->TargetingTeamField())
{
isNotNearEnemyStructures = false;
break;
}
else
{
isNotNearEnemyStructures = true;
}
}
bool IsEnemyStructureNear(AShooterPlayerController* player_controller, int radius)
{
UWorld* world = ArkApi::GetApiUtils().GetWorld();
TArray<AActor*> new_actors;
TArray<AActor*> actors_ignore;
TArray<TEnumAsByte<enum EObjectTypeQuery>> types;
UKismetSystemLibrary::SphereOverlapActors_NEW(world, ArkApi::IApiUtils::GetPosition(player_controller),
static_cast<float>(radius), &types,
APrimalStructure::GetPrivateStaticClass(), &actors_ignore,
&new_actors);
for (const auto& actor : new_actors)
{
APrimalStructure* structure = static_cast<APrimalStructure*>(actor);
if (structure->TargetingTeamField() != player_controller->TargetingTeamField())
return true;
}
return false;
}
std::string apiKey = config["APIKey"];
API::Requests::Get().CreateGetRequest(fmt::format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key={}&steamid={}&appid_playing=346110&format=json",
apiKey, steamId), std::function<void > & isPlayingSharedGame);
i have something like this but i'm retarded and cant get it to workbool CreateGetRequest(const std::string& url, const std::function<void(bool, std::string)>& callback);
Api::Requests::CreateGetRequest(std::string& url, const std::function<void(bool, std::string)>& isPlayingSharedGame);
API::Requests::Get().CreateGetRequest(fmt::format(
"http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key={}&steamid={}&appid_playing=346110&format=json",
apiKey, steamId), std::bind(& isPlayingSharedGame);
bool CreateGetRequest(const std::string& url, const std::function<void(bool, std::string)>& callback);
API::Requests::Get().CreateGetRequest(std::string& url, const std::function<void(bool, std::string)>& isPlayingSharedGame);
Request.h
but thats the updated code:void Hook_AShooterGameMode_PreLogin(AShooterGameMode* _this, FString* Options, FString* Address,
TSharedPtr<FUniqueNetId, 0>* UniqueId, FString* authToken, FString* ErrorMessage)
{
const uint64 steamId = static_cast<FUniqueNetIdSteam*>(UniqueId->Get())->UniqueNetId;
std::string apiKey = config["APIKey"];
FString url = FString::Format(
"http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key={}&steamid={}&appid_playing=346110&format=json",
apiKey, steamId);
API::Requests::Get().CreateGetRequest(url.ToString(), [steamId](bool success, std::string response)
{
isPlayingSharedGame(success, response, steamId);
});
AShooterGameMode_PreLogin_original(_this, Options, Address, UniqueId, authToken, ErrorMessage);
}
void isPlayingSharedGame(bool success, std::string response, uint64 steamId)
{
if (success)
{
if (!response.empty() && !response.find("Forbidden"))
{
nlohmann::json parsedResponse = nlohmann::json::parse(response);
const uint64 lenderSteamId = std::stoull(
static_cast<std::string>(parsedResponse["response"]["lender_steamid"]), nullptr);
if (lenderSteamId != 0)
{
if (!VectorContains(steamId))
{
familysharing.push_back(steamId);
}
}
}
else
{
Log::GetLog()->warn("Please check your config for a valid API Key");
}
}
else
{
Log::GetLog()->warn("API Limit reached(100.000 per 24h) / Steam API down");
}
}
3.0
brought us a new library called CURL (you might know it from linux).. ofc the usage of the library is differentARK-Server-API-master\out_lib
float Hook_APrimalDinoCharacter_TakeDamage(APrimalDinoCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
ACharacter* character = EventInstigator->CharacterField();
const int enemy_min_distance = AntiFireBreath::config["General"]["EnemyStructureMinDistance"];
if (character != nullptr && character && character->IsA(APrimalDinoCharacter::GetPrivateStaticClass()))
{
APrimalDinoCharacter* dino = static_cast<APrimalDinoCharacter*>(character);
FString descr;
dino->GetDinoDescriptiveName(&descr);
if (descr.Contains(L"Dragon")
|| descr.Contains(L"Raphus")
|| descr.Contains(L"Primordius"))
return 0;
}
return APrimalDinoCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
{
return APrimalDinoCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
if(something){----this is a block---}
if (EventInstigator && EventInstigator->CharacterField())
{
ACharacter* character = EventInstigator->CharacterField();
if (character != nullptr && character && character->IsA(APrimalDinoCharacter::GetPrivateStaticClass()))
{
APrimalDinoCharacter* dino = static_cast<APrimalDinoCharacter*>(character);
FString descr;
dino->GetDinoDescriptiveName(&descr);
if (descr.Contains(L"Direwolf")
|| descr.Contains(L"Wyvern")
|| descr.Contains(L"Broodmother"))
{
UWorld* world = ArkApi::GetApiUtils().GetWorld();
TArray<AActor*> new_actors;
TArray<AActor*> actors_ignore;
TArray<TEnumAsByte<enum EObjectTypeQuery>> types;
UKismetSystemLibrary::SphereOverlapActors_NEW(world, EventInstigator->RootComponentField()->RelativeLocationField(),
static_cast<float>((AntiFireBreath::MinimumEnemyStructureDistanceInFoundations * 300)), &types,
APrimalStructure::GetPrivateStaticClass(), &actors_ignore,
&new_actors);
for (const auto& actor : new_actors)
{
APrimalStructure* structure = static_cast<APrimalStructure*>(actor);
Log::GetLog()->warn(FVector::Distance(_this->RootComponentField()->RelativeLocationField(), actor->RootComponentField()->RelativeLocationField()));
if (structure->TargetingTeamField() != _this->TargetingTeamField())
{
return 0;
}
else
{
return APrimalDinoCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
}
}
}
}
if (structure->TargetingTeamField() !=EventInstigator->TargetingTeamField())
1>dllmain.cpp
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(24): error C2039: '_InterlockedIncrement64': is not a member of '`global namespace''
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(24): error C3861: '_InterlockedIncrement64': identifier not found
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(48): error C2039: '_InterlockedDecrement64': is not a member of '`global namespace''
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(48): error C3861: '_InterlockedDecrement64': identifier not found
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(72): error C2039: '_InterlockedExchangeAdd64': is not a member of '`global namespace''
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(72): error C3861: '_InterlockedExchangeAdd64': identifier not found
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(95): error C2039: '_InterlockedExchange64': is not a member of '`global namespace''
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(95): error C3861: '_InterlockedExchange64': identifier not found
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(112): error C2039: '_InterlockedExchange64': is not a member of '`global namespace''
1>d:\wf\arkmodding\ark-server-api\version\core\public\api\ue\windows\windowsplatformatomics.h(112): error C3861: '_InterlockedExchange64': identifier not found
if (_this->TargetingTeamField() > 10000 && character != nullptr && character && character->IsA(APrimalDinoCharacter::GetPrivateStaticClass()))
?if (EventInstigator && EventInstigator->CharacterField())
{
//Do the things
}
return original; //if EventInstigator = NULL
if (EventInstigator=nullptr)
{
return APrimalDinoCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
==
if (!EventInstigator)
if (EventInstigator && EventInstigator->CharacterField())
{
//Do the things
}
return APrimalDinoCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
GetDamageInstigator(AController * InstigatedBy, UDamageType * DamageType)
char& CurrentAttackIndexField() { return *GetNativePointerField<char*>(this, "APrimalDinoCharacter.CurrentAttackIndex"); }
char& LastAttackIndexField() { return *GetNativePointerField<char*>(this, "APrimalDinoCharacter.LastAttackIndex"); }
(edited) "Id INT NOT NULL AUTO_INCREMENT,"
"SteamId BIGINT(11) NOT NULL DEFAULT 0,"
"Kits VARCHAR(256) NOT NULL DEFAULT '{}',"
"Points INT DEFAULT 0,"
"TotalSpent INT DEFAULT 0,"
"PRIMARY KEY(Id),"
"UNIQUE INDEX SteamId_UNIQUE (SteamId ASC)); ");
CREATE TABLE IF NOT EXISTS ArkShopPlayers ("
"Id INT NOT NULL AUTO_INCREMENT,"
"SteamId BIGINT(11) NOT NULL DEFAULT 0,"
"Kits VARCHAR(256) NOT NULL DEFAULT '{}',"
"Points INT DEFAULT 0,"
"TotalSpent INT DEFAULT 0,"
"PRIMARY KEY(Id),"
"UNIQUE INDEX SteamId_UNIQUE (SteamId ASC));
struct APrimalRaft : APrimalDinoCharacter
{
// Functions
bool IsAnchored() { return NativeCall<bool>(this, "APrimalRaft.IsAnchored"); }
static UClass * GetPrivateStaticClass() { return NativeCall<UClass *>(nullptr, "APrimalRaft.GetPrivateStaticClass"); }
static UClass * StaticClass() { return NativeCall<UClass *>(nullptr, "APrimalRaft.StaticClass"); }
};
APrimalRaft
to your config.json of your APIAPrimalRaft
too (edited)IsInLandClaimedFlagRadius
GetLandClaim
From APrimalStructureClaimFlag might help youPlayerData[player->LinkedPlayerIDField()].NextVoteTime[VoteSiteIndex] = nNow + 30;
VERSION: 15.67
ShooterGameServer.exe!compress2() (0x00007ff7f61b100b) + 0 bytes [UnknownFile:0]
ParkedShipProtection.dll!UnknownFunction (0x00007ffcfea88e2c) + 0 bytes [UnknownFile:0]
ShooterGameServer.exe!UGameplayStatics::ApplyDamage() (0x00007ff7f7755d9d) + 0 bytes [h:\yarkupdatelivereal\engine\source\runtime\engine\private\gameplaystatics.cpp:393]
ShooterGameServer.exe!APrimalStructureShipHull::ApplyPlankDecayDamageInterval() (0x00007ff7f66def25) + 0 bytes [h:\yarkupdatelivereal\projects\shootergame\source\shootergame\private\primalstructureshiphull.cpp:195]
ShooterGameServer.exe!APrimalStructureShipHull::TickHull() (0x00007ff7f66e86d2) + 0 bytes [h:\yarkupdatelivereal\projects\shootergame\source\shootergame\private\primalstructureshiphull.cpp:1250]
ShooterGameServer.exe!APrimalRaft::Tick() (0x00007ff7f6622fd8) + 0 bytes [h:\yarkupdatelivereal\projects\shootergame\source\shootergame\private\primalraft.cpp:855]
ShooterGameServer.exe!AActor::TickActor() (0x00007ff7f76acbbe) + 0 bytes [h:\yarkupdatelivereal\engine\source\runtime\engine\private\actor.cpp:775]
ShooterGameServer.exe!FActorTickFunction::ExecuteTick() (0x00007ff7f7693d7a) + 27 bytes [h:\yarkupdatelivereal\engine\source\runtime\engine\private\actor.cpp:150]
ShooterGameServer.exe!FTickTaskManager::StartFrame() (0x00007ff7f7940383) + 41 bytes [h:\yarkupdatelivereal\engine\source\runtime\engine\private\ticktaskmanager.cpp:871]
ShooterGameServer.exe!UWorld::Tick() (0x00007ff7f77e3595) + 24 bytes [h:\yarkupdatelivereal\engine\source\runtime\engine\private\leveltick.cpp:1209]
ShooterGameServer.exe!UGameEngine::Tick() (0x00007ff7f77846c2) + 0 bytes [h:\yarkupdatelivereal\engine\source\runtime\engine\private\gameengine.cpp:1181]
NewPlayer->God
UWorld* world = ArkApi::GetApiUtils().GetWorld();
TArray<AActor*> new_actors;
TArray<AActor*> actors_ignore;
TArray<TEnumAsByte<enum EObjectTypeQuery>> types;
UKismetSystemLibrary::SphereOverlapActors_NEW(world, _this->RootComponentField()->RelativeLocationField(),
10000, &types, APrimalStructureClaimFlag::GetPrivateStaticClass(), &actors_ignore, &new_actors);
UKismetSystemLibrary::SphereOverlapActors_NEW(world, _this->RootComponentField()->RelativeLocationField(),
float Hook_APrimalDinoCharacter_TakeDamage(APrimalDinoCharacter* _this, float Damage, FDamageEvent* DamageEvent,
AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsShip())
{
//check for Friendly Claim Flags nearby
UWorld* world = ArkApi::GetApiUtils().GetWorld();
TArray<AActor*> new_actors;
TArray<AActor*> actors_ignore;
TArray<TEnumAsByte<enum EObjectTypeQuery>> types;
UKismetSystemLibrary::SphereOverlapActors_NEW(world, _this->RootComponentField()->RelativeLocationField(),
10000, &types, APrimalStructureClaimFlag::GetPrivateStaticClass(), &actors_ignore, &new_actors);
for (const auto& actor : new_actors)
{
APrimalStructureClaimFlag* claimFlag = static_cast<APrimalStructureClaimFlag*>(actor);
//Log::GetLog()->warn(FVector::Distance(_this->RootComponentField()->RelativeLocationField(), actor->RootComponentField()->RelativeLocationField()));
if (claimFlag->TargetingTeamField() == _this->TargetingTeamField())
{
if (FVector::Distance(_this->RootComponentField()->RelativeLocationField(), claimFlag->RootComponentField()->RelativeLocationField()) <= claimFlag->LandClaimRadiusField())
{
return APrimalDinoCharacter_TakeDamage_original(_this, 0, DamageEvent, EventInstigator, DamageCauser);
}
}
}
}
return APrimalDinoCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
(edited)RelativeLocationField
is also not null? APrimalStructureClaimFlag::GetPrivateStaticClass();
if (_this->GetAttachedToShip())
{
if (_this->GetAttachedToShip()->IsAnchored())
{
_this->GetAttachedToShip()->IsAnchored()
Sorry for marking it as spoiler - wanted to try out this feature.. lol
As you can see the function doesn't seems to be corrupted :D
void debugCommand(AShooterPlayerController* sender, FString* message, EChatSendMode::Type)
{
TArray<AActor*> actorsInSphere;
TArray<AActor*> actors_ignore;
TArray<TEnumAsByte<enum EObjectTypeQuery>> types;
UKismetSystemLibrary::SphereOverlapActors_NEW(ArkApi::GetApiUtils().GetWorld(), sender->DefaultActorLocationField(), 1000,
&types, nullptr, &actors_ignore, &actorsInSphere);
for(AActor* current: actorsInSphere)
{
if(current->IsA(APrimalRaft::StaticClass()))
{
ArkApi::GetApiUtils().SendChatMessageToAll("DEBUG", "Found a ship!");
auto* ship = static_cast<APrimalRaft*>(current);
if(ship && ship->IsAnchored())
{
ArkApi::GetApiUtils().SendChatMessageToAll("DEBUG", "which is anchored!");
}
}
}
}
(edited)struct APrimalRaft : APrimalDinoCharacter
{
static UClass * StaticClass() { return NativeCall<UClass *>(nullptr, "APrimalRaft.StaticClass"); }
bool IsAnchored() { return NativeCall<bool>(this, "APrimalRaft.IsAnchored"); }
};
"APrimalRaft",
to your config.json located in Win64 folder#include <Api/Atlas/Atlas.h>
#pragma comment(lib, "AtlasApi.lib")
DECLARE_HOOK(APrimalStructure_TakeDamage, float, APrimalStructure*, float, FDamageEvent*, AController*, AActor*);
struct APrimalRaft : APrimalDinoCharacter
{
// Functions
bool IsAnchored() { return NativeCall<bool>(this, "APrimalRaft.IsAnchored"); }
static UClass * GetPrivateStaticClass() { return NativeCall<UClass *>(nullptr, "APrimalRaft.GetPrivateStaticClass"); }
static UClass * StaticClass() { return NativeCall<UClass *>(nullptr, "APrimalRaft.StaticClass"); }
};
float Hook_APrimalStructure_TakeDamage(APrimalStructure* _this, float Damage, FDamageEvent* DamageEvent,
AController* EventInstigator, AActor* DamageCauser)
{
if (_this->GetAttachedToShip())
{
if(_this->GetAttachedToShip()->IsAnchored())
{
FString descr;
_this->GetHumanReadableName(&descr);
if (descr.Contains(L"plank") || descr.Contains(L"deck") || descr.Contains(L"hull"))
{
Log::GetLog()->warn("{}", descr.ToString());
Log::GetLog()->warn("{} took no damage!", descr.ToString());
return APrimalStructure_TakeDamage_original(_this, 0, DamageEvent, EventInstigator, DamageCauser);
}
}
}
return APrimalStructure_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
(edited)void Load()
{
Log::Get().Init("ParkedShipProtection");
ArkApi::GetHooks().SetHook("APrimalStructure.TakeDamage", &Hook_APrimalStructure_TakeDamage,
&APrimalStructure_TakeDamage_original);
}
void Unload()
{
ArkApi::GetHooks().DisableHook("APrimalStructure.TakeDamage", &Hook_APrimalStructure_TakeDamage);
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
Load();
break;
case DLL_PROCESS_DETACH:
Unload();
break;
}
return TRUE;
}
(edited) if(_this->GetAttachedToShip()->IsAnchored())
IsAttachedToShipInWetDock()
IsAttachedToShipInDryDock()
Anyone know the difference in a wet and dry dock?{
"APIKey": "Censored",
"KickMessage": "Family Shared Accounts Are Not Allowed on DopeArk, Please Connect With A Different Account!",
"Whitelist": []
}
APrimalCharacter::IsConscious()
might help void AutoKill(AShooterPlayerController* AttackerShooterController, FString* message, int mode)
{
if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsDead() || !AttackerShooterController->GetPlayerCharacter()->IsConscious() || AttackerShooterController->GetPlayerCharacter()->IsSitting(false)) return;
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (WeaponName.Contains(L"Handcuffs")) return;
}
if (!ArkApi::GetApiUtils().IsRidingDino(AttackerShooterController)) AttackerShooterController->GetPlayerCharacter()->Suicide();
}
if (!ArkApi::GetApiUtils().IsRidingDino(AttackerShooterController)) AttackerShooterController->GetPlayerCharacter()->Suicide();
AttackerShooterController->GetPlayerCharacter()->Suicide();
if (EventInstigator && EventInstigator->CharacterField())
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (_this->IsA(APlayerController::StaticClass()) && WeaponName.Contains(L"Armor Piercing"));
return Damage * 0.10;
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (EventInstigator && EventInstigator->CharacterField())
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (_this->IsA(APlayerController::StaticClass()) && WeaponName.Contains(L"Armor Piercing"));
Damage = Damage * 0.10;
}return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
}
_this->IsA(APlayerController::StaticClass())
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (EventInstigator && _this->IsA(APlayerController::StaticClass()))
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (WeaponName.Contains(L"Armor Piercing"));
Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString());
Damage = Damage * 0.10;
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
GetOwnerController
if (_this->GetOwnerController && WeaponName.Contains(L"Armor Piercing"));
_this
does not have anything in common with EventInstigator
besides that event.. _this->GetOwnerController
what arguments should i provide for thisc:\users\avtoj\source\repos\apbalancer\apbalancer\apbalancer.cpp(23): warning C4551: function call missing argument list
(edited) // RCONCommand
int RCONRolls = LootBoxes::config["LootBoxes"][lootbox->ToString()]["RCONCommands"]["Count"];
for (int i = 0; i < RCONRolls; i++) {
const nlohmann::json itemArray = LootBoxes::config["LootBoxes"][lootbox->ToString()];
auto itemIter = itemArray.find("RCONCommands");
const nlohmann::basic_json<> item = itemIter.value();
auto possibleCommands = item.value("PossibleCommands", nlohmann::json::array());
int size = possibleCommands.size();
std::random_device rd;
std::mt19937 eng(rd());
std::uniform_int_distribution<> rand(0, size - 1);
nlohmann::json selectedCommand = possibleCommands.at(rand(eng));
std::string command = selectedCommand["Command"];
int MinPointsShop = selectedCommand["MinPointShop"];
int MaxPointsShop = selectedCommand["MaxPointShop"];
std::uniform_int_distribution<> points(MinPointsShop, MaxPointsShop);
int shoppoints = points(eng);
uint64 steamId = ArkApi::GetApiUtils().GetSteamIdFromController(sender);
// Use the ArkShop API to add points
ArkShop::Points::AddPoints(shoppoints, steamId);
}
std::string command = selectedCommand["Command"];
int MinPointsShop = selectedCommand["MinPointShop"];
int MaxPointsShop = selectedCommand["MaxPointShop"];
std::uniform_int_distribution<> points(MinPointsShop, MaxPointsShop);
int shoppoints = points(eng);
uint64 steamId = ArkApi::GetApiUtils().GetSteamIdFromController(sender);
// Use the ArkShop API to add points
ArkShop::Points::AddPoints(shoppoints, steamId);
DECLARE_HOOK(AShooterGameMode_Logout, void, AShooterGameMode*, AController *);
DECLARE_HOOK(AShooterGameMode_PostLogin, void, AShooterGameMode*, APlayerController *);
Can i use these hooks for detect player entering/leaving the game?GetOwnerController
? (edited)float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (EventInstigator && EventInstigator->CharacterField())
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
APlayerController descr;
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (_this->IsA(AShooterPlayerController::GetPrivateStaticClass()) && WeaponName.Contains(L"Armor Piercing"));
Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString());
Damage = Damage * 0.10;
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (EventInstigator && EventInstigator->CharacterField())
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
APlayerController descr;
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (_this->IsA(AShooterPlayerController::GetPrivateStaticClass()) && WeaponName.Contains(L"Armor Piercing"));
{
Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString());
Damage = Damage * 0.10;
}
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (EventInstigator && EventInstigator->CharacterField())
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
APlayerController descr;
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (_this->IsA(AShooterPlayerController::GetPrivateStaticClass()) && WeaponName.Contains(L"Armor Piercing"))
{
Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString());
Damage = Damage * 0.10;
}
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
virtual
modifier internally I guess float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (EventInstigator && EventInstigator->CharacterField())
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator);
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
{
FString WeaponName;
AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
if (_this->IsA(AShooterPlayerController::GetPrivateStaticClass()) && WeaponName.Contains(L"Armor Piercing"))
{
Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString());
Damage = Damage * 0.10;
}
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
_this->IsA(AShooterPlayerController::GetPrivateStaticClass())
(edited)if (_this->IsA(APrimalDinoCharacter::GetPrivateStaticClass()) && _this->TargetingTeamField() == 0)
_this->IsA(APrimalDinoCharacter::GetPrivateStaticClass()) && _this->TargetingTeamField() < 10000
if (_this != nullptr && WeaponName.Contains(L"Sword") != WeaponName.Contains(L"Tek Sword"))
dino->bUseBPDoHarvestAttack()()
dino->bUseBPDoHarvestAttack()()
will just return if a dino can use a harvest attack. It's not a hook on a functionAPrimalDinoCharacter->DoAttack()
function and see if AttackIndex
changes based on which attack is used.APrimalDinoCharacter* _this,
bool Hook_APrimalDinoCharacter_DoAttack(APrimalDinoCharacter* _this, int AttackIndex, bool bSetCurrentAttack, bool bInterruptCurrentAttack)
Log::GetLog()->warn("Attack Index: {}", AttackIndex);
(edited)float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()))
{
if (!_this->IsDead() && !_this->IsConscious() && _this != nullptr)
{
_this->Suicide();
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
bool meetsrequirements;
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsDead() && !_this->IsConscious())
{
meetsrequirements = true;
}
else
{
meetsrequirements = false;
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
void AutoKill(AShooterPlayerController* AttackerShooterController, FString* message, int mode)
{
if (meetsrequirements=true) AttackerShooterController->GetPlayerCharacter()->Suicide();
}
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsDead() && !_this->IsConscious())
{
API::Timer::Get().DelayExecute(&_this->Suicide, 10);
}
}
>c:\users\avtoj\source\repos\autokill\autokill\autokill.cpp(15): error C3083: 'Timer': the symbol to the left of a '::' must be a type
1>c:\users\avtoj\source\repos\autokill\autokill\autokill.cpp(15): error C2039: 'Get': is not a member of 'API'
1>c:\users\avtoj\desktop\arkserver\ark-server-api-master\version\core\public\tools.h(36): note: see declaration of 'API'
1>c:\users\avtoj\source\repos\autokill\autokill\autokill.cpp(15): error C3861: 'Get': identifier not found
1>c:\users\avtoj\source\repos\autokill\autokill\autokill.cpp(15): error C2276: '&': illegal operation on bound member function expression
void TimerCallBack(int arg1, int arg2)
{
Log::GetLog()->info("CallBack Executed Args: {}, {}", arg1, arg2);
}
void TimerCallBack(int arg1, int arg2)
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsDead() && !_this->IsConscious())
{
API::Timer::Get().DelayExecute(&TimerCallBack, 10);
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
void TimerCallBack(APrimalCharacter* _this)
{
_this->Suicide();
}
c:\users\avtoj\desktop\arkserver\ark-server-api-master\version\core\public\timer.h(31): error C2664: 'void API::Timer::DelayExecuteInternal(const std::function<void (void)> &,int)': cannot convert argument 1 from 'std::_Binder<std::_Unforced,void (__cdecl *const &)(APrimalCharacter *)>' to 'const std::function<void (void)> &'
1>c:\users\avtoj\desktop\arkserver\ark-server-api-master\version\core\public\timer.h(30): note: Reason: cannot convert from 'std::_Binder<std::_Unforced,void (__cdecl *const &)(APrimalCharacter *)>' to 'const std::function<void (void)>'
1>c:\users\avtoj\desktop\arkserver\ark-server-api-master\version\core\public\timer.h(30): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>c:\users\avtoj\source\repos\autokill\autokill\autokill.cpp(19): note: see reference to function template instantiation 'void API::Timer::DelayExecute<void(__cdecl *)(APrimalCharacter *),>(const Func &,int)' being compiled
void TimerCallBack(APrimalCharacter* _this)
{
_this->Suicide();
}
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsDead() && !_this->IsConscious())
{
API::Timer::Get().DelayExecute(&TimerCallBack, 10);
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
void TimerCallBack(APrimalCharacter* _this)
{
_this->Suicide();
}
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsDead() && !_this->IsConscious())
{
API::Timer::Get().DelayExecute(&TimerCallBack, 10,_this);
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
TeamSelector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl Permissions::IsPlayerInGroup(unsigned __int64,class FString const &)" (__imp_?IsPlayerInGroup@Permissions@@YA_N_KAEBVFString@@@Z)
1>TeamSelector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::optional<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > __cdecl Permissions::AddPlayerToGroup(unsigned __int64,class FString const &)" (__imp_?AddPlayerToGroup@Permissions@@YA?AV?$optional@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@_KAEBVFString@@@Z)
1>C:\Users\avtoj\source\repos\TeamSelector\x64\Release\TeamSelector.dll : fatal error LNK1120: 2 unresolved externals
TeamSelector.obj : error LNK2001: unresolved external symbol "class FString __cdecl TeamSelector::GetText(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?GetText@TeamSelector@@YA?AVFString@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>C:\Users\avtoj\source\repos\TeamSelector\x64\Release\TeamSelector.dll : fatal error LNK1120: 1 unresolved externals
void Broadcaster::StartBroadcasting()
{
m_is_working = true;
m_thread.reset(new std::thread(&Broadcaster::m_InternalFunc, this)); // Stucks here
}
This code is works well in other console projectLog::GetLog()->info("Before start timer"); // This executes
API::Timer::Get().RecurringExecute([]() {
Log::GetLog()->info("Entering into timer func"); // This doesn't execute
if(shutdown_process == true)
{
return;
}
TArray<uint64> players = database->GetPlayerIDs();
Log::GetLog()->info("After request to DB");
TArray<Rank> ranks = config.BuildRankList();
for(const auto steam_id : players)
{
if(auto* player_controller = ArkApi::GetApiUtils().FindPlayerFromSteamId(steam_id); player_controller != nullptr)
{
TArray<FString> player_groups = Permissions::GetPlayerGroups(steam_id);
uint64 total_play_time = (realtime_cache->GetPlayTime(steam_id) + database->GetPlayTime(steam_id)) / 60;
for(const auto& rank : ranks)
{
if(total_play_time >= rank.cost && !player_groups.Contains(FString(rank.name.c_str())))
{
ArkApi::GetApiUtils().SendChatMessage(player_controller, config.GetMessageText("Sender"), *config.GetMessageText("BroadcastMessage"));
break;
}
}
}
}
}, config.GetBroadcastInterval(), -1, true);
database it's wrapper for daotk::mysql::connection protected by mutex
realtime_cache it's simple storage for online players. Also protected by mutex
Nothing executes here and plugin loading stops. If i comment RecurringExecute then works fine.inline uint64 GetBroadcastInterval() const
{
std::lock_guard<std::mutex> guard(m_mutex);
return (static_cast<uint64>(m_config["General"]["BroadcastInterval"]) * static_cast<uint64>(60));
}
std::cout << (static_cast<unsigned long long>(config["General"]["BroadcastInterval"]) * static_cast<unsigned long long>(60)) << std::endl;
std::cout << (static_cast<unsigned long long>(config["General"]["BroadcastInterval"]) * static_cast<unsigned long long>(60)) << std::endl;
RecurringExecute, of course, in the gamevoid TimerCallBack(APrimalCharacter* _this)
{
_this->Suicide();
}
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsDead() && !_this->IsConscious())
{
API::Timer::Get().DelayExecute(&TimerCallBack, 10,_this);
}
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
APrimalStructureClaimFlag::GetPrivateStaticClass()
sometimes causes the server to crash I agree - but not any time. Have you added the APrimalStructureClaimFlag to your config.json of the API?StaticClassField
void TimerCallBack(APrimalCharacter* _this, AShooterPlayerController * target)
{
while (!_this->IsConscious() && !_this->IsDead())
{
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(target);
AShooterPlayerController* player = (AShooterPlayerController*)target;
uint64 steamId = ArkApi::GetApiUtils().GetSteamIdFromController(player);
player->GetPlayerCharacter()->Suicide();
}
}
(edited)float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
AShooterPlayerController* target = _this->GetCharacterController();
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
API::Timer::Get().DelayExecute(&TimerCallBack, 10, _this, target);
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
loat Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
if(!_this->IsConscious() && !_this->IsDead())
{
_this -> Suicide();
}
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
(edited)float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsConscious() && !_this->IsDead)
{
_this->Suicide();
}
}return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
bool suicide;
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()) && _this != nullptr)
{
if (!_this->IsConscious() && !_this->IsDead())
{
_this->Suicide();
suicide = true;
}
else
{
suicide = false;
}
}
if (suicide == false)
{
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
}
bool suicide;
float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
if (_this != nullptr)
{
if (_this->IsA(AShooterCharacter::GetPrivateStaticClass()))
{
if (!_this->IsConscious() && !_this->IsDead())
{
_this->Suicide();
suicide = true;
}
else
{
suicide = false;
}
}
}
if (suicide == false)
{
return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
}
}
int Hook_APrimalStructure_IsAllowedToBuild(APrimalStructure* _this, APlayerController* PC, FVector AtLocation, FRotator AtRotation, FPlacementData* OutPlacementData, bool bDontAdjustForMaxRange, FRotator PlayerViewRotation, bool bFinalPlacement)
{
const FString path_name = GetBlueprint(_this);
if (bFinalPlacement && PC != nullptr)
{
if (path_name.ToString() == "Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Pipes/PrimalItemStructure_StonePipeIntake'")
{
return 211;
}
}
return APrimalStructure_IsAllowedToBuild_original(_this, PC, AtLocation, AtRotation, OutPlacementData,
bDontAdjustForMaxRange, PlayerViewRotation, bFinalPlacement);
}
AllowIntakeToPlaceWithoutWater=true
[StructuresPlus]
in gameusersettings.iniSeverity Code Description Project File Line Suppression State
Error C2039 '_snprintf': is not a member of 'std' LootBoxes c:\users\avtoj\desktop\arkserver\ark-server-api-master\version\core\public\json.hpp 11146
if ((codepoint <= 0x1F) or (ensure_ascii and (codepoint >= 0x7F))) {
if (codepoint <= 0xFFFF) {
std::snprintf(string_buffer.data() + bytes, 7, "\\u%04x",
static_cast<uint16_t>(codepoint));
bytes += 6;
}
else {
std::snprintf(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x",
static_cast<uint16_t>(0xD7C0 + (codepoint >> 10)),
static_cast<uint16_t>(0xDC00 + (codepoint & 0x3FF)));
bytes += 12;
}
}
to
if ((codepoint <= 0x1F) or (ensure_ascii and (codepoint >= 0x7F))) {
if (codepoint <= 0xFFFF) {
snprintf(string_buffer.data() + bytes, 7, "\\u%04x",
static_cast<uint16_t>(codepoint));
bytes += 6;
}
else {
snprintf(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x",
static_cast<uint16_t>(0xD7C0 + (codepoint >> 10)),
static_cast<uint16_t>(0xDC00 + (codepoint & 0x3FF)));
bytes += 12;
}
}
(edited)#include "json.hpp"
{
"FullName":"PluginName",
"Description":"Does things",
"Version":1.0,
"MinApiVersion":1.0,
"Dependencies": [
"ArkShop"
]
}
OriginBegone.dll
is that your plugin? (edited)03/06/19 08:01 [ShopRewards][warning] Event Manager Detected - Disabling Player rewards for people in EventManager!
std::string getHWID() {
HW_PROFILE_INFO hwProfileInfo;
std::string hwid;
Log::GetLog()->error("getting hwid");
if (GetCurrentHwProfile(&hwProfileInfo)) {
//Fhwid = hwProfileInfo.szHwProfileGuid;
std::wstring Whwid(hwProfileInfo.szHwProfileGuid);
// your new String
std::string Shwid(Whwid.begin(), Whwid.end());
hwid = Shwid;
}
else
hwid = "ERROR_CANT_RETRIEVE_HWID_VALUES"; //intentionally longer than the column allows - see if this is breakable or ok
//make sure field in logging table allows for longer length to record these instances- LEN is 31 so go with 32
hwid.erase(std::remove(hwid.begin(), hwid.end(), '{'), hwid.end());
hwid.erase(std::remove(hwid.begin(), hwid.end(), '}'), hwid.end());
hwid.erase(std::remove(hwid.begin(), hwid.end(), '-'), hwid.end());
std::transform(hwid.begin(), hwid.end(), hwid.begin(), ::toupper);
Log::GetLog()->error("returning hwid >" + hwid + "<");
return hwid;
}
#include <windows.h>
#include <stdio.h>
...
{
getHWID();
...
use
...
{
std::string currenthwid = getHWID();
...
void Unload();
std::string getHWID()
{
HW_PROFILE_INFO hwProfileInfo;
std::string hwid;
Log::GetLog()->error("getting hwid");
if (GetCurrentHwProfile(&hwProfileInfo)) {
//Fhwid = hwProfileInfo.szHwProfileGuid;
std::wstring Whwid(hwProfileInfo.szHwProfileGuid);
// your new String
std::string Shwid(Whwid.begin(), Whwid.end());
hwid = Shwid;
}
else
hwid = "ERROR_CANT_RETRIEVE_HWID_VALUES"; //intentionally longer than the column allows - see if this is breakable or ok
//make sure field in logging table allows for longer length to record these instances- LEN is 31 so go with 32
hwid.erase(std::remove(hwid.begin(), hwid.end(), '{'), hwid.end());
hwid.erase(std::remove(hwid.begin(), hwid.end(), '}'), hwid.end());
hwid.erase(std::remove(hwid.begin(), hwid.end(), '-'), hwid.end());
std::transform(hwid.begin(), hwid.end(), hwid.begin(), ::toupper);
Log::GetLog()->error("Your HWID >" + hwid + "<");
Unload();
return hwid;
}
Hook_UWorld_InitWorld
UObject* object = Globals::StaticLoadObject(UObject::StaticClass(), nullptr, blueprint, nullptr, 0, 0, true);
that is the statement that crashes it since the last ark update ....std::string getHWID()
{
HW_PROFILE_INFO hwProfileInfo;
std::string hwid;
Log::GetLog()->error("getting hwid");
if (GetCurrentHwProfile(&hwProfileInfo)) {
//Fhwid = hwProfileInfo.szHwProfileGuid;
std::wstring Whwid(hwProfileInfo.szHwProfileGuid);
// your new String
std::string Shwid(Whwid.begin(), Whwid.end());
hwid = Shwid;
}
else
hwid = "ERROR_CANT_RETRIEVE_HWID_VALUES"; //intentionally longer than the column allows - see if this is breakable or ok
//make sure field in logging table allows for longer length to record these instances- LEN is 31 so go with 32
hwid.erase(std::remove(hwid.begin(), hwid.end(), '{'), hwid.end());
hwid.erase(std::remove(hwid.begin(), hwid.end(), '}'), hwid.end());
hwid.erase(std::remove(hwid.begin(), hwid.end(), '-'), hwid.end());
std::transform(hwid.begin(), hwid.end(), hwid.begin(), ::toupper);
Log::GetLog()->error("Your HWID >" + hwid + "<");
if (hwid == whatever)
{
Log::GetLog()->error("HWID check passed!");
}
return hwid;
}
HW_PROFILE_INFOA hwProfileInfo;
std::string hwid;
if (GetCurrentHwProfileA(&hwProfileInfo)) {
std::string Shwid(hwProfileInfo.szHwProfileGuid);
hwid = Shwid;
}
(edited)if (hwid ==myhwid)
{
Log::GetLog()->error("HWID check passed!");
}
[/script/onlinesubsystemutils.ipnetdriver]
NetServerMaxTickRate=20
LanServerMaxTickRate=20
FString result;
FString command = FString::Format(L"ScriptCommand tcsar addarctotal steamid={} points={}", SteamID, Points);
player->ConsoleCommand(&result, &command, true);