Skip to content

Commit

Permalink
Merge branch '1.2.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAshenWolf committed Mar 3, 2022
2 parents b79e844 + 3d7bd3e commit c85e29f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
21 changes: 13 additions & 8 deletions Source/WakaTimeForUE4/Private/WakaTimeForUE4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ void FWakaTimeForUE4Module::StartupModule()
{
// neither way was found; download and install the new version
UE_LOG(LogTemp, Warning, TEXT("WakaTime: Did not find wakatime"));
GBaseCommand = "/c start /b " + string(GUserProfile) + "\\.wakatime\\" +
GWakaCliVersion;
GBaseCommand = "/c start \"\" /b \"" + string(GUserProfile) + "\\.wakatime\\" +
GWakaCliVersion + "\"";
string FolderPath = string(GUserProfile) + "\\.wakatime";
if (!FWakaTimeHelpers::PathExists(FolderPath))
{
FWakaTimeHelpers::RunCmdCommand("mkdir " + FolderPath, false, INFINITE);
}
DownloadWakatimeCli(string(GUserProfile) + "/.wakatime/wakatime-cli/" + GWakaCliVersion);
}
// Pozitrone(Wakatime-cli.exe is not in the path by default, which is why we have to use the user path)
// TheAshenWolf(Wakatime-cli.exe is not in the path by default, which is why we have to use the user path)


if (!StyleSetInstance.IsValid())
Expand Down Expand Up @@ -157,6 +157,13 @@ void FWakaTimeForUE4Module::AssignGlobalVariables()
size_t LenDrive = NULL;
_dupenv_s(&GUserProfile, &LenDrive, "USERPROFILE");

/*string profile = GUserProfile;
profile.insert(0, 1, '"');
profile.append("\"");
const char* tmp = profile.c_str();
GUserProfile = (char*)tmp;*/

WCHAR BufferW[256];
GWakatimeArchitecture = GetSystemWow64DirectoryW(BufferW, 256) == 0 ? "386" : "amd64";
GWakaCliVersion = "wakatime-cli-windows-" + GWakatimeArchitecture + ".exe";
Expand Down Expand Up @@ -407,9 +414,7 @@ void FWakaTimeForUE4Module::SendHeartbeat(bool bFileSave, string FilePath, strin

string Command = GBaseCommand;

Command += " --entity ";

Command += " \"" + FilePath + "\" ";
Command += " --entity \"" + GetProjectName() + "\" ";

if (GAPIKey != "")
{
Expand All @@ -419,12 +424,12 @@ void FWakaTimeForUE4Module::SendHeartbeat(bool bFileSave, string FilePath, strin
Command += "--project \"" + GetProjectName() + "\" ";
Command += "--entity-type \"app\" ";
Command += "--language \"Unreal Engine\" ";
Command += "--plugin \"unreal-wakatime/1.2.0\" ";
Command += "--plugin \"unreal-wakatime/1.2.2\" ";
Command += "--category " + Activity + " ";

if (bFileSave)
{
Command += "--write ";
Command += "--write";
}

//UE_LOG(LogTemp, Warning, TEXT("%s"), *FString(UTF8_TO_TCHAR(command.c_str())));
Expand Down
8 changes: 4 additions & 4 deletions WakaTimeForUE4.uplugin
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.2.1",
"VersionName": "1.2.2",
"FriendlyName": "WakaTimeForUE4",
"Description": "WakaTime plugin for UE4. In development now.",
"Description": "WakaTime plugin for UE4. Contributions are welcome",
"Category": "Other",
"CreatedBy": "TheAshenWolf",
"CreatedByURL": "",
"DocsURL": "https://github.com/Pozitrone/WakaTimeForUE4",
"DocsURL": "https://github.com/TheAshenWolf/WakaTimeForUE4",
"MarketplaceURL": "",
"SupportURL": "https://github.com/Pozitrone/WakaTimeForUE4/issues",
"SupportURL": "https://github.com/TheAshenWolf/WakaTimeForUE4/issues",
"CanContainContent": false,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
Expand Down

0 comments on commit c85e29f

Please sign in to comment.