EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Windows tweaks (https://www.eqemulator.org/forums/showthread.php?t=32201)

Shadows91 09-28-2010 08:37 PM

Windows tweaks
 
Changes:
  • The ShellExecute function requires #include <ShellAPI.h>
  • #include <windows.h> must come before #include <winsock2.h>


Index: worldserver.cpp
================================================== =================
--- worldserver.cpp (revision 1673)
+++ worldserver.cpp (working copy)
@@ -21,7 +21,7 @@
#include <string.h>
#include <stdio.h>
#include <iomanip>
-using namespace std;
+#include <ShellAPI.h>
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>

Index: Items.cpp
================================================== =================
--- Items.cpp (revision 1673)
+++ Items.cpp (working copy)
@@ -8,8 +8,8 @@
*/

#ifdef WIN32
+#include <windows.h>
#include <winsock2.h>
-#include <windows.h>
#else
#include "../common/unix.h"
#endif

Shadows91 09-28-2010 08:41 PM

Another fix
 
The hash function is ambiguous on windows. use ::hash instead.


Index: MiscFunctions.cpp
================================================== =================
--- MiscFunctions.cpp (revision 1673)
+++ MiscFunctions.cpp (working copy)
@@ -396,7 +396,7 @@
//return (rand()%(high-low+1) + (low));
if(!WELLRNG_init) {
WELLRNG_init = true;
- oneseed( hash( time(NULL), clock() ) );
+ oneseed( ::hash( time(NULL), clock() ) );
WELLRNG19937 = case_1;
}
unsigned int randomnum = ((WELLRNG19937)());
@@ -414,7 +414,7 @@
//return (rand() / (double)RAND_MAX * (high - low) + low);
if(!WELLRNG_init) {
WELLRNG_init = true;
- oneseed( hash( time(NULL), clock() ) );
+ oneseed( ::hash( time(NULL), clock() ) );
WELLRNG19937 = case_1;
}
return ((WELLRNG19937)() / (double)0xffffffffUL * (high - low) + low);

joligario 10-03-2010 09:08 PM

These functions work fine currently on windows machines.

Secrets 10-04-2010 01:45 PM

Quote:

Originally Posted by joligario (Post 192601)
These functions work fine currently on windows machines.

this. I've been running it fine on a windows machine (unless they changed something in vs2010, I think it works just fine.)


All times are GMT -4. The time now is 12:32 AM.

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