mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 23:06:08 +00:00
Server update 0.63.5
- async lua implementation - cleaner backend heartbeat - two way encryption on connect - async tcp buffer - disconnect handler - cleaned UDP implementation
This commit is contained in:
@@ -19,28 +19,28 @@ std::string GetPlayers(){
|
||||
return Return;
|
||||
}
|
||||
std::string GenerateCall(){
|
||||
std::string State = Private ? Sec("true") : Sec("false");
|
||||
std::string ret = Sec("uuid=");
|
||||
ret += Key+Sec("&players=")+std::to_string(CI->Size())+Sec("&maxplayers=")+std::to_string(MaxPlayers)+Sec("&port=")
|
||||
+ std::to_string(Port) + Sec("&map=") + MapName + Sec("&private=")+State+Sec("&version=")+GetSVer()+
|
||||
Sec("&clientversion=")+GetCVer()+Sec("&name=")+ServerName+Sec("&pps=")+StatReport+Sec("&modlist=")+FileList+
|
||||
Sec("&modstotalsize=")+std::to_string(MaxModSize)+Sec("&modstotal=")+std::to_string(ModsLoaded)
|
||||
+Sec("&playerslist=")+GetPlayers()+Sec("&desc=")+ServerDesc;
|
||||
std::string State = Private ? "true" : "false";
|
||||
std::string ret = "uuid=";
|
||||
ret += Key+"&players="+std::to_string(CI->Size())+"&maxplayers="+std::to_string(MaxPlayers)+"&port="
|
||||
+ std::to_string(Port) + "&map=" + MapName + "&private="+State+"&version="+GetSVer()+
|
||||
"&clientversion="+GetCVer()+"&name="+ServerName+"&pps="+StatReport+"&modlist="+FileList+
|
||||
"&modstotalsize="+std::to_string(MaxModSize)+"&modstotal="+std::to_string(ModsLoaded)
|
||||
+"&playerslist="+GetPlayers()+"&desc="+ServerDesc;
|
||||
return ret;
|
||||
}
|
||||
void Heartbeat(){
|
||||
std::string R,T;
|
||||
while(true){
|
||||
R = GenerateCall();
|
||||
if(!CustomIP.empty())R+=Sec("&ip=")+CustomIP;
|
||||
//https://beamng-mp.com/heartbeatv2
|
||||
std::string link = Sec("https://beamng-mp.com/heartbeatv2");
|
||||
if(!CustomIP.empty())R+="&ip="+CustomIP;
|
||||
std::string link = Sec("https://beammp.com/heartbeatv2");
|
||||
T = PostHTTP(link,R);
|
||||
if(T.find_first_not_of(Sec("20")) != std::string::npos){
|
||||
//Backend system refused server startup!
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
T = PostHTTP(link,R);
|
||||
if(T.find_first_not_of(Sec("20")) != std::string::npos){
|
||||
std::string Backup = Sec("https://backup1.beammp.com/heartbeatv2");
|
||||
T = PostHTTP(Backup,R);
|
||||
if(T.find_first_not_of(Sec("20")) != std::string::npos) {
|
||||
error(Sec("Backend system refused server! Check your AuthKey"));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
exit(-1);
|
||||
|
||||
Reference in New Issue
Block a user