Support of 1Gps+ internet

This commit is contained in:
Anonymous275
2020-12-19 01:15:52 +02:00
parent 19b7f7f579
commit 2e7f2cc6bd
14 changed files with 233 additions and 133 deletions

View File

@@ -24,11 +24,11 @@ struct VData{
class Client {
private:
std::set<std::unique_ptr<VData>> VehicleData; //ID and Data;
std::string Name = Sec("Unknown Client");
std::string Name = "Unknown Client";
SOCKET SOCK[2]{SOCKET(-1)};
sockaddr_in UDPADDR;
std::string Role;
std::string DID;
SOCKET TCPSOCK;
int Status = 0;
int ID = -1;
public:
@@ -39,6 +39,7 @@ public:
void SetRoles(const std::string& role);
std::string GetCarData(int ident);
void SetUDPAddr(sockaddr_in Addr);
void SetDownSock(SOCKET CSock);
void SetTCPSock(SOCKET CSock);
void SetStatus(int status);
void DeleteCar(int ident);
@@ -48,6 +49,7 @@ public:
std::string GetName();
bool isSynced = false;
bool isGuest = false;
SOCKET GetDownSock();
SOCKET GetTCPSock();
void SetID(int ID);
int GetOpenCarID();

View File

@@ -72,6 +72,6 @@ public:
void SetStopThread(bool StopThread) { _StopThread = StopThread; }
bool GetStopThread() const { return _StopThread; }
};
int CallFunction(Lua* lua, const std::string& FuncName, std::shared_ptr<LuaArg> args);
int TriggerLuaEvent(const std::string& Event, bool local, Lua* Caller, std::shared_ptr<LuaArg> arg, bool Wait);
std::any CallFunction(Lua* lua, const std::string& FuncName, std::shared_ptr<LuaArg> args);
std::any TriggerLuaEvent(const std::string& Event, bool local, Lua* Caller, std::shared_ptr<LuaArg> arg, bool Wait);
extern std::set<std::unique_ptr<Lua>> PluginEngine;

View File

@@ -7,7 +7,7 @@
void TCPServerMain();
void UpdatePlayers();
void OnConnect(Client* c);
void InitClient(Client* c);
void TCPClient(Client* c);
std::string TCPRcv(Client* c);
void SyncResources(Client* c);
[[noreturn]] void UDPServerMain();
@@ -16,5 +16,6 @@ void UDPSend(Client* c, std::string Data);
void SendLarge(Client* c, std::string Data);
bool TCPSend(Client* c, const std::string& Data);
void GParser(Client* c, const std::string& Packet);
std::string StaticReason(bool Set,const std::string& R);
void Respond(Client* c, const std::string& MSG, bool Rel);
void SendToAll(Client* c, const std::string& Data, bool Self, bool Rel);