segfault
This commit is contained in:
@@ -25,10 +25,12 @@ ChatClient::~ChatClient() {
|
||||
|
||||
void ChatClient::onLoad() {
|
||||
|
||||
std::cerr << "onLoad\n";
|
||||
|
||||
ImguiModule* im; { im = (ImguiModule*) moduleInstances[ImguiModule()]; }
|
||||
|
||||
if(!im) {
|
||||
std::cout << "No ImguiModule for TestImgui!\n";
|
||||
std::cout << "No ClientModule for ChatClient!\n";
|
||||
std::abort();
|
||||
}
|
||||
|
||||
@@ -38,8 +40,15 @@ void ChatClient::onLoad() {
|
||||
|
||||
void ChatClient::run() {
|
||||
|
||||
std::cerr << "run\n";
|
||||
|
||||
static ClientModule* cm; { cm = (ClientModule*) moduleInstances[ClientModule()]; }
|
||||
|
||||
if(!cm) {
|
||||
std::cout << "No ClientModule for ChatClient!\n";
|
||||
std::abort();
|
||||
}
|
||||
|
||||
if(open) {
|
||||
static std::string s, addr = "127.0.0.1:9932";
|
||||
|
||||
@@ -81,6 +90,7 @@ void ChatClient::run() {
|
||||
|
||||
bool ChatClient::onEvent(const Archimedes::Event& event) {
|
||||
|
||||
std::cerr << "onEvent: " << (std::string) event << std::endl;
|
||||
unsigned int type = app->getEventType(event);
|
||||
|
||||
|
||||
@@ -89,9 +99,9 @@ bool ChatClient::onEvent(const Archimedes::Event& event) {
|
||||
return true;
|
||||
} else */
|
||||
|
||||
if(type == app->getEventType(CMEvent::DataRecievedEvent())) {
|
||||
if(type == app->getEventType(Archimedes::DataRecievedEvent())) {
|
||||
|
||||
CMEvent::DataRecievedEvent& e = (CMEvent::DataRecievedEvent&) event;
|
||||
Archimedes::DataRecievedEvent& e = (Archimedes::DataRecievedEvent&) event;
|
||||
|
||||
static std::string s; s = std::string((const char*)e.msg->m_pData, e.msg->m_cbSize);
|
||||
|
||||
@@ -103,7 +113,7 @@ bool ChatClient::onEvent(const Archimedes::Event& event) {
|
||||
}
|
||||
/*else if(type == app->getEventType("ConnectionStatusChangedEvent")) {
|
||||
|
||||
//CMEvent::ConnectionStatusChangedEvent& e = (CMEvent::ConnectionStatusChangedEvent&) event;
|
||||
//Archimedes::ConnectionStatusChangedEvent& e = (Archimedes::ConnectionStatusChangedEvent&) event;
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user