void Client::OnInitialize() { connect((QObject*)dt::NetworkManager::Get(), SIGNAL(NewEvent(std::shared_ptr<dt::NetworkEvent>)), this, SLOT(_HandleEvent(std::shared_ptr<dt::NetworkEvent>))); dt::Logger::Get().GetStream("debug")->SetDisabled(true); dt::Logger::Get().GetStream("info")->SetDisabled(true); std::shared_ptr<dt::NetworkEvent> ptr(new ChatMessageEvent("","")); dt::NetworkManager::Get()->RegisterNetworkEventPrototype(ptr); dt::NetworkManager::Get()->BindSocket(); dt::NetworkManager::Get()->Connect(dt::Connection(mServerIP, 29876)); mInputThread = std::shared_ptr<sf::Thread>(new sf::Thread(&Client::InputThread, this)); mInputThread->Launch(); }
void CustomClientEventListener::_Initialize() { QObject::connect(dt::NetworkManager::Get(), SIGNAL(NewEvent(std::shared_ptr<dt::NetworkEvent>)), this, SLOT(_HandleEvent(std::shared_ptr<dt::NetworkEvent>))); }