EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   Limiting World from running more than once. (https://www.eqemulator.org/forums/showthread.php?t=4489)

Zafar 12-29-2002 06:08 PM

Limiting World from running more than once.
 
I modified the world\net.cpp file to prevent more than once instance of world.exe from being loaded. This works fine under Win32, but under Linux it breaks compiles. I did this once for Linux, and a dozen times or so for Win32, but I cannot remember how to do it on Linux, and would like to implement it on both Win32 and Linux.

I added:
Quote:

HANDLE hMutex = CreateMutex(NULL, FALSE, "EQEmuWorld");
if (hMutex)
{
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
cout << "EverQuest(TM) World Server Emulator is already running." << endl;
cout << "Please shutdown the existing copy, and reload." << endl;
exit (0);
}
}
right after:
Quote:

int main(int argc, char** argv)
{

Adding this code for zone servers would be bad, as it would limit you to running only one zone -- so if you use this code, don't use it for zones; only the world server.

alkrun 01-02-2003 04:41 PM

My question is why would you want to do this? I specifically wrote code to allow you to run multiple world servers on a box with multiple IP addresses. I'm not knocking your code, just that I don't see why you would limit people to one world server, maybe they want to run a production and a development world on the same server?


All times are GMT -4. The time now is 07:19 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.