diff --git a/src/engine/server/ddncq.cpp b/src/engine/server/ddncq.cpp index ecd959b..f710905 100644 --- a/src/engine/server/ddncq.cpp +++ b/src/engine/server/ddncq.cpp @@ -4,6 +4,7 @@ std::vector websockets; DDNetCQ* DDNetCQ::instance=nullptr; DDNetCQ* const ddncq=DDNetCQ::GetInstance(); #define MAX_PLAYLOAD_LEN 10*1024 +unsigned char msg[8196]=""; int WebSocketListener( struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len ) { switch (reason){ case LWS_CALLBACK_ESTABLISHED: @@ -12,11 +13,9 @@ int WebSocketListener( struct lws *wsi, enum lws_callback_reasons reason, void * break; case LWS_CALLBACK_RECEIVE: { - unsigned char* msg=new uint8_t[8192]; memset(msg,0,sizeof(msg)); memcpy(msg,in,len); ddncq->gamectx->SendChat(-1,CGameContext::CHAT_ALL,(const char*)msg); - delete[] msg; } break; case LWS_CALLBACK_CLOSED: