fix client insert/create issue

This commit is contained in:
Lion Kortlepel
2021-02-17 10:09:50 +01:00
committed by Anonymous275
parent b3256062f7
commit bca4b3f140
4 changed files with 33 additions and 27 deletions

View File

@@ -18,6 +18,7 @@ public:
TServer(int argc, char** argv);
void InsertClient(std::shared_ptr<TClient> Ptr);
std::weak_ptr<TClient> InsertNewClient();
void RemoveClient(std::weak_ptr<TClient>);
// in Fn, return true to continue, return false to break

View File

@@ -17,7 +17,7 @@ public:
bool TCPSend(TClient& c, const std::string& Data);
void SendLarge(TClient& c, std::string Data);
void Respond(TClient& c, const std::string& MSG, bool Rel);
std::weak_ptr<TClient> CreateClient(SOCKET TCPSock);
std::shared_ptr<TClient> CreateClient(SOCKET TCPSock);
std::string TCPRcv(TClient& c);
void ClientKick(TClient& c, const std::string& R);
@@ -32,6 +32,7 @@ public:
void SyncResources(TClient& c);
void UpdatePlayers();
private:
std::optional<std::reference_wrapper<TUDPServer>> mUDPServer { std::nullopt };
TServer& mServer;