Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak(client): user agent for ROS calls
The default cURL user agent might lead to erratic behavior with third- party security providers filtering out user requests. (also, adds a unified place to get `release.txt` from)
- Loading branch information
1 parent
bc1ac1b
commit 30e875c
Showing
3 changed files
with
60 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#ifndef IS_FXSERVER | ||
namespace cfx | ||
{ | ||
inline auto GetPlatformRelease() | ||
{ | ||
static auto version = ([]() | ||
{ | ||
FILE* f = _wfopen(MakeRelativeCitPath(L"citizen/release.txt").c_str(), L"r"); | ||
int version = -1; | ||
|
||
if (f) | ||
{ | ||
char ver[128]; | ||
|
||
fgets(ver, sizeof(ver), f); | ||
fclose(f); | ||
|
||
version = atoi(ver); | ||
} | ||
else | ||
{ | ||
version = 0; | ||
} | ||
|
||
return version; | ||
})(); | ||
|
||
return version; | ||
} | ||
} | ||
#endif |