mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-02 16:06:35 +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;
|
break;
|
||||||
case 'N':
|
case 'N':
|
||||||
if (SubCode == 'c'){
|
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 + "\"}";
|
Data = "N{\"Auth\":"+std::to_string(LoginAuth)+",\"username\":\"" + Username + "\",\"role\":\"" + UserRole + "\"}";
|
||||||
}else{
|
}else{
|
||||||
Data = "N" + Login(Data.substr(Data.find(':') + 1));
|
Data = "N" + Login(Data.substr(Data.find(':') + 1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user