mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-03 16:37:11 +00:00
fix null Key pull request #44
This commit is contained in:
parent
c7e68ba10c
commit
8b650dc00a
@ -9,7 +9,7 @@
|
|||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|
||||||
void UpdateKey(const std::string& newKey) {
|
void UpdateKey(const std::string& newKey) {
|
||||||
if (!newKey.empty()) {
|
if (!newKey.empty() && std::isalnum(newKey[0])) {
|
||||||
std::ofstream Key("key");
|
std::ofstream Key("key");
|
||||||
if (Key.is_open()) {
|
if (Key.is_open()) {
|
||||||
Key << newKey;
|
Key << newKey;
|
||||||
|
@ -379,7 +379,9 @@ void CheckKey() {
|
|||||||
|
|
||||||
Json d = Json::parse(Buffer, nullptr, false);
|
Json d = Json::parse(Buffer, nullptr, false);
|
||||||
if (Buffer == "-1" || Buffer.at(0) != '{' || d.is_discarded()) {
|
if (Buffer == "-1" || Buffer.at(0) != '{' || d.is_discarded()) {
|
||||||
|
LOG(ERROR) << Buffer;
|
||||||
wxMessageBox("Couldn't connect to auth server, you might be offline!", "Warning", wxICON_WARNING);
|
wxMessageBox("Couldn't connect to auth server, you might be offline!", "Warning", wxICON_WARNING);
|
||||||
|
UpdateKey("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (d["success"].get<bool>()) {
|
if (d["success"].get<bool>()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user