mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-08-20 04:20:40 +00:00
Merge branch 'master' of https://github.com/OpenFusionProject/OpenFusion into master
This commit is contained in:
commit
7caa64c305
@ -202,16 +202,12 @@ void CNSocket::step() {
|
||||
// decrypt readBuffer and copy to CNPacketData
|
||||
CNSocketEncryption::decryptData((uint8_t*)&readBuffer, (uint8_t*)(&EKey), readSize);
|
||||
|
||||
void* tmpBuf = xmalloc(readSize-sizeof(int32_t));
|
||||
memcpy(tmpBuf, readBuffer+sizeof(uint32_t), readSize-sizeof(int32_t));
|
||||
void* tmpBuf = readBuffer+sizeof(uint32_t);
|
||||
CNPacketData tmp(tmpBuf, *((uint32_t*)readBuffer), readSize-sizeof(int32_t));
|
||||
|
||||
// call packet handler!!
|
||||
pHandler(this, &tmp);
|
||||
|
||||
// clean up the buffer :)
|
||||
free(tmpBuf);
|
||||
|
||||
// reset vars :)
|
||||
readSize = 0;
|
||||
readBufferIndex = 0;
|
||||
|
@ -27,6 +27,9 @@ int main() {
|
||||
std::cerr << "OpenFusion: WSAStartup failed" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#else
|
||||
// tell the OS to not kill us if you use a broken pipe, just let us know thru recv() or send()
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
settings::init();
|
||||
std::cout << "[INFO] Protocol version: " << PROTOCOL_VERSION << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user