mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 23:46:59 +00:00
fix null Key pull request #44
This commit is contained in:
parent
c7e68ba10c
commit
8b650dc00a
@ -9,7 +9,7 @@
|
||||
#include "Logger.h"
|
||||
|
||||
void UpdateKey(const std::string& newKey) {
|
||||
if (!newKey.empty()) {
|
||||
if (!newKey.empty() && std::isalnum(newKey[0])) {
|
||||
std::ofstream Key("key");
|
||||
if (Key.is_open()) {
|
||||
Key << newKey;
|
||||
|
@ -379,7 +379,9 @@ void CheckKey() {
|
||||
|
||||
Json d = Json::parse(Buffer, nullptr, false);
|
||||
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);
|
||||
UpdateKey("");
|
||||
return;
|
||||
}
|
||||
if (d["success"].get<bool>()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user