Plugin failing to load - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Plugin failing to load (
/showthread.php?tid=611603)
Plugin failing to load -
Golimad - 08.07.2016
I have an issue loading any plugin that implements Winsock on windows server.
I tried socket by BlueG v0.2, it outputs:
Код:
[19:11:31] Loading plugin: socket
[19:11:31] Failed.
I tried socket by BlueG v0.1 it outputs: ( works fine )
Код:
[19:11:31] Loading plugin: socket
[19:11:31] Loaded.
my test plugin crashes the server during constructor:
Код:
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 load:
Код:
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;
}
Thanks for reading, please help.
Re: Plugin failing to load -
Golimad - 14.07.2016
BUMP ( I don't have any more details I could add, please help me with what I have provided above )