08.07.2016, 21:11
I have an issue loading any plugin that implements Winsock on windows server.
I tried socket by BlueG v0.2, it outputs:
I tried socket by BlueG v0.1 it outputs: ( works fine )
my test plugin crashes the server during constructor:
Plugin load:
Thanks for reading, please help.
I tried socket by BlueG v0.2, it outputs:
Код:
[19:11:31] Loading plugin: socket [19:11:31] Failed.
Код:
[19:11:31] Loading plugin: socket [19:11:31] Loaded.
Код:
Server::Server(int p){ WORD wVersionRequested = MAKEWORD(1, 1); WSADATA wsaData; int err; port = p; running = false; err = WSAStartup(wVersionRequested, &wsaData); // Calling WSAStartup crashes the server if (err != 0 || LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) { logprintf("Winsock failed to initialize: %d\n", WSAGetLastError()); this->~Server(); } }
Код:
PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) { pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS]; logprintf = (logprintf_t) ppData[PLUGIN_DATA_LOGPRINTF]; logprintf(" * Test plugin was loaded."); MainServer = new Server(7777); // Server * MainServer; // Doesn't reach here return true; }