mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 16:25:35 +00:00
Sentry: setup user after config init so that we can sent the authkey
This commit is contained in:
parent
8551e56e42
commit
b9f594896a
@ -14,6 +14,7 @@ public:
|
|||||||
~TSentry();
|
~TSentry();
|
||||||
|
|
||||||
void PrintWelcome();
|
void PrintWelcome();
|
||||||
|
void SetupUser();
|
||||||
void Log(sentry_level_t level, const std::string& logger, const std::string& text);
|
void Log(sentry_level_t level, const std::string& logger, const std::string& text);
|
||||||
void AddExtra(const std::string& key, const sentry_value_t& value);
|
void AddExtra(const std::string& key, const sentry_value_t& value);
|
||||||
void AddExtra(const std::string& key, const std::string& value);
|
void AddExtra(const std::string& key, const std::string& value);
|
||||||
|
@ -12,11 +12,6 @@ TSentry::TSentry(const std::string& SentryUrl) {
|
|||||||
sentry_options_set_release(options, ReleaseString.c_str());
|
sentry_options_set_release(options, ReleaseString.c_str());
|
||||||
sentry_options_set_max_breadcrumbs(options, 10);
|
sentry_options_set_max_breadcrumbs(options, 10);
|
||||||
sentry_init(options);
|
sentry_init(options);
|
||||||
sentry_value_t user = sentry_value_new_object();
|
|
||||||
sentry_value_set_by_key(user, "id", sentry_value_new_string(Application::Settings.Key.c_str()));
|
|
||||||
sentry_value_set_by_key(user, "username", sentry_value_new_string(Application::Settings.Key.c_str()));
|
|
||||||
sentry_value_set_by_key(user, "authkey", sentry_value_new_string(Application::Settings.Key.c_str()));
|
|
||||||
sentry_set_user(user);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,6 +29,13 @@ void TSentry::PrintWelcome() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TSentry::SetupUser() {
|
||||||
|
sentry_value_t user = sentry_value_new_object();
|
||||||
|
sentry_value_set_by_key(user, "id", sentry_value_new_string(Application::Settings.Key.c_str()));
|
||||||
|
sentry_value_set_by_key(user, "authkey", sentry_value_new_string(Application::Settings.Key.c_str()));
|
||||||
|
sentry_set_user(user);
|
||||||
|
}
|
||||||
|
|
||||||
void TSentry::Log(sentry_level_t level, const std::string& logger, const std::string& text) {
|
void TSentry::Log(sentry_level_t level, const std::string& logger, const std::string& text) {
|
||||||
if (!mValid) {
|
if (!mValid) {
|
||||||
return;
|
return;
|
||||||
|
@ -66,6 +66,7 @@ int main(int argc, char** argv) try {
|
|||||||
|
|
||||||
RegisterThread("Main");
|
RegisterThread("Main");
|
||||||
|
|
||||||
|
Sentry.SetupUser();
|
||||||
Sentry.PrintWelcome();
|
Sentry.PrintWelcome();
|
||||||
TResourceManager ResourceManager;
|
TResourceManager ResourceManager;
|
||||||
TPPSMonitor PPSMonitor(Server);
|
TPPSMonitor PPSMonitor(Server);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user