mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 23:46:59 +00:00
set username or role to auth if they're empty (not set)
This commit is contained in:
parent
bd4cfe06b1
commit
9dcfa1dca4
@ -128,6 +128,16 @@ void Parse(std::string Data,SOCKET CSocket){
|
||||
break;
|
||||
case 'N':
|
||||
if (SubCode == 'c'){
|
||||
nlohmann::json Auth = {
|
||||
{"Auth", LoginAuth ? 1 : 0 },
|
||||
};
|
||||
if (!Username.empty()) {
|
||||
Auth["username"] = Username;
|
||||
}
|
||||
if (!UserRole.empty()) {
|
||||
Auth["role"] = UserRole;
|
||||
}
|
||||
Data = Auth.dump();
|
||||
Data = "N{\"Auth\":"+std::to_string(LoginAuth)+",\"username\":\"" + Username + "\",\"role\":\"" + UserRole + "\"}";
|
||||
}else{
|
||||
Data = "N" + Login(Data.substr(Data.find(':') + 1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user