Fix printing, make CI into unique_ptr (more)

This commit is contained in:
Lion Kortlepel
2020-11-08 21:46:02 +01:00
parent b663563f01
commit 7fce274915
6 changed files with 8 additions and 5 deletions

View File

@@ -174,7 +174,7 @@ void Identification(SOCKET TCPSock,Hold*S,RSA*Skey){
closesocket(TCPSock);
return;
}
DebugPrintTIDInternal(std::string("Client(") + Name + ")");
// DebugPrintTIDInternal(std::string("Client(") + Name + ")");
debug(Sec("Name -> ") + Name + Sec(", Role -> ") + Role + Sec(", ID -> ") + DID);
for(auto& c : CI->Clients){
if(c != nullptr){

View File

@@ -1,6 +1,7 @@
#include "Network.h"
#include <thread>
ClientInterface* CI;
#include <memory>
std::unique_ptr<ClientInterface> CI;
void NetMain(){
std::thread TCP(TCPServerMain);
TCP.detach();

View File

@@ -113,7 +113,7 @@ void TCPRcv(Client*c){
}
void TCPClient(Client*c){
DebugPrintTID();
DebugPrintTIDInternal(c->GetName(), true);
Assert(c);
if(c->GetTCPSock() == -1){
CI->RemoveClient(c);