View Single Post
  #1  
Old 12-29-2002, 06:08 PM
Zafar
Sarnak
 
Join Date: Oct 2002
Posts: 50
Default 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.
Reply With Quote