add username to auth packet

This commit is contained in:
Lion Kortlepel
2024-02-09 14:24:41 +01:00
committed by Lion
parent 9afdfd4d1b
commit 7c1106a46a
2 changed files with 6 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ bool TCPTerminate = false;
int DEFAULT_PORT = 4444;
bool Terminate = false;
bool LoginAuth = false;
std::string Username = "";
std::string UlStatus;
std::string MStatus;
bool ModLoaded;
@@ -126,7 +127,7 @@ void Parse(std::string Data,SOCKET CSocket){
break;
case 'N':
if (SubCode == 'c'){
Data = "N{\"Auth\":"+std::to_string(LoginAuth)+"}";
Data = "N{\"Auth\":"+std::to_string(LoginAuth)+",\"username\":\"" + Username + "\"}";
}else{
Data = "N" + Login(Data.substr(Data.find(':') + 1));
}