diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..aecf25037
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* -crlf
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f12a0f00..424b01c4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,12 +1,9 @@
cmake_minimum_required(VERSION 2.8)
+include(CMakePrintHelpers)
project(stellabellum C CXX)
-if (WIN32)
- set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/win32")
-elseif (UNIX)
- set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/linux")
-endif ()
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/linux")
set(SWG_ROOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SWG_ENGINE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/engine)
@@ -16,8 +13,6 @@ set(SWG_GAME_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/game)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
-include_directories(/usr/include/i386-linux-gnu)
-
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
find_package(JNI REQUIRED)
@@ -28,101 +23,83 @@ find_package(Perl REQUIRED)
find_package(Threads)
find_package(ZLIB REQUIRED)
find_package(CURL REQUIRED)
+find_package(Curses REQUIRED)
# c++17 yeah!
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
-# shame on you cmake for auto-setting optimization flags!
-set(CMAKE_CXX_FLAGS_DEBUG "")
-set(CMAKE_CXX_FLAGS_RELEASE "")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
-set(CMAKE_CXX_FLAGS_MINSIZEREL "")
-
-# I'll be honest, win32 is probably very very broken and won't build - it will need worked on so that MSVC uses
-# the vs2013+ STL instead of stlport, and probably will thus need removal/modification/addition of TONS of the ifdef blocks for WIN32
-if (WIN32)
- find_package(Iconv REQUIRED)
-
- # Dont-Build-PDB RELEASE build use the following (by either commenting---uncommenting the line as needed)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libc.lib /SAFESEH:NO")
-
- # Do-Build-PDB RELEASE build use the following (by either commenting---uncommenting the line as needed)
- #set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DWIN32 -Dwin32 -DUDP_LIBRARY -DDEBUG_LEVEL=0 \
- # -DPRODUCTION=1 /Oi /Ot /Oy /O2 /GF /Gy /Zi /MT -D_USE_32BIT_TIME_T=1 -D_MBCS \
- # -DPLATFORM_BASE_SINGLE_THREAD -D_CRT_SECURE_NO_WARNINGS /MP /wd4244 /wd4996 /wd4018 /wd4351 \
- # /Zc:wchar_t- /Ob1 /FC")
-
- # Dont-Build-PDB RELEASE build use the following (by either commenting---uncommenting the line as needed)
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DWIN32 -Dwin32 -DUDP_LIBRARY -DDEBUG_LEVEL=0 -DPRODUCTION=1 \
- /Oi /Ot /Oy /O2 /GF /Gy /MT -D_USE_32BIT_TIME_T=1 -D_MBCS -DPLATFORM_BASE_SINGLE_THREAD -D_CRT_SECURE_NO_WARNINGS \
- /MP /wd4244 /wd4996 /wd4018 /wd4351 /Zc:wchar_t- /Ob1 /FC")
-
- # Standard DEBUG build use the following (by either commenting---uncommenting the line as needed)
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DWIN32 -Dwin32 -D_DEBUG -DUDP_LIBRARY -DDEBUG_LEVEL=2 -DPRODUCTION=0 /MTd \
- -D_USE_32BIT_TIME_T=1 -D_MBCS -DPLATFORM_BASE_SINGLE_THREAD -D_CRT_SECURE_NO_WARNINGS /MP /wd4244 /wd4996 /wd4018 /wd4351 \
- /Zc:wchar_t- /Ob1 /FC")
-elseif (UNIX)
- find_package(Curses REQUIRED)
-
- # linker flags
- if (${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO" OR ${CMAKE_BUILD_TYPE} STREQUAL "MINSIZEREL")
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic")
- set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic")
- else ()
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic,-x,-s")
- set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic,-x,-s")
- endif ()
-
- # don't put anything too crazy in debug...and any common flags go into CMAKE_CXX_FLAGS
- set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -O0 -g3")
-
- # release specific cflags - optimizations beyond the default for both types is mostly just -O flags
- set(CMAKE_CXX_FLAGS_RELEASE "-DDEBUG_LEVEL=0 -DPRODUCTION=1")
-
- # we use fewer, if any, crazy optimizations for profile generation, and likewise release flags for the minsizerel
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE}")
- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_RELEASE}")
-
- # Ofast doesn't work with gcc builds
- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast \
- -fno-threadsafe-statics -fslp-vectorize \
- -fno-stack-protector -fstrict-enums -finline-hint-functions \
- -fno-coverage-mapping -fno-spell-checking \
- -mno-retpoline")
-
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
-
- # RELWITHDEBINFO is used for building bins that produce profdata files
- # we only need the basics of our heavy optimizations here, i think - that and one of these flags
- # breaks JNI when we profile
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -Ofast -finline-hint-functions -fprofile-instr-generate")
-
- # MINSIZEREL is used for profiled, flto builds
- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_RELEASE} -flto -fwhole-program-vtables")
- elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- # O3 and Ofast include one or more flags that cause java to crash when using gcc6
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fno-signed-zeros -freciprocal-math -fno-unroll-loops -fno-tree-loop-optimize -fno-plt")
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -Og")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
- elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
- endif ()
-
- # our "always on" flags - build by default for the system we're on but include all instruction sets
- set(CMAKE_CXX_FLAGS "-m32 -pipe -march=native -mtune=native \
- -Wformat -Wno-overloaded-virtual -Wno-missing-braces -Wno-format \
- -Wno-write-strings -Wno-unknown-pragmas \
- -Wno-uninitialized -Wno-reorder -Wno-tautological-constant-out-of-range-compare -Wno-stringop-overflow -Wno-address-of-packed-member")
-
- add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -U_FORTIFY_SOURCE)
-
- # this is so some profile specific stuff is turned on in the code
- if (${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO")
- add_definitions(-DENABLE_PROFILING)
- endif ()
+# Global CMake CXX Flags
+# our "always on" flags - build by default for the system we're on but include all instruction sets
+set(CMAKE_CXX_FLAGS "\
+ ${CMAKE_CXX_FLAGS} \
+ -pipe \
+ -march=native \
+ -maes \
+ -Wformat \
+ -Wno-overloaded-virtual \
+ -Wno-missing-braces \
+ -Wno-format \
+ -Wno-write-strings \
+ -Wno-unknown-pragmas \
+ -Wno-uninitialized \
+ -Wno-reorder \
+ -Wno-tautological-constant-out-of-range-compare \
+ -Wno-address-of-packed-member \
+")
+
+string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+
+# Global Linker flags
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic")
+
+# Add on flags to strip debug symbols if RELEASE or MINSIZEREL
+if (${CMAKE_BUILD_TYPE} STREQUAL "RELEASE" OR ${CMAKE_BUILD_TYPE} STREQUAL "MINSIZEREL")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS},-x,-s")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS},-x,-s")
+endif ()
+
+# Compiler specific settings.
+# GNU - These are for GCC 7.5 (the version on the 3.0.x VM)
+# Clang - These are for CLang 11 (current version as of Jan-2022), but it is not installed on the 3.0.x VM
+if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-stringop-overflow")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -pg -ggdb")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG_LEVEL=0 -DPRODUCTION=0 -pg -ggdb -no-pie")
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DDEBUG_LEVEL=0 -DPRODUCTION=1 -no-pie -flto -fwhole-program-vtables")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDEBUG_LEVEL=0 -DPRODUCTION=1")
+elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "CLang")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -pg -ggdb -g -fprofile-instr-generate -fcoverage-mapping")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG_LEVEL=0 -DPRODUCTION=0 -Ofast -pg -ggdb")
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DDEBUG_LEVEL=0 -DPRODUCTION=1 -no-pie -flto -fwhole-program-vtables")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDEBUG_LEVEL=0 -DPRODUCTION=1 -Ofast")
+endif()
+
+# Remove whitespace from flags
+string(REGEX REPLACE "[ \t\r\n]+" " " CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+string(REGEX REPLACE "[ \t\r\n]+" " " CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
+string(REGEX REPLACE "[ \t\r\n]+" " " CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
+string(REGEX REPLACE "[ \t\r\n]+" " " CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+
+message("Using Compiler: ${CMAKE_CXX_COMPILER_ID}")
+
+add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -U_FORTIFY_SOURCE)
+
+# this is so some profile specific stuff is turned on in the code
+if (${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO" OR ${CMAKE_BUILD_TYPE} STREQUAL "DEBUG")
+ add_definitions(-DENABLE_PROFILING)
+endif ()
+
+if (${CMAKE_BUILD_TYPE} STREQUAL "DEBUG")
+ cmake_print_variables(CMAKE_CXX_FLAGS_DEBUG)
+elseif (${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO")
+ cmake_print_variables(CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+elseif (${CMAKE_BUILD_TYPE} STREQUAL "MINSIZEREL")
+ cmake_print_variables(CMAKE_CXX_FLAGS_MINSIZEREL)
+elseif (${CMAKE_BUILD_TYPE} STREQUAL "RELEASE")
+ cmake_print_variables(CMAKE_CXX_FLAGS_RELEASE)
endif ()
add_subdirectory(external)
diff --git a/README.md b/README.md
index ac75b13cb..e4ac3e1c0 100644
--- a/README.md
+++ b/README.md
@@ -3,11 +3,15 @@
This is the main server code for SWGSource 1.2 as originally forked from the https://bitbucket.org/stellabellumswg/ repository. Please see that repository for original publication and alteration credit.
# Works in progress
-* 64-bit-types - fully 64 bit version that builds and runs completely.
+* 64-bit-types - fully 64 bit version (presently in testing - 11/12/2021) (Special thanks to Apathy for his help in making a 64 bit version happen!)
# Building
-For local testing, and non-live builds set MODE=Release or MODE=Debug in the build.properties file in swg-main.
+## Clang Versions
+
+**Important**: For versions of clang <= 4 you'll probably have to remove/omit a deprecated CFLAG or two from the CMakelists.txt file
+
+Only use the Debug and Release targets unless you want to work on 64 bit (MODE=RELWITHDEBINFO). For local testing, and non-live builds set MODE=Release or MODE=debug in build_linux.sh.
For production, user facing builds, set MODE=MINSIZEREL for profile built, heavily optimized versions of the binaries.
diff --git a/build.xml b/build.xml
index e0c32d6cb..e1765850d 100755
--- a/build.xml
+++ b/build.xml
@@ -52,6 +52,13 @@
Architecture is ${arch}
+
+
+
+
+
+
+ Compiling as ${bits}-bit application.
@@ -83,7 +90,11 @@
-
+
+
+
+
+
@@ -99,6 +110,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmake/linux/FindOracle.cmake b/cmake/linux/FindOracle.cmake
index a4d14c4b0..d6074ead5 100644
--- a/cmake/linux/FindOracle.cmake
+++ b/cmake/linux/FindOracle.cmake
@@ -22,7 +22,6 @@
#
###############################################################################
-
# If ORACLE_HOME not defined, assume Oracle libraries not available
if(DEFINED ENV{ORACLE_HOME})
@@ -31,17 +30,15 @@ if(DEFINED ENV{ORACLE_HOME})
find_path(ORACLE_INCLUDE_DIR
NAMES oci.h
PATHS
- /usr/include/oracle/18.3/client
+ ${CMAKE_ORACLE_INCLUDE_DIR}
${ORACLE_HOME}/rdbms/public
${ORACLE_HOME}/include
${ORACLE_HOME}/sdk/include # Oracle SDK
${ORACLE_HOME}/OCI/include) # Oracle XE on Windows
-
set(ORACLE_OCI_NAMES clntsh libclntsh oci)
- set(ORACLE_NNZ_NAMES nnz18 libnnz18 ociw32)
- set(ORACLE_OCCI_NAMES libocci occi)
-
+ set(ORACLE_NNZ_NAMES libnnz18 nnz18 libnnz21 nnz21 ociw32)
+ set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11)
set(ORACLE_LIB_DIR
${ORACLE_HOME}/lib
@@ -49,24 +46,19 @@ if(DEFINED ENV{ORACLE_HOME})
${ORACLE_HOME}/sdk/lib/msvc
${ORACLE_HOME}/OCI/lib/msvc) # Oracle XE on Windows
-
find_library(ORACLE_OCI_LIBRARY NAMES ${ORACLE_OCI_NAMES} PATHS ${ORACLE_LIB_DIR})
find_library(ORACLE_OCCI_LIBRARY NAMES ${ORACLE_OCCI_NAMES} PATHS ${ORACLE_LIB_DIR})
find_library(ORACLE_NNZ_LIBRARY NAMES ${ORACLE_NNZ_NAMES} PATHS ${ORACLE_LIB_DIR})
-
set(ORACLE_LIBRARY ${ORACLE_OCI_LIBRARY} ${ORACLE_OCCI_LIBRARY} ${ORACLE_NNZ_LIBRARY})
-
if(APPLE)
set(ORACLE_OCIEI_NAMES libociei ociei)
-
find_library(ORACLE_OCIEI_LIBRARY
NAMES libociei ociei
PATHS ${ORACLE_LIB_DIR})
-
if(ORACLE_OCIEI_LIBRARY)
set(ORACLE_LIBRARY ${ORACLE_LIBRARY} ${ORACLE_OCIEI_LIBRARY})
else(ORACLE_OCIEI_LIBRARY)
@@ -75,18 +67,13 @@ if(DEFINED ENV{ORACLE_HOME})
endif()
endif()
-
set(ORACLE_LIBRARIES ${ORACLE_LIBRARY})
-
endif(DEFINED ENV{ORACLE_HOME})
-
# Handle the QUIETLY and REQUIRED arguments and set ORACLE_FOUND to TRUE
# if all listed variables are TRUE
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(ORACLE DEFAULT_MSG ORACLE_LIBRARY ORACLE_INCLUDE_DIR)
-
-
-mark_as_advanced(ORACLE_INCLUDE_DIR ORACLE_LIBRARY)
+find_package_handle_standard_args(Oracle DEFAULT_MSG ORACLE_LIBRARY ORACLE_INCLUDE_DIR)
+mark_as_advanced(ORACLE_INCLUDE_DIR ORACLE_LIBRARY)
\ No newline at end of file
diff --git a/engine/client/application/Miff/src/lex_yy.c b/engine/client/application/Miff/src/lex_yy.c
index df6de76d9..bdf2e3fa8 100644
--- a/engine/client/application/Miff/src/lex_yy.c
+++ b/engine/client/application/Miff/src/lex_yy.c
@@ -49,11 +49,11 @@ typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
+typedef short short int flex_int16_t;
+typedef short int flex_int32_t;
typedef unsigned char flex_uint8_t;
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
+typedef unsigned short short int flex_uint16_t;
+typedef unsigned short int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
diff --git a/engine/client/application/Miff/src/linux/miff.cpp b/engine/client/application/Miff/src/linux/miff.cpp
index 6927490e8..454f3e329 100755
--- a/engine/client/application/Miff/src/linux/miff.cpp
+++ b/engine/client/application/Miff/src/linux/miff.cpp
@@ -275,7 +275,7 @@ static void callbackFunction(void)
{
if (!outfileHandler->writeBuffer())
{
- fprintf(stderr, "MIFF: failed to write output file \"%s\"\n", local_outFileName);
+ fprintf(stderr, "FAILURE: failed to write output file \"%s\"\n", local_outFileName);
local_errorFlag = ERR_WRITEERROR;
}
}
diff --git a/engine/client/application/Miff/src/linux/parser.lex b/engine/client/application/Miff/src/linux/parser.lex
index f80c2c9b2..2d5192c6b 100644
--- a/engine/client/application/Miff/src/linux/parser.lex
+++ b/engine/client/application/Miff/src/linux/parser.lex
@@ -326,8 +326,11 @@ EXP (e|E)(\+|-)?
/* do a count on bracket matching... */
if (0 == count_brace())
{
- if (!initialCompile && !globalErrorFlag)
- MIFFMessage("mIFF successfully compiled!\n", 0);
+ if (!initialCompile && !globalErrorFlag) {
+ char myString[256];
+ sprintf(myString, "mIFF (SUCCESS): compiled \"%s\"", inFileName);
+ MIFFMessage(myString, 0);
+ }
}
yyterminate(); /* tell yyparse() it's time to quit! DO NOT comment or delete this line! */
diff --git a/engine/client/application/Miff/src/linux/parser.yac b/engine/client/application/Miff/src/linux/parser.yac
index 25feaf7e8..647b4e766 100644
--- a/engine/client/application/Miff/src/linux/parser.yac
+++ b/engine/client/application/Miff/src/linux/parser.yac
@@ -29,6 +29,7 @@
#include /* for wide character (16bit) strings */
#include /* for strtoupper and strtolower */
#include
+#include /* for standard types - i.e. uint32_t */
/*----------------------------------------------------------------**
** debug options, turn these on to TEST ONLY! don't leave these **
@@ -66,11 +67,11 @@ void checkPragmas(void);
void includeBinary(char *fname);
-void write32(long i32);
-void write16(short i16);
+void write32(int32_t i32);
+void write16(int16_t i16);
void write8(char i8);
-void writeU32(unsigned long ui32);
-void writeU16(unsigned short ui16);
+void writeU32(uint32_t ui32);
+void writeU16(uint16_t ui16);
void writeU8(unsigned char u8);
void writeDouble(double d);
void writeFloat(float f);
@@ -627,14 +628,14 @@ void checkArgs(void)
/*----------------------------**
** Write to FILE functions... **
**----------------------------*/
-void write32(long i32)
+void write32(int32_t i32)
{
- MIFFinsertChunkData(&i32, sizeof(long));
+ MIFFinsertChunkData(&i32, sizeof(int32_t));
}
-void write16(short i16)
+void write16(int16_t i16)
{
- MIFFinsertChunkData(&i16, sizeof(short));
+ MIFFinsertChunkData(&i16, sizeof(int16_t));
}
void write8(char i8)
@@ -642,14 +643,14 @@ void write8(char i8)
MIFFinsertChunkData(&i8, sizeof(char));
}
-void writeU32(unsigned long ui32)
+void writeU32(uint32_t ui32)
{
- MIFFinsertChunkData(&ui32, sizeof(long));
+ MIFFinsertChunkData(&ui32, sizeof(uint32_t));
}
-void writeU16(unsigned short ui16)
+void writeU16(uint16_t ui16)
{
- MIFFinsertChunkData(&ui16, sizeof(short));
+ MIFFinsertChunkData(&ui16, sizeof(uint16_t));
}
void writeU8(unsigned char ui8)
diff --git a/engine/client/application/Miff/src/parser.c b/engine/client/application/Miff/src/parser.c
index 22fdd21e4..90a23d7c2 100644
--- a/engine/client/application/Miff/src/parser.c
+++ b/engine/client/application/Miff/src/parser.c
@@ -134,11 +134,11 @@ void checkPragmas(void);
void includeBinary(char *fname);
-void write32(long i32);
-void write16(short i16);
+void write32(int32_t i32);
+void write16(int16_t i16);
void write8(char i8);
-void writeU32(unsigned long ui32);
-void writeU16(unsigned short ui16);
+void writeU32(uint32_t ui32);
+void writeU16(uint16_t ui16);
void writeU8(unsigned char u8);
void writeDouble(double d);
void writeFloat(float f);
@@ -2829,14 +2829,14 @@ void checkArgs(void)
/*----------------------------**
** Write to FILE functions... **
**----------------------------*/
-void write32(long i32)
+void write32(int32_t i32)
{
- MIFFinsertChunkData(&i32, sizeof(long));
+ MIFFinsertChunkData(&i32, sizeof(int32_t));
}
-void write16(short i16)
+void write16(int16_t i16)
{
- MIFFinsertChunkData(&i16, sizeof(short));
+ MIFFinsertChunkData(&i16, sizeof(int16_t));
}
void write8(char i8)
@@ -2844,14 +2844,14 @@ void write8(char i8)
MIFFinsertChunkData(&i8, sizeof(char));
}
-void writeU32(unsigned long ui32)
+void writeU32(uint32_t ui32)
{
- MIFFinsertChunkData(&ui32, sizeof(long));
+ MIFFinsertChunkData(&ui32, sizeof(uint32_t));
}
-void writeU16(unsigned short ui16)
+void writeU16(uint16_t ui16)
{
- MIFFinsertChunkData(&ui16, sizeof(short));
+ MIFFinsertChunkData(&ui16, sizeof(uint16_t));
}
void writeU8(unsigned char ui8)
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferClient.h b/engine/server/application/CentralServer/src/shared/AuctionTransferClient.h
index 176ec79e6..617f75fd3 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferClient.h
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferClient.h
@@ -40,7 +40,7 @@ class AuctionTransferClient : public AuctionTransfer::AuctionTransferAPI
void onSendAbortTransaction(unsigned int, unsigned int, void *) {};
void onSendAuditAssetTransfer(unsigned int, unsigned int, void *) {};
- void onGetNewTransactionID(unsigned int, unsigned int, int64, void *) {};
+ void onGetNewTransactionID(unsigned int, unsigned int, int64_t, void *) {};
// Responses to reply requests
void onReplyReceivePrepareTransaction(unsigned int, unsigned int, void *) {};
@@ -52,10 +52,10 @@ class AuctionTransferClient : public AuctionTransfer::AuctionTransferAPI
void onIdentifyHost(unsigned int, unsigned int, void *) {};
// callbacks initiated by auction
- void onReceivePrepareTransaction(unsigned int, int64, unsigned int, unsigned int, int64, const char *) {};
- void onReceiveCommitTransaction(unsigned int, int64) {};
- void onReceiveAbortTransaction(unsigned int, int64) {};
- void onReceiveGetCharacterList(unsigned int, unsigned int, const char *) {};
+ void onReceivePrepareTransaction(unsigned int, int64_t, unsigned int, unsigned int, int64_t, const char *) {};
+ void onReceiveCommitTransaction(unsigned int, int64_t) {};
+ void onReceiveAbortTransaction(unsigned int, int64_t) {};
+ void onReceiveGetCharacterList(unsigned int, int64_t, const char *) {};
private:
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPI.h b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPI.h
index a3d85096e..2ad6d405d 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPI.h
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPI.h
@@ -62,7 +62,7 @@ class AuctionTransferAPI
virtual void onSendCommitTransaction (unsigned trackingNumber, unsigned responseCode, void *user) = 0;
virtual void onSendAbortTransaction (unsigned trackingNumber, unsigned responseCode, void *user) = 0;
virtual void onSendAuditAssetTransfer(unsigned trackingNumber, unsigned responseCode, void *user) = 0;
- virtual void onGetNewTransactionID( unsigned trackingNumber, unsigned responseCode, long long transactionID, void *user) = 0;
+ virtual void onGetNewTransactionID( unsigned trackingNumber, unsigned responseCode, int64_t transactionID, void *user) = 0;
// responses to reply requests
virtual void onReplyReceivePrepareTransaction (unsigned trackingNumber, unsigned responseCode, void *user) = 0;
@@ -75,10 +75,10 @@ class AuctionTransferAPI
// Callbacks initiated by the Auction System
- virtual void onReceivePrepareTransaction (unsigned trackingNumber, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const char *newName) = 0;
- virtual void onReceiveCommitTransaction (unsigned trackingNumber, long long transactionID) = 0;
- virtual void onReceiveAbortTransaction (unsigned trackingNumber, long long transactionID) = 0;
- virtual void onReceiveGetCharacterList(unsigned trackingNumber, unsigned stationID, const char *serverID) = 0;
+ virtual void onReceivePrepareTransaction (unsigned trackingNumber, int64_t transactionID, unsigned stationID, unsigned characterID, int64_t assetID, const char *newName) = 0;
+ virtual void onReceiveCommitTransaction (unsigned trackingNumber, int64_t transactionID) = 0;
+ virtual void onReceiveAbortTransaction (unsigned trackingNumber, int64_t transactionID) = 0;
+ virtual void onReceiveGetCharacterList(unsigned trackingNumber, int64_t stationID, const char *serverID) = 0;
private:
AuctionTransferAPICore *m_apiCore;
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPICore.cpp b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPICore.cpp
index c2ccccb06..cc7d509d6 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPICore.cpp
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/AuctionTransferAPICore.cpp
@@ -135,7 +135,7 @@ void AuctionTransferAPICore::responseCallback(short type, Base::ByteStream::Read
ServerTrackObject *stobj = new ServerTrackObject(++m_mappedServerTrack, real_server_track, connection);
m_serverTracks.insert(std::pair(m_mappedServerTrack, stobj));
- long long transactionID;
+ int64_t transactionID;
get(iter, transactionID);
switch (type)
{
@@ -143,7 +143,7 @@ void AuctionTransferAPICore::responseCallback(short type, Base::ByteStream::Read
{
unsigned stationID;
unsigned characterID;
- long long assetID;
+ int64_t assetID;
std::string newName;
get(iter, stationID);
get(iter, characterID);
@@ -167,7 +167,7 @@ void AuctionTransferAPICore::responseCallback(short type, Base::ByteStream::Read
// this had the stationID read in as the transactionID
std::string serverID;
get(iter, serverID);
- m_api->onReceiveGetCharacterList(m_mappedServerTrack, (unsigned int)transactionID, serverID.c_str());
+ m_api->onReceiveGetCharacterList(m_mappedServerTrack, transactionID, serverID.c_str());
}
default:
break;
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.h b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.h
index a15f6cbae..00ae65cd1 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.h
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.h
@@ -724,8 +724,9 @@ const unsigned MAX_ARRAY_SIZE = 1024;
Base::get(source, arraySize);
ValueType v;
- if (arraySize > MAX_ARRAY_SIZE)
+ if (arraySize > MAX_ARRAY_SIZE) {
arraySize = 0;
+ }
for(unsigned int i = 0; i < arraySize; ++i)
{
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/linux/Types.h b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/linux/Types.h
index 69419a0fc..ea2b96257 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/linux/Types.h
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/linux/Types.h
@@ -11,7 +11,8 @@
#ifndef BASE_LINUX_TYPES_H
#define BASE_LINUX_TYPES_H
-#include
+//#include
+#include
#ifdef EXTERNAL_DISTRO
namespace NAMESPACE
@@ -30,13 +31,13 @@ namespace Base
typedef signed char int8;
typedef unsigned char uint8;
-typedef signed short int16;
-typedef unsigned short uint16;
+typedef int16_t int16;
+typedef uint16_t uint16;
typedef int32_t int32;
-typedef u_int32_t uint32;
+typedef uint32_t uint32;
typedef int64_t int64;
-typedef u_int64_t uint64;
+typedef uint64_t uint64;
}
#ifdef EXTERNAL_DISTRO
};
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/win32/Types.h b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/win32/Types.h
index 0c64cb2cb..aa9ba015f 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/win32/Types.h
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/win32/Types.h
@@ -28,10 +28,10 @@ typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
-typedef int int32;
-typedef unsigned uint32;
-typedef __int64 int64;
-typedef unsigned __int64 uint64;
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;
};
#ifdef EXTERNAL_DISTRO
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.cpp b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.cpp
index ed2e0ad3b..c12681592 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.cpp
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.cpp
@@ -76,7 +76,7 @@ void ReplyRequest::pack(Base::ByteStream &msg)
}
//////////////////////////////////////////////////////////////////////////////////////
-CommonRequest::CommonRequest( RequestTypes type, unsigned serverTrack, long long transactionID )
+CommonRequest::CommonRequest( RequestTypes type, unsigned serverTrack, int64_t transactionID )
: GenericRequest((short)type, serverTrack), m_transactionID(transactionID)
{
}
@@ -101,7 +101,7 @@ void GetIDRequest::pack(Base::ByteStream &msg)
}
//////////////////////////////////////////////////////////////////////////////////////
-SendPrepareCompressedRequest::SendPrepareCompressedRequest(RequestTypes type, unsigned serverTrack, const char *serverID, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const unsigned char *xmlAsset, unsigned length)
+SendPrepareCompressedRequest::SendPrepareCompressedRequest(RequestTypes type, unsigned serverTrack, const char *serverID, int64_t transactionID, unsigned stationID, unsigned characterID, int64_t assetID, const unsigned char *xmlAsset, unsigned length)
: GenericRequest((short)type, serverTrack),
m_transactionID(transactionID),
m_stationID(stationID),
@@ -125,7 +125,7 @@ void SendPrepareCompressedRequest::pack(Base::ByteStream &msg)
}
//////////////////////////////////////////////////////////////////////////////////////
-SendPrepareRequest::SendPrepareRequest( RequestTypes type, unsigned serverTrack, const char *serverID, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const char *xml )
+SendPrepareRequest::SendPrepareRequest( RequestTypes type, unsigned serverTrack, const char *serverID, int64_t transactionID, unsigned stationID, unsigned characterID, int64_t assetID, const char *xml )
: GenericRequest((short)type, serverTrack),
m_transactionID(transactionID),
m_stationID(stationID),
@@ -194,7 +194,7 @@ void IdentifyServerRequest::pack(Base::ByteStream &msg)
//////////////////////////////////////////////////////////////////////////////////////
SendAuditRequest::SendAuditRequest( RequestTypes type, unsigned serverTrack, const char *gameCode, const char *serverCode,
- long long inGameAssetID, unsigned stationID, const char *event, const char *message)
+ int64_t inGameAssetID, unsigned stationID, const char *event, const char *message)
: GenericRequest((short)type, serverTrack), m_gameCode(gameCode), m_serverCode(serverCode), m_assetID(inGameAssetID),
m_userID(stationID), m_event(event), m_message(message)
{
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.h b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.h
index f848c26b5..d59c86c93 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.h
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Request.h
@@ -43,12 +43,12 @@ namespace AuctionTransfer
class CommonRequest: public GenericRequest
{
public:
- CommonRequest(RequestTypes type, unsigned serverTrack, long long transactionID);
+ CommonRequest(RequestTypes type, unsigned serverTrack, int64_t transactionID);
virtual ~CommonRequest() {};
void pack(Base::ByteStream &msg);
private:
- long long m_transactionID;
+ int64_t m_transactionID;
};
//////////////////////////////////////////////////////////////////////////////////////
@@ -66,15 +66,15 @@ namespace AuctionTransfer
class SendPrepareRequest: public GenericRequest
{
public:
- SendPrepareRequest(RequestTypes type, unsigned serverTrack, const char *serverID, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const char *xmlAsset);
+ SendPrepareRequest(RequestTypes type, unsigned serverTrack, const char *serverID, int64_t transactionID, unsigned stationID, unsigned characterID, int64_t assetID, const char *xmlAsset);
virtual ~SendPrepareRequest() {};
void pack(Base::ByteStream &msg);
private:
- long long m_transactionID;
+ int64_t m_transactionID;
unsigned m_stationID;
unsigned m_characterID;
- long long m_assetID;
+ int64_t m_assetID;
std::string m_xml;
std::string m_serverID;
};
@@ -83,15 +83,15 @@ namespace AuctionTransfer
class SendPrepareCompressedRequest: public GenericRequest
{
public:
- SendPrepareCompressedRequest(RequestTypes type, unsigned serverTrack, const char *serverID, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const unsigned char *xmlAsset, unsigned length);
+ SendPrepareCompressedRequest(RequestTypes type, unsigned serverTrack, const char *serverID, int64_t transactionID, unsigned stationID, unsigned characterID, int64_t assetID, const unsigned char *xmlAsset, unsigned length);
virtual ~SendPrepareCompressedRequest() {};
void pack(Base::ByteStream &msg);
private:
- long long m_transactionID;
+ int64_t m_transactionID;
unsigned m_stationID;
unsigned m_characterID;
- long long m_assetID;
+ int64_t m_assetID;
//std::string m_xml;
std::string m_serverID;
Blob m_data;
@@ -127,13 +127,13 @@ namespace AuctionTransfer
{
public:
SendAuditRequest( RequestTypes type, unsigned serverTrack, const char *gameCode, const char *serverCode,
- long long inGameAssetID, unsigned stationID, const char *event, const char *message);
+ int64_t inGameAssetID, unsigned stationID, const char *event, const char *message);
~SendAuditRequest() {};
void pack(Base::ByteStream &msg);
private:
std::string m_gameCode;
std::string m_serverCode;
- long long m_assetID;
+ int64_t m_assetID;
unsigned m_userID;
std::string m_event;
std::string m_message;
diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Response.h b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Response.h
index c7352fa20..709f4abc4 100755
--- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Response.h
+++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Response.h
@@ -22,10 +22,10 @@ namespace AuctionTransfer
public:
GetIDResponse(RequestTypes type, void *user);
virtual ~GetIDResponse() {}
- long long getNewID() { return m_transactionID; }
+ int64_t getNewID() { return m_transactionID; }
virtual void unpack(Base::ByteStream::ReadIterator &iter);
private:
- long long m_transactionID;
+ int64_t m_transactionID;
};
diff --git a/engine/server/application/CentralServer/src/shared/CentralServer.cpp b/engine/server/application/CentralServer/src/shared/CentralServer.cpp
index 2cf6f0ba9..b5dac66b5 100755
--- a/engine/server/application/CentralServer/src/shared/CentralServer.cpp
+++ b/engine/server/application/CentralServer/src/shared/CentralServer.cpp
@@ -2324,7 +2324,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
}
case constcrc("LfgStatRsp") : {
Archive::ReadIterator ri = static_cast(message).getByteStream().begin();
- GenericValueTypeMessage >> const msg(ri);
+ GenericValueTypeMessage >> const msg(ri);
m_numberOfCharacterMatchRequests += msg.getValue().first;
m_numberOfCharacterMatchResults += msg.getValue().second.first;
diff --git a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp
index c52044b8e..b75a79139 100755
--- a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp
+++ b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp
@@ -355,7 +355,7 @@ void ChatInterface::OnGetRoom(unsigned track, unsigned result, const ChatRoom *r
ChatServer::putSystemAvatarInRoom(roomName);
}
std::string lowerRoomName = toLower(roomName);
- unsigned sequence = (unsigned)user;
+ uintptr_t sequence = (uintptr_t)user;
std::unordered_map::iterator f = roomList.find(lowerRoomName);
if (f != roomList.end() && room)
{
@@ -416,7 +416,7 @@ void ChatInterface::OnGetRoom(unsigned track, unsigned result, const ChatRoom *r
//-----------------------------------------------------------------------
-void ChatInterface::queryRoom(const NetworkId & id, ConnectionServerConnection * connection, const unsigned int sequence, const std::string & roomName)
+void ChatInterface::queryRoom(const NetworkId & id, ConnectionServerConnection * connection, const uintptr_t sequence, const std::string & roomName)
{
UNREF(connection);
ChatServer::fileLog(s_enableChatRoomLogs, "ChatInterface", "queryRoom() id(%s) connection(%s) sequence(%u) roomName(%s)", id.getValueString().c_str(), ChatServer::getConnectionAddress(connection).c_str(), sequence, roomName.c_str());
@@ -1579,7 +1579,7 @@ void ChatInterface::OnCreateRoom(unsigned track,unsigned result, const ChatRoom
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnCreateRoom");
UNREF(user);
- unsigned sequence = (unsigned)user;
+ uintptr_t sequence = (uintptr_t)user;
static Unicode::String wideSWG = Unicode::narrowToWide("SOE+SWG");
static Unicode::String wideFilter = Unicode::narrowToWide("");
static ChatUnicodeString swgNode(wideSWG.data(), wideSWG.size());
@@ -1882,7 +1882,7 @@ void ChatInterface::OnEnterRoom(unsigned track, unsigned result, const ChatAvata
return;
}
- unsigned sequence = (unsigned)user;
+ uintptr_t sequence = (uintptr_t)user;
ChatAvatarId srcId;
if (srcAvatar)
@@ -2559,7 +2559,7 @@ void ChatInterface::OnLeaveRoom(unsigned track, unsigned result, const ChatAvata
return;
}
- unsigned sequence = (unsigned)user;
+ uintptr_t sequence = (uintptr_t)user;
ChatAvatarId id;
if (srcAvatar)
@@ -2913,7 +2913,7 @@ void ChatInterface::OnSendRoomMessage(unsigned track, unsigned result, const Cha
}
UNREF(srcAvatar);
UNREF(destRoom);
- unsigned sequence = (unsigned)user;
+ uintptr_t sequence = (uintptr_t)user;
ChatOnSendRoomMessage chat(sequence, result);
IGNORE_RETURN(ChatServer::sendResponseForTrackId(track, chat));
}
@@ -2998,7 +2998,7 @@ void ChatInterface::OnSendInstantMessage(unsigned track, unsigned result, const
}
UNREF(srcAvatar);
- unsigned sequence = (unsigned)user;
+ uintptr_t sequence = (uintptr_t)user;
ChatOnSendInstantMessage chat(sequence, result);
IGNORE_RETURN(ChatServer::sendResponseForTrackId(track, chat));
@@ -3053,7 +3053,7 @@ void ChatInterface::OnSendPersistentMessage(unsigned track, unsigned result, con
DEBUG_WARNING(true, ("We received an OnSendPersistentMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
- unsigned sequence = (unsigned)user;
+ uintptr_t sequence = (uintptr_t)user;
UNREF(srcAvatar);
ChatOnSendPersistentMessage chat(sequence, result);
IGNORE_RETURN(ChatServer::sendResponseForTrackId(track, chat));
diff --git a/engine/server/application/ChatServer/src/shared/ChatInterface.h b/engine/server/application/ChatServer/src/shared/ChatInterface.h
index 31c3bed67..b92212078 100755
--- a/engine/server/application/ChatServer/src/shared/ChatInterface.h
+++ b/engine/server/application/ChatServer/src/shared/ChatInterface.h
@@ -68,7 +68,7 @@ class ChatInterface : public ChatAPI
std::string getChatName(const NetworkId &id);
- void queryRoom (const NetworkId & id, ConnectionServerConnection * connection, const unsigned int sequenceId, const std::string & roomName);
+ void queryRoom (const NetworkId & id, ConnectionServerConnection * connection, const uintptr_t sequenceId, const std::string & roomName);
void updateRoomForThisChatAPI(const ChatRoom *room, const ChatAvatar *additionalAvatar);
void updateRooms();
diff --git a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp
index 187997edd..9f0bdee51 100755
--- a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp
+++ b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp
@@ -198,8 +198,7 @@ std::string ClientConnection::getCurrentActivePlayTimeDuration() const {
void ClientConnection::sendPlayTimeInfoToGameServer() const {
if (m_client && m_client->getGameConnection()) {
// update the game server with play time info
- GenericValueTypeMessage < std::pair < int32, std::pair < int32, unsigned
- long > > >
+ GenericValueTypeMessage < std::pair < int32, std::pair < int32, uint32_t > > >
const msgPlayTimeInfo(
"UpdateSessionPlayTimeInfo", std::make_pair(static_cast(m_startPlayTime), std::make_pair(static_cast(m_lastActiveTime), m_activePlayTimeDuration)));
@@ -1369,9 +1368,7 @@ ClientConnection::onValidateClient(StationId suid, const std::string &username,
}
// tell client the server-side game and subscription feature bits and which ConnectionServer we are and the current server Epoch time
- GenericValueTypeMessage < std::pair < std::pair < unsigned
- long, unsigned
- long > , std::pair < int, int32 > > >
+ GenericValueTypeMessage < std::pair < std::pair < uint32_t, uint32_t > , std::pair < int, int32 > > >
const msgFeatureBits(
"AccountFeatureBits", std::make_pair(std::make_pair(gameFeatures, subscriptionFeatures), std::make_pair(ConfigConnectionServer::getConnectionServerNumber(), static_cast(::time(nullptr)))));
send(msgFeatureBits, true);
diff --git a/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp b/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp
index 9163a15a0..6460a3300 100755
--- a/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp
+++ b/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp
@@ -21,20 +21,20 @@
namespace CSToolConnectionNamespace
{
- std::map< uint32, CSToolConnection * > toolsByID;
+ std::map< uintptr_t, CSToolConnection * > toolsByID;
}
uint32 CSToolConnection::m_curToolID = 0;
// statics
-CSToolConnection * CSToolConnection::getCSToolConnectionByToolId(uint32 id)
+CSToolConnection * CSToolConnection::getCSToolConnectionByToolId(uintptr_t id)
{
- std::map< uint32, CSToolConnection * >::iterator it = CSToolConnectionNamespace::toolsByID.find(id);
+ std::map< uintptr_t, CSToolConnection * >::iterator it = CSToolConnectionNamespace::toolsByID.find(id);
return it == CSToolConnectionNamespace::toolsByID.end() ? 0 : it->second;
}
-void CSToolConnection::validateCSTool(uint32 toolId, apiResult result, const apiSession& session)
+void CSToolConnection::validateCSTool(uintptr_t toolId, apiResult result, const apiSession& session)
{
//find the tool
CSToolConnection * p_connection = getCSToolConnectionByToolId(toolId);
diff --git a/engine/server/application/LoginServer/src/shared/CSToolConnection.h b/engine/server/application/LoginServer/src/shared/CSToolConnection.h
index 08651f09f..6690916d6 100755
--- a/engine/server/application/LoginServer/src/shared/CSToolConnection.h
+++ b/engine/server/application/LoginServer/src/shared/CSToolConnection.h
@@ -29,8 +29,8 @@ class CSToolConnection : public Connection
virtual void onConnectionClosed();
void sendToClusters( const std::string & sCommand, const std::string &sCommandLine );
- static CSToolConnection * getCSToolConnectionByToolId( uint32 id );
- static void validateCSTool( uint32 toolId, apiResult result, const apiSession & session );
+ static CSToolConnection * getCSToolConnectionByToolId( uintptr_t id );
+ static void validateCSTool( uintptr_t toolId, apiResult result, const apiSession & session );
// cluster selection interface
std::string selectCluster( const std::string & cluster );
@@ -47,7 +47,7 @@ class CSToolConnection : public Connection
uint32 m_ui32PrivilegeLevel;
std::string m_sInputBuffer;
std::string m_sUserName;
- uint32 m_toolID;
+ uintptr_t m_toolID;
static uint32 m_curToolID;
std::set< std::string > m_selectedClusters;
diff --git a/engine/server/application/LoginServer/src/shared/LoginServer.cpp b/engine/server/application/LoginServer/src/shared/LoginServer.cpp
index bd053af2e..869f6b8bd 100755
--- a/engine/server/application/LoginServer/src/shared/LoginServer.cpp
+++ b/engine/server/application/LoginServer/src/shared/LoginServer.cpp
@@ -480,7 +480,9 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter &source, const M
break;
}
}
- DEBUG_REPORT_LOG(!found, ("Tried to remove a connection server that wasn't in our list.\n"));
+ if(!found) {
+ DEBUG_REPORT_LOG(true, ("Tried to remove a connection server that wasn't in our list.\n"));
+ }
m_clusterStatusChanged = true;
} else {
WARNING_STRICT_FATAL(true, ("Programmer bug: Got ConnectionServerDown from a cluster that wasn't on the list. Probably indicates we aren't tracking connections properly.\n"));
diff --git a/engine/server/application/LoginServer/src/shared/SessionApiClient.cpp b/engine/server/application/LoginServer/src/shared/SessionApiClient.cpp
index 73ff91aef..6879a06d8 100755
--- a/engine/server/application/LoginServer/src/shared/SessionApiClient.cpp
+++ b/engine/server/application/LoginServer/src/shared/SessionApiClient.cpp
@@ -120,7 +120,7 @@ void SessionApiClient::OnSessionValidate(const apiTrackingNumber trackingNumber,
else
{
// attempt to validate a CS Tool associated with this request.
- CSToolConnection::validateCSTool( ( uint32 )userData, result, session );
+ CSToolConnection::validateCSTool( ( uintptr_t ) userData, result, session );
}
}
diff --git a/engine/server/application/LoginServer/src/shared/TaskEnableCharacter.h b/engine/server/application/LoginServer/src/shared/TaskEnableCharacter.h
index 321255324..1cb362f06 100755
--- a/engine/server/application/LoginServer/src/shared/TaskEnableCharacter.h
+++ b/engine/server/application/LoginServer/src/shared/TaskEnableCharacter.h
@@ -38,7 +38,7 @@ class TaskEnableCharacter : public DB::TaskRequest
DB::BindableLong station_id; //lint !e1925 // public data member : suppressed because this is a private inner class
DB::BindableNetworkId character_id; //lint !e1925 // public data member : suppressed because this is a private inner class
DB::BindableBool enabled; //lint !e1925 // public data member : suppressed because this is a private inner class
- DB::BindableLong result; //lint !e1925 // public data member : suppressed because this is a private inner class
+ DB::BindableLong result; //lint !e1925 // public data member : suppressed because this is a private inner class
virtual void getSQL(std::string &sql);
diff --git a/engine/server/application/TaskManager/src/shared/GameConnection.cpp b/engine/server/application/TaskManager/src/shared/GameConnection.cpp
index baa6adfb1..afbbc6cce 100755
--- a/engine/server/application/TaskManager/src/shared/GameConnection.cpp
+++ b/engine/server/application/TaskManager/src/shared/GameConnection.cpp
@@ -79,7 +79,7 @@ void GameConnection::receive(const Archive::ByteStream & message)
{
if(! m_pid)
{
- GenericValueTypeMessage msg(r);
+ GenericValueTypeMessage msg(r);
m_pid = msg.getValue();
#ifndef _WIN32
diff --git a/engine/server/application/TaskManager/src/shared/ManagerConnection.cpp b/engine/server/application/TaskManager/src/shared/ManagerConnection.cpp
index 42db20990..b67798826 100755
--- a/engine/server/application/TaskManager/src/shared/ManagerConnection.cpp
+++ b/engine/server/application/TaskManager/src/shared/ManagerConnection.cpp
@@ -103,8 +103,8 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
switch(messageType) {
case constcrc("SystemTimeCheck") :
{
- long const currentTime = static_cast(::time(nullptr));
- GenericValueTypeMessage > msg(r);
+ int32_t const currentTime = static_cast(::time(nullptr));
+ GenericValueTypeMessage > msg(r);
if (TaskManager::getNodeLabel() == "node0")
{
@@ -122,8 +122,8 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
}
case constcrc("TaskConnectionIdMessage") :
{
- static long const clockDriftFatalTimePeriod = static_cast(TaskManager::getStartTime()) + ConfigTaskManager::getClockDriftFatalIntervalSeconds();
- long const currentTime = static_cast(::time(nullptr));
+ static int32_t const clockDriftFatalTimePeriod = static_cast(TaskManager::getStartTime()) + ConfigTaskManager::getClockDriftFatalIntervalSeconds();
+ int32_t const currentTime = static_cast(::time(nullptr));
TaskConnectionIdMessage t(r);
WARNING_STRICT_FATAL(t.getServerType() != TaskConnectionIdMessage::TaskManager,
("ManagerConnection received wrong type identifier"));
@@ -150,7 +150,7 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
{
LOG("CustomerService", ("system_clock_mismatch:System clock mismatch (%d seconds) by more than %d seconds: master TaskManager epoch (%ld), remote TaskManager %s (%s) epoch (%ld). Telling remote TaskManager to terminate.", (std::max(currentTime, t.getCurrentEpochTime()) - std::min(currentTime, t.getCurrentEpochTime())), ConfigTaskManager::getMaximumClockDriftToleranceSeconds(), currentTime, t.getCommandLine().c_str(), getRemoteAddress().c_str(), t.getCurrentEpochTime()));
- GenericValueTypeMessage > > systemTimeMismatchMessage("SystemTimeMismatchMessage", std::make_pair(TaskManager::getNodeLabel(), std::make_pair(static_cast(currentTime), t.getCurrentEpochTime())));
+ GenericValueTypeMessage > > systemTimeMismatchMessage("SystemTimeMismatchMessage", std::make_pair(TaskManager::getNodeLabel(), std::make_pair(static_cast(currentTime), static_cast (t.getCurrentEpochTime()))));
send(systemTimeMismatchMessage);
}
}
@@ -166,7 +166,7 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
}
case constcrc("SystemTimeMismatchMessage") :
{
- GenericValueTypeMessage > > msg(r);
+ GenericValueTypeMessage > > msg(r);
FATAL((msg.getValue().first == "node0"), ("System clock mismatch (%d seconds) by more than %d seconds: master TaskManager epoch (%ld), self epoch (%ld)", (std::max(msg.getValue().second.first, msg.getValue().second.second) - std::min(msg.getValue().second.first, msg.getValue().second.second)), ConfigTaskManager::getMaximumClockDriftToleranceSeconds(), msg.getValue().second.first, msg.getValue().second.second));
break;
}
diff --git a/engine/server/application/TaskManager/src/shared/TaskManager.cpp b/engine/server/application/TaskManager/src/shared/TaskManager.cpp
index f4a9ec31d..356271dbc 100755
--- a/engine/server/application/TaskManager/src/shared/TaskManager.cpp
+++ b/engine/server/application/TaskManager/src/shared/TaskManager.cpp
@@ -970,7 +970,7 @@ void TaskManager::update()
ManagerConnection * master = Locator::getServer("node0");
if (master)
{
- GenericValueTypeMessage > msg("SystemTimeCheck", std::make_pair(getNodeLabel(), static_cast(timeNow)));
+ GenericValueTypeMessage > msg("SystemTimeCheck", std::make_pair(getNodeLabel(), static_cast(timeNow)));
master->send(msg);
}
}
diff --git a/engine/server/library/codegen/make_packages.pl b/engine/server/library/codegen/make_packages.pl
index 2b580a3d1..65c55c913 100755
--- a/engine/server/library/codegen/make_packages.pl
+++ b/engine/server/library/codegen/make_packages.pl
@@ -307,8 +307,9 @@ sub makeEncodeFunction
}
print OUTFILE "\tconst DBSchema::${rowtype} *row=m_\l${buffer}.findConstRowByIndex(objectId);\n";
print OUTFILE "\tWARNING_STRICT_FATAL(row==NULL,(\"Loading object %s, no ${rowtype} in the buffer\\n\",objectId.getValueString().c_str()));\n";
- print OUTFILE "\tif (!row)\n";
+ print OUTFILE "\tif (!row) {\n";
print OUTFILE "\t\treturn false;\n";
+ print OUTFILE "\t}\n";
print OUTFILE "\n";
foreach $member (@{ $packageMembers{"$classname.$package"} })
diff --git a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp
index 5b097f2c8..3972a6814 100755
--- a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp
+++ b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp
@@ -195,7 +195,9 @@ DatabaseProcess::~DatabaseProcess()
void DatabaseProcess::run(void)
{
static bool shouldSleep = ConfigServerDatabase::getShouldSleep();
- bool idle=false;
+#ifdef _DEBUG
+ bool idle = false;
+#endif
int loopcount=0;
float nextQueryCountTime=0;
@@ -261,7 +263,7 @@ void DatabaseProcess::run(void)
if (Persister::getInstance().isIdle() && Loader::getInstance().isIdle() && DataLookup::getInstance().isIdle())
{
DEBUG_REPORT_LOG(ConfigServerDatabase::getReportSaveTimes() && !idle,("Database process is idle.\n"));
- idle=true;
+ // idle=true;
if (taskService)
{
ServerIdleMessage msg(true);
@@ -270,7 +272,7 @@ void DatabaseProcess::run(void)
}
else
{
- idle=false;
+ // idle=false;
if (taskService)
{
ServerIdleMessage msg(false);
diff --git a/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp b/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp
index bad7a18cc..0ee906b93 100755
--- a/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp
+++ b/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp
@@ -37,7 +37,7 @@ bool UniverseLocator::locateObjects(DB::Session *session, const std::string &sch
void UniverseLocator::sendPostBaselinesCustomData(GameServerConnection &conn) const
{
DEBUG_REPORT_LOG(true,("Sending UniverseComplete.\n"));
- GenericValueTypeMessage const universeCompleteMessage("UniverseCompleteMessage", DatabaseProcess::getInstance().getProcessId());
+ GenericValueTypeMessage const universeCompleteMessage("UniverseCompleteMessage", DatabaseProcess::getInstance().getProcessId());
conn.send(universeCompleteMessage, true);
SetUniverseAuthoritativeMessage const setUniverseAuthoritativeMessage(conn.getProcessId());
diff --git a/engine/server/library/serverGame/src/shared/ai/AiCreatureWeaponActions.cpp b/engine/server/library/serverGame/src/shared/ai/AiCreatureWeaponActions.cpp
index 4d5498f8b..66e8cb8c4 100755
--- a/engine/server/library/serverGame/src/shared/ai/AiCreatureWeaponActions.cpp
+++ b/engine/server/library/serverGame/src/shared/ai/AiCreatureWeaponActions.cpp
@@ -102,7 +102,7 @@ PersistentCrcString const & AiCreatureWeaponActions::getCombatAction()
{
unsigned int expiredCount = 0;
- for (unsigned int i = 0; i < m_singleUseActionList.size(); ++i)
+ for (uint32_t i = 0; i < m_singleUseActionList.size(); ++i)
{
if (m_singleUseActionList[i] != 0)
{
@@ -133,7 +133,7 @@ PersistentCrcString const & AiCreatureWeaponActions::getCombatAction()
// Delayed repeat actions
{
- for (unsigned int i = 0; i < m_delayRepeatActionList.size(); ++i)
+ for (uint32_t i = 0; i < m_delayRepeatActionList.size(); ++i)
{
if (osTime > time_t(m_delayRepeatActionList[i]))
{
@@ -160,7 +160,7 @@ PersistentCrcString const & AiCreatureWeaponActions::getCombatAction()
time_t nextActionTime = 0;
unsigned int nextActionIndex = 0;
- for (unsigned int i = 0; i < m_instantRepeatActionList.size(); ++i)
+ for (uint32_t i = 0; i < m_instantRepeatActionList.size(); ++i)
{
if (osTime >= time_t(m_instantRepeatActionList[i]))
{
diff --git a/engine/server/library/serverGame/src/shared/ai/HateList.cpp b/engine/server/library/serverGame/src/shared/ai/HateList.cpp
index 496fb2b9a..2419100ca 100755
--- a/engine/server/library/serverGame/src/shared/ai/HateList.cpp
+++ b/engine/server/library/serverGame/src/shared/ai/HateList.cpp
@@ -535,8 +535,8 @@ void HateList::addServerNpAutoDeltaVariables(Archive::AutoDeltaByteStream & stre
// ----------------------------------------------------------------------
int HateList::getTimeSinceLastUpdate() const
{
- time_t const currentTime = Os::getRealSystemTime();
- time_t const timeSinceActivitiy = (currentTime - m_lastUpdateTime.get());
+ uint32_t const currentTime = Os::getRealSystemTime();
+ uint32_t const timeSinceActivitiy = (currentTime - m_lastUpdateTime.get());
return clamp(0, static_cast(timeSinceActivitiy), 1024);
}
diff --git a/engine/server/library/serverGame/src/shared/ai/HateList.h b/engine/server/library/serverGame/src/shared/ai/HateList.h
index e63690416..ec9c0fa1c 100755
--- a/engine/server/library/serverGame/src/shared/ai/HateList.h
+++ b/engine/server/library/serverGame/src/shared/ai/HateList.h
@@ -90,8 +90,8 @@ class HateList
Archive::AutoDeltaMap m_hateList;
Archive::AutoDeltaVariable m_target;
Archive::AutoDeltaVariable m_maxHate;
- Archive::AutoDeltaVariable m_lastUpdateTime;
- Archive::AutoDeltaVariable m_autoExpireTargetDuration;
+ Archive::AutoDeltaVariable m_lastUpdateTime;
+ Archive::AutoDeltaVariable m_autoExpireTargetDuration;
std::set m_recentHateList; // This is used for assist logic
};
diff --git a/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp b/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp
index d0cb7640e..52b8d2042 100755
--- a/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp
+++ b/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp
@@ -1800,11 +1800,11 @@ static void commandFuncSpatialChatInternal(Command const &, NetworkId const &act
else if (!squelched && (ConfigServerGame::getChatSpamNotifyPlayerWhenLimitedIntervalSeconds() > 0) && obj->getClient())
{
// send message telling character he can no longer talk
- const int timeNow = static_cast(::time(nullptr));
- const int chatSpamTimeEndInterval = playerObject->getChatSpamTimeEndInterval();
+ const int32_t timeNow = static_cast(::time(nullptr));
+ const int32_t chatSpamTimeEndInterval = playerObject->getChatSpamTimeEndInterval();
if ((chatSpamTimeEndInterval > timeNow) && (timeNow >= playerObject->getChatSpamNextTimeToNotifyPlayerWhenLimited()))
{
- GenericValueTypeMessage csl("ChatSpamLimited", (chatSpamTimeEndInterval - timeNow));
+ GenericValueTypeMessage csl("ChatSpamLimited", (chatSpamTimeEndInterval - timeNow));
obj->getClient()->send(csl, true);
playerObject->setChatSpamNextTimeToNotifyPlayerWhenLimited((timeNow + ConfigServerGame::getChatSpamNotifyPlayerWhenLimitedIntervalSeconds()));
@@ -1937,8 +1937,8 @@ static void commandFuncSpatialChat(Command const &, NetworkId const &actor, Netw
else if (!squelched && (ConfigServerGame::getChatSpamNotifyPlayerWhenLimitedIntervalSeconds() > 0) && obj->getClient())
{
// send message telling character he can no longer talk
- const int timeNow = static_cast(::time(nullptr));
- const int chatSpamTimeEndInterval = playerObject->getChatSpamTimeEndInterval();
+ const int32_t timeNow = static_cast(::time(nullptr));
+ const int32_t chatSpamTimeEndInterval = playerObject->getChatSpamTimeEndInterval();
if ((chatSpamTimeEndInterval > timeNow) && (timeNow >= playerObject->getChatSpamNextTimeToNotifyPlayerWhenLimited()))
{
GenericValueTypeMessage csl("ChatSpamLimited", (chatSpamTimeEndInterval - timeNow));
@@ -2877,7 +2877,7 @@ static void commandFuncPermissionListModify(Command const &, NetworkId const &ac
Unicode::UnicodeStringVector tokens;
Unicode::tokenize(params, tokens);
Unicode::String temp;
- for (int i = 0; i < tokens.size(); i++)
+ for (uint32_t i = 0; i < tokens.size(); i++)
{
if(i < tokens.size() - 2)
{
@@ -2888,7 +2888,6 @@ static void commandFuncPermissionListModify(Command const &, NetworkId const &ac
}
}
}
- size_t curpos = 0;
const Unicode::String & playerName = temp;
const Unicode::String & listName = tokens[tokens.size()-2];
const Unicode::String & action = tokens[tokens.size()-1];
@@ -8275,7 +8274,7 @@ static void commandFuncSpammer(Command const &, NetworkId const &actor, NetworkI
{
// check warden permission first or if god
const PlayerObject * gmPlayerObject = PlayerCreatureController::getPlayerObject(gm);
- if (!gmPlayerObject || (!gmPlayerObject->isWarden()) && !gmClient->isGod())
+ if (!gmPlayerObject || (!gmPlayerObject->isWarden() && !gmClient->isGod()))
{
Chat::sendSystemMessage(*gm, StringId("warden", "not_authorized"), Unicode::emptyString);
return;
@@ -8426,7 +8425,7 @@ static void commandFuncUnspammer(Command const &, NetworkId const &actor, Networ
{
// check warden permission first or if god
const PlayerObject * gmPlayerObject = PlayerCreatureController::getPlayerObject(gm);
- if (!gmPlayerObject || (!gmPlayerObject->isWarden()) && !gmClient->isGod())
+ if (!gmPlayerObject || (!gmPlayerObject->isWarden() && !gmClient->isGod()))
{
Chat::sendSystemMessage(*gm, StringId("warden", "not_authorized"), Unicode::emptyString);
return;
diff --git a/engine/server/library/serverGame/src/shared/command/CommandQueue.cpp b/engine/server/library/serverGame/src/shared/command/CommandQueue.cpp
index b80d30b36..0d16fad49 100755
--- a/engine/server/library/serverGame/src/shared/command/CommandQueue.cpp
+++ b/engine/server/library/serverGame/src/shared/command/CommandQueue.cpp
@@ -684,7 +684,7 @@ void CommandQueue::switchState()
m_eventStartTime = s_currentTime;
- const unsigned int savedQueueSize = m_queue.size();
+ const uint32_t savedQueueSize = m_queue.size();
switch ( m_state.get() )
{
case State_Waiting:
diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp
index ade32b450..fadec301d 100755
--- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp
+++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp
@@ -272,12 +272,12 @@ bool ConsoleCommandParserAi::performParsing(const NetworkId & userId, const Stri
// Hate Over Time List
{
- std::map > > const & hateOverTime = aiCreatureController->getCreature()->getHateOverTime();
+ std::map > > const & hateOverTime = aiCreatureController->getCreature()->getHateOverTime();
if (!hateOverTime.empty())
{
result += Unicode::narrowToWide(fs.sprintf("* HATE OVER TIME LIST currentGameTime=(%lu)*\n", ServerClock::getInstance().getGameTimeSeconds()));
- for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter)
+ for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter)
{
CachedNetworkId const hateTarget(iter->first);
TangibleObject const * const hateTargetTangibleObject = TangibleObject::asTangibleObject(hateTarget.getObject());
@@ -369,12 +369,12 @@ bool ConsoleCommandParserAi::performParsing(const NetworkId & userId, const Stri
// Hate Over Time List
{
- std::map > > const & hateOverTime = to->getHateOverTime();
+ std::map > > const & hateOverTime = to->getHateOverTime();
if (!hateOverTime.empty())
{
result += Unicode::narrowToWide(fs.sprintf("* HATE OVER TIME LIST currentGameTime=(%lu)*\n", ServerClock::getInstance().getGameTimeSeconds()));
- for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter)
+ for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter)
{
CachedNetworkId const hateTarget(iter->first);
TangibleObject const * const hateTargetTangibleObject = TangibleObject::asTangibleObject(hateTarget.getObject());
diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp
index a8ef94a9a..55c98d6d4 100755
--- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp
+++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp
@@ -167,7 +167,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
}
}
- unsigned long currentValue;
+ uint32_t currentValue;
IGNORE_RETURN(p->getCollectionSlotValue(*slot, currentValue));
result += Unicode::narrowToWide(FormattedString<512>().sprintf("modifying collection slot %s/%s/%s/%s value of %lu by %s for character object %s (%s)\n", slot->collection.page.book.name.c_str(), slot->collection.page.name.c_str(), slot->collection.name.c_str(), Unicode::wideToNarrow(argv[2]).c_str(), currentValue, adjustment.getValueString().c_str(), oid.getValueString().c_str(), Unicode::wideToNarrow(o->getAssignedObjectName()).c_str()));
@@ -239,7 +239,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
else
{
// grant counter-type slot
- unsigned long currentValue;
+ uint32_t currentValue;
IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue));
// quickie way to convert to an int64
@@ -316,7 +316,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
else
{
// grant counter-type slot
- unsigned long currentValue;
+ uint32_t currentValue;
IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue));
// quickie way to convert to an int64
@@ -393,7 +393,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
else
{
// grant counter-type slot
- unsigned long currentValue;
+ uint32_t currentValue;
IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue));
// quickie way to convert to an int64
@@ -456,7 +456,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
else
{
// revoke counter-type slot
- unsigned long currentValue;
+ uint32_t currentValue;
IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue));
// quickie way to convert to an int64
@@ -519,7 +519,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
else
{
// revoke counter-type slot
- unsigned long currentValue;
+ uint32_t currentValue;
IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue));
// quickie way to convert to an int64
@@ -582,7 +582,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
else
{
// revoke counter-type slot
- unsigned long currentValue;
+ uint32_t currentValue;
IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue));
// quickie way to convert to an int64
@@ -651,7 +651,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c
}
else
{
- unsigned long value;
+ uint32_t value;
IGNORE_RETURN(p->getCollectionSlotValue(**iterSlot, value));
if (value == 0)
continue;
diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp
index dc2fd5f03..26a51317f 100755
--- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp
+++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserObject.cpp
@@ -101,10 +101,7 @@ namespace ConsoleCommandParserObjectNamespace
//test handler, this should eventually be removed
void testConsentHandler(const NetworkId& player, int id, bool response)
{
- int i = 0;
- if (response == true)
- i = 1;
- DEBUG_REPORT_LOG(true, ("We received a test consent back with values NetworkId:%s Id:%d Response:%d\n", player.getValueString().c_str(), id, i));
+ DEBUG_REPORT_LOG(true, ("We received a test consent back with values NetworkId: %s Id: %d Response: %d\n", player.getValueString().c_str(), id, (response ? 1 : 0)));
}
ServerObjectTemplate const *getObjectTemplateForCreation(std::string const &templateName)
diff --git a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp
index 121e63833..4486f242a 100755
--- a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp
+++ b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp
@@ -2960,7 +2960,7 @@ PersistentCrcString const & AICreatureController::getCombatAction()
}
//-----------------------------------------------------------------------
-time_t AICreatureController::getKnockDownRecoveryTime() const
+uint32_t AICreatureController::getKnockDownRecoveryTime() const
{
AiCreatureCombatProfile const * const combatProfile = AiCreatureCombatProfile::getCombatProfile(m_aiCreatureData->m_primarySpecials);
diff --git a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h
index 83aa7a070..5b0dc038b 100755
--- a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h
+++ b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h
@@ -186,7 +186,7 @@ class AICreatureController : public CreatureController
AiMovementType getPendingMovementType() const;
PersistentCrcString const & getCombatAction();
- time_t getKnockDownRecoveryTime() const;
+ uint32_t getKnockDownRecoveryTime() const;
std::string const getCombatActionsString();
@@ -245,7 +245,7 @@ class AICreatureController : public CreatureController
Archive::AutoDeltaVariable m_frozen;
Archive::AutoDeltaVariable m_combatStartLocation;
Archive::AutoDeltaVariable m_retreating;
- Archive::AutoDeltaVariable m_retreatingStartTime;
+ Archive::AutoDeltaVariable m_retreatingStartTime;
Archive::AutoDeltaVariable m_logging;
Archive::AutoDeltaVariableCallback m_creatureName;
Archive::AutoDeltaVariable m_hibernationDelay;
diff --git a/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp b/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp
index 89668966b..cb3d32c4f 100755
--- a/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp
+++ b/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp
@@ -40,9 +40,9 @@
// ============================================================================
-unsigned long CharacterMatchManager::ms_numberOfCharacterMatchRequests = 0;
-unsigned long CharacterMatchManager::ms_numberOfCharacterMatchResults = 0;
-unsigned long CharacterMatchManager::ms_timeSpentOnCharacterMatchRequestsMs = 0;
+uint32_t CharacterMatchManager::ms_numberOfCharacterMatchRequests = 0;
+uint32_t CharacterMatchManager::ms_numberOfCharacterMatchResults = 0;
+uint32_t CharacterMatchManager::ms_timeSpentOnCharacterMatchRequestsMs = 0;
// ============================================================================
//
@@ -639,14 +639,14 @@ void CharacterMatchManager::requestMatch(NetworkId const &networkId, MatchMaking
requestCreatureObject->onCharacterMatchRetrieved(mmcr);
}
- const unsigned long endTimeMs = Clock::timeMs();
+ const uint32_t endTimeMs = Clock::timeMs();
if (endTimeMs >= startTimeMs)
{
ms_timeSpentOnCharacterMatchRequestsMs += (endTimeMs - startTimeMs);
}
else // time wrapped
{
- static const unsigned long max = std::numeric_limits::max();
+ static const uint32_t max = std::numeric_limits::max();
ms_timeSpentOnCharacterMatchRequestsMs += (max - startTimeMs + endTimeMs);
}
}
diff --git a/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.h b/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.h
index 7fe8ed0ae..900b5e888 100755
--- a/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.h
+++ b/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.h
@@ -17,14 +17,14 @@ class CharacterMatchManager
public:
static void requestMatch(NetworkId const &networkId, MatchMakingCharacterPreferenceId const &matchMakingCharacterPreferenceId);
- static void getMatchStatistics(unsigned long &numberOfCharacterMatchRequests, unsigned long &numberOfCharacterMatchResults, unsigned long &timeSpentOnCharacterMatchRequestsMs);
+ static void getMatchStatistics(uint32_t &numberOfCharacterMatchRequests, uint32_t &numberOfCharacterMatchResults, uint32_t &timeSpentOnCharacterMatchRequestsMs);
static void clearMatchStatistics();
private:
- static unsigned long ms_numberOfCharacterMatchRequests;
- static unsigned long ms_numberOfCharacterMatchResults;
- static unsigned long ms_timeSpentOnCharacterMatchRequestsMs;
+ static uint32_t ms_numberOfCharacterMatchRequests;
+ static uint32_t ms_numberOfCharacterMatchResults;
+ static uint32_t ms_timeSpentOnCharacterMatchRequestsMs;
// Disable
@@ -36,7 +36,7 @@ class CharacterMatchManager
//-----------------------------------------------------------------------
-inline void CharacterMatchManager::getMatchStatistics(unsigned long &numberOfCharacterMatchRequests, unsigned long &numberOfCharacterMatchResults, unsigned long &timeSpentOnCharacterMatchRequestsMs)
+inline void CharacterMatchManager::getMatchStatistics(uint32_t &numberOfCharacterMatchRequests, uint32_t &numberOfCharacterMatchResults, uint32_t &timeSpentOnCharacterMatchRequestsMs)
{
numberOfCharacterMatchRequests = ms_numberOfCharacterMatchRequests;
numberOfCharacterMatchResults = ms_numberOfCharacterMatchResults;
diff --git a/engine/server/library/serverGame/src/shared/core/Client.cpp b/engine/server/library/serverGame/src/shared/core/Client.cpp
index 78f2c8cac..23dd89bdf 100755
--- a/engine/server/library/serverGame/src/shared/core/Client.cpp
+++ b/engine/server/library/serverGame/src/shared/core/Client.cpp
@@ -1613,8 +1613,7 @@ void Client::receiveClientMessage(const GameNetworkMessage &message) {
}
case constcrc("UpdateSessionPlayTimeInfo") : {
Archive::ReadIterator readIterator = static_cast (message).getByteStream().begin();
- GenericValueTypeMessage < std::pair < int32, std::pair < int32, unsigned
- long > > >
+ GenericValueTypeMessage < std::pair < int32, std::pair < int32, uint32_t > > >
const msgPlayTimeInfo(readIterator);
PlayerObject *playerObject = PlayerCreatureController::getPlayerObject(safe_cast(getCharacterObject()));
diff --git a/engine/server/library/serverGame/src/shared/core/GameServer.cpp b/engine/server/library/serverGame/src/shared/core/GameServer.cpp
index 80009486b..456a20d5c 100755
--- a/engine/server/library/serverGame/src/shared/core/GameServer.cpp
+++ b/engine/server/library/serverGame/src/shared/core/GameServer.cpp
@@ -253,11 +253,11 @@ namespace GameServerNamespace
const float IDLE_CLIENTS_CHECK_TIME_SEC = 30.0f;
ServerCommandPermissionManager * s_permissionManager = 0;
- unsigned long s_frameTime;
- uint64 s_totalObjectCreateMessagesReceived;
- uint64 s_totalObjectCreateMessagesSent;
- bool s_metricsManagerInstalled = false;
- uint32 s_lastTaskKeepaliveTime = 0;
+ uint32_t s_frameTime;
+ uint64 s_totalObjectCreateMessagesReceived;
+ uint64 s_totalObjectCreateMessagesSent;
+ bool s_metricsManagerInstalled = false;
+ uint32 s_lastTaskKeepaliveTime = 0;
#ifdef _DEBUG
int s_extraDelayPerFrameMs = 0; // to emulate long loop time
@@ -266,11 +266,11 @@ namespace GameServerNamespace
std::set s_clusterStartupResidenceStructureListResponse;
std::map > s_clusterStartupResidenceStructureListByStructure;
- unsigned long getFrameRateLimit();
+ uint32_t getFrameRateLimit();
void broadCastHyperspaceOnWarp(ServerObject const * owner);
ShipObject *getAttachedShip(CreatureObject *creature);
- std::map s_pendingLoadRequests;
+ std::map s_pendingLoadRequests;
struct CtsSourceCharacterInfo
{
@@ -745,7 +745,7 @@ void GameServer::dropClient(const NetworkId& oid, const bool immediate)
//-----------------------------------------------------------------------
-unsigned long GameServer::getFrameTime() const
+uint32_t GameServer::getFrameTime() const
{
return s_frameTime;
}
@@ -895,7 +895,7 @@ void GameServer::receiveMessage(const MessageDispatch::Emitter & source, const M
if(Clock::timeMs() - s_lastTaskKeepaliveTime > 60000)
{
DEBUG_WARNING(true, ("Sending keepalive message to taskmanager for process %i", Os::getProcessId()));
- static const GenericValueTypeMessage gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
+ static const GenericValueTypeMessage gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
getInstance().m_taskManagerConnection->send(gameServerTaskManagerKeepAlive, true);
s_lastTaskKeepaliveTime = Clock::timeMs();
}
@@ -3583,14 +3583,14 @@ void GameServer::receiveMessage2(const MessageDispatch::Emitter & source, const
GenericValueTypeMessage const characterMatchStatisticsRequest(ri);
UNREF(characterMatchStatisticsRequest);
- unsigned long numberOfCharacterMatchRequests, numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs;
+ uint32_t numberOfCharacterMatchRequests, numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs;
CharacterMatchManager::getMatchStatistics(numberOfCharacterMatchRequests, numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs);
if (numberOfCharacterMatchRequests || numberOfCharacterMatchResults ||
timeSpentOnCharacterMatchRequestsMs) {
CharacterMatchManager::clearMatchStatistics();
- const GenericValueTypeMessage >> characterMatchStatisticsResponse("LfgStatRsp", std::make_pair(numberOfCharacterMatchRequests, std::make_pair(numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs)));
+ const GenericValueTypeMessage >> characterMatchStatisticsResponse("LfgStatRsp", std::make_pair(numberOfCharacterMatchRequests, std::make_pair(numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs)));
sendToCentralServer(characterMatchStatisticsResponse);
}
@@ -4048,7 +4048,7 @@ bool GameServer::requestSceneWarpDelayed(const CachedNetworkId &objectId, const
// ----------------------------------------------------------------------
-unsigned long GameServerNamespace::getFrameRateLimit()
+uint32_t GameServerNamespace::getFrameRateLimit()
{
return ServerWorld::isSpaceScene() ? ConfigServerGame::getSpaceFrameRateLimit() : ConfigServerGame::getGroundFrameRateLimit();
}
@@ -4059,17 +4059,17 @@ void GameServer::run(void)
{
getInstance().initialize();
- unsigned long lastFrameTime = 0;
+ uint32_t lastFrameTime = 0;
int oldFilesOpened = TreeFile::getNumberOfFilesOpenedTotal();
int oldSizeOpened = TreeFile::getSizeOfFilesOpenedTotal();
int newFilesOpened = 0;
int newSizeOpened = 0;
- unsigned long startTime = Clock::timeMs();
- unsigned long lastFrameProcessStartTime = startTime;
+ uint32_t startTime = Clock::timeMs();
+ uint32_t lastFrameProcessStartTime = startTime;
- const unsigned long targetFrameTime = static_cast(1000.0f/getFrameRateLimit());
+ const uint32_t targetFrameTime = static_cast(1000.0f/getFrameRateLimit());
- const GenericValueTypeMessage gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
+ const GenericValueTypeMessage gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
PROFILER_BLOCK_DEFINE(profileBlockMainLoop, "main loop");
PROFILER_BLOCK_ENTER(profileBlockMainLoop);
@@ -4186,7 +4186,7 @@ void GameServer::run(void)
alreadyReported=false;
}
- unsigned long curTime = Clock::timeMs();
+ uint32_t curTime = Clock::timeMs();
lastFrameTime = curTime-startTime;
if (!getInstance().getDone())
ServerClock::getInstance().incrementServerFrame();
@@ -5193,11 +5193,11 @@ int GameServer::getNumberOfPendingLoadRequests()
// ----------------------------------------------------------------------
-unsigned long GameServer::getOldestPendingLoadRequestTime(NetworkId & id)
+uint32_t GameServer::getOldestPendingLoadRequestTime(NetworkId & id)
{
- unsigned long oldestTime = std::numeric_limits::max();
+ uint32_t oldestTime = std::numeric_limits::max();
- std::map::const_iterator i = s_pendingLoadRequests.begin();
+ std::map::const_iterator i = s_pendingLoadRequests.begin();
for (; i != s_pendingLoadRequests.end(); ++i)
if (i->second < oldestTime)
{
diff --git a/engine/server/library/serverGame/src/shared/core/GameServer.h b/engine/server/library/serverGame/src/shared/core/GameServer.h
index 594f98791..85755bd40 100755
--- a/engine/server/library/serverGame/src/shared/core/GameServer.h
+++ b/engine/server/library/serverGame/src/shared/core/GameServer.h
@@ -87,7 +87,7 @@ public MessageDispatch::Receiver
bool isGameServerConnected (uint32 processId) const;
ConnectionServerConnection * getConnectionServerConnection (const std::string & connectionServerIp, const uint16 connectionServerPort);
uint32 getFirstGameServerForPlanet ();
- unsigned long getFrameTime () const;
+ uint32_t getFrameTime () const;
int getNumClients() const;
uint32 getProcessId () const;
uint32 getPreloadAreaId () const;
@@ -138,7 +138,7 @@ public MessageDispatch::Receiver
static bool isAtPendingLoadRequestLimit();
static int getPendingLoadRequestLimit();
static int getNumberOfPendingLoadRequests();
- static unsigned long getOldestPendingLoadRequestTime(NetworkId & id);
+ static uint32_t getOldestPendingLoadRequestTime(NetworkId & id);
static std::string getRetroactiveCtsHistory(std::string const & clusterName, NetworkId const & characterId);
static std::vector > const *> const & getRetroactiveCtsHistoryObjvars(NetworkId const & characterId);
@@ -230,7 +230,7 @@ public MessageDispatch::Receiver
bool m_gameServerReadyObjectIds;
bool m_gameServerReadyDatabaseConnected;
bool m_gameServerReadyPlanetConnected;
- uint32 m_connectionTimeout;
+ uint32_t m_connectionTimeout;
ChatServerConnection * m_chatServerConnection;
};
diff --git a/engine/server/library/serverGame/src/shared/core/ReportManager.cpp b/engine/server/library/serverGame/src/shared/core/ReportManager.cpp
index 843373c7d..074fb4834 100755
--- a/engine/server/library/serverGame/src/shared/core/ReportManager.cpp
+++ b/engine/server/library/serverGame/src/shared/core/ReportManager.cpp
@@ -54,12 +54,12 @@ namespace ReportManagerNamespace
typedef std::map ReportList;
ReportList s_reportList;
- typedef std::map ReportThrottle;
+ typedef std::map ReportThrottle;
ReportThrottle s_reportThrottle;
- time_t const s_throttleTime = 10; // seconds
- time_t const s_throttleCleanupTime = 60; // seconds
- time_t s_throttleCleanupTimer = 0; // seconds
+ uint32_t const s_throttleTime = 10; // seconds
+ uint32_t const s_throttleCleanupTime = 60; // seconds
+ uint32_t s_throttleCleanupTimer = 0; // seconds
}
using namespace ReportManagerNamespace;
@@ -114,7 +114,7 @@ void ReportManager::addReport(Unicode::String const &reportingName, NetworkId co
{
// Remove any expired throttling
- time_t const systemTime = Os::getRealSystemTime();
+ uint32_t const systemTime = Os::getRealSystemTime();
if ((systemTime - s_throttleCleanupTimer) > s_throttleCleanupTime)
{
@@ -223,7 +223,7 @@ void ReportManager::handleMessage(ChatOnRequestLog const &chatOnRequestLog)
report.append(header);
- typedef std::multimap SortedChatLog;
+ typedef std::multimap SortedChatLog;
typedef std::set SortedFromPlayers;
SortedChatLog sortedChatLog;
SortedFromPlayers sortedFromPlayers;
@@ -266,7 +266,7 @@ void ReportManager::handleMessage(ChatOnRequestLog const &chatOnRequestLog)
Unicode::String toPlayer;
Unicode::String text;
Unicode::String channel;
- time_t time;
+ uint32_t time;
for (; iterChatLog != chatLog.end(); ++iterChatLog)
{
diff --git a/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp b/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp
index 0a45f4a70..e5b7fb2cd 100755
--- a/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp
+++ b/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp
@@ -320,20 +320,22 @@ void ServerWorldNamespace::issueCollisionNearWarpWarning(Object const &object, V
//-- Only issue these for authoritative server objects. Proxy server objects will hit this condition after an intra-planet teleport.
// @todo allow proxies to know about a teleport and inform CollisionWorld so that we can always report these.
- DEBUG_WARNING(!serverObject || serverObject->isAuthoritative(),
- ("CollisionWorld::update() had %d segments for object id=[%s], template=[%s], authority=[%s], game sever id=[%d], start position=[%.2f,%.2f,%.2f], end position=[%.2f,%.2f,%.2f], object probably should have warped but collision system is not warping it.",
- segmentCount,
- object.getNetworkId().getValueString().c_str(),
- object.getObjectTemplateName(),
- serverObject ? (serverObject->isAuthoritative() ? "authoritative" : "proxy") : "",
- static_cast(GameServer::getInstance().getProcessId()),
- oldPosition_w.x,
- oldPosition_w.y,
- oldPosition_w.z,
- newPosition_w.x,
- newPosition_w.y,
- newPosition_w.z
- ));
+ if(!serverObject || serverObject->isAuthoritative()) {
+ DEBUG_WARNING(true,
+ ("CollisionWorld::update() had %d segments for object id=[%s], template=[%s], authority=[%s], game sever id=[%d], start position=[%.2f,%.2f,%.2f], end position=[%.2f,%.2f,%.2f], object probably should have warped but collision system is not warping it.",
+ segmentCount,
+ object.getNetworkId().getValueString().c_str(),
+ object.getObjectTemplateName(),
+ serverObject ? (serverObject->isAuthoritative() ? "authoritative" : "proxy") : "",
+ static_cast(GameServer::getInstance().getProcessId()),
+ oldPosition_w.x,
+ oldPosition_w.y,
+ oldPosition_w.z,
+ newPosition_w.x,
+ newPosition_w.y,
+ newPosition_w.z
+ ));
+ }
}
// ----------------------------------------------------------------------
@@ -344,20 +346,22 @@ void ServerWorldNamespace::issueCollisionFarWarpWarning(Object const &object, Ve
//-- Only issue these for authoritative server objects. Proxy server objects will hit this condition after an intra-planet teleport.
// @todo allow proxies to know about a teleport and inform CollisionWorld so that we can always report these.
- DEBUG_WARNING(!serverObject || serverObject->isAuthoritative(),
- ("CollisionWorld::update() had %d segments for object id=[%s], template=[%s], authority=[%s], game sever id=[%d], start position=[%.2f,%.2f,%.2f], end position=[%.2f,%.2f,%.2f], collision system will consider this a warp and adjust accordingly.",
- segmentCount,
- object.getNetworkId().getValueString().c_str(),
- object.getObjectTemplateName(),
- serverObject ? (serverObject->isAuthoritative() ? "authoritative" : "proxy") : "",
- static_cast(GameServer::getInstance().getProcessId()),
- oldPosition_w.x,
- oldPosition_w.y,
- oldPosition_w.z,
- newPosition_w.x,
- newPosition_w.y,
- newPosition_w.z
- ));
+ if(!serverObject || serverObject->isAuthoritative()) {
+ DEBUG_WARNING(!serverObject || serverObject->isAuthoritative(),
+ ("CollisionWorld::update() had %d segments for object id=[%s], template=[%s], authority=[%s], game sever id=[%d], start position=[%.2f,%.2f,%.2f], end position=[%.2f,%.2f,%.2f], collision system will consider this a warp and adjust accordingly.",
+ segmentCount,
+ object.getNetworkId().getValueString().c_str(),
+ object.getObjectTemplateName(),
+ serverObject ? (serverObject->isAuthoritative() ? "authoritative" : "proxy") : "",
+ static_cast(GameServer::getInstance().getProcessId()),
+ oldPosition_w.x,
+ oldPosition_w.y,
+ oldPosition_w.z,
+ newPosition_w.x,
+ newPosition_w.y,
+ newPosition_w.z
+ ));
+ }
}
// ----------------------------------------------------------------------
diff --git a/engine/server/library/serverGame/src/shared/network/Chat.cpp b/engine/server/library/serverGame/src/shared/network/Chat.cpp
index 345494639..319e82147 100755
--- a/engine/server/library/serverGame/src/shared/network/Chat.cpp
+++ b/engine/server/library/serverGame/src/shared/network/Chat.cpp
@@ -697,7 +697,7 @@ unsigned int Chat::isAllowedToEnterRoom(const CreatureObject & who, const std::s
// thus requiring more work from us here
bool isMayor = false;
std::vector cityId = CityInterface::getCitizenOfCityId(who.getNetworkId());
- for(int i = 0; i < cityId.size(); ++i){
+ for(uint32_t i = 0; i < cityId.size(); ++i){
NetworkId leader = CityInterface::getCityInfo(cityId[i]).getLeaderId();
if(playerObject && who.getNetworkId() == leader) {
isMayor = true;
diff --git a/engine/server/library/serverGame/src/shared/object/CellPermissions.cpp b/engine/server/library/serverGame/src/shared/object/CellPermissions.cpp
index 9d1dc0d09..8c7bc82be 100755
--- a/engine/server/library/serverGame/src/shared/object/CellPermissions.cpp
+++ b/engine/server/library/serverGame/src/shared/object/CellPermissions.cpp
@@ -620,7 +620,7 @@ bool CellPermissions::isOnList(PermissionList const &permList, CreatureObject co
}
if (name.rfind("account:", 0) == 0)
{
- if (std::stoi(name.substr(8, name.length())) == stationId)
+ if (static_cast(std::stoi(name.substr(8, name.length()))) == stationId)
{
return true;
}
diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp
index ab0df5831..24b03627b 100755
--- a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp
+++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp
@@ -482,7 +482,7 @@ namespace CreatureObjectNamespace
{
bool creatureIsContainedInPOBShip(CreatureObject const * creatureObject);
void findAllTargetsForGroup(CreatureObject * const targetObj, std::vector & targets);
- bool roomInGroup(GroupObject const * groupObj, int additionalMembers);
+ bool roomInGroup(GroupObject const * groupObj, uint32_t additionalMembers);
GroupMemberParam const buildGroupMemberParam(CreatureObject const * creatureObject);
void buildGroupMemberParamsFromCreatures(std::vector const & targets, GroupObject::GroupMemberParamVector & targetMemberParams);
}
@@ -6230,7 +6230,7 @@ void CreatureObject::setMood(uint32 mood)
}
else
{
- sendControllerMessageToAuthServer(CM_setMood, new MessageQueueGenericValueType(mood));
+ sendControllerMessageToAuthServer(CM_setMood, new MessageQueueGenericValueType(mood));
}
}
@@ -6655,7 +6655,7 @@ void CreatureObject::setSayMode(uint32 sayMode)
}
else
{
- sendControllerMessageToAuthServer(CM_setSayMode, new MessageQueueGenericValueType(sayMode));
+ sendControllerMessageToAuthServer(CM_setSayMode, new MessageQueueGenericValueType(sayMode));
}
}
@@ -8722,7 +8722,7 @@ void CreatureObject::setGuildId(int guildId)
//-----------------------------------------------------------------------
-void CreatureObject::setTimeToUpdateGuildWarPvpStatus(unsigned long timeToUpdateGuildWarPvpStatus)
+void CreatureObject::setTimeToUpdateGuildWarPvpStatus(uint32_t timeToUpdateGuildWarPvpStatus)
{
FATAL(!isAuthoritative(), ("setTimeToUpdateGuildWarPvpStatus called on nonauthoritative object"));
m_timeToUpdateGuildWarPvpStatus = timeToUpdateGuildWarPvpStatus;
@@ -13510,7 +13510,7 @@ void CreatureObject::pushedMe(const NetworkId & attackerId,
* @param slopeAngle the angle of the "hill", in radians
* @param expireTime the game time when the effect expires
*/
-void CreatureObject::addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime)
+void CreatureObject::addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime)
{
if (isAuthoritative())
{
@@ -13553,7 +13553,7 @@ void CreatureObject::addSlowDownEffect(const TangibleObject & defender, float co
*
* @return true if the effect was added, false if the creature already had a slow down effect
*/
-bool CreatureObject::addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime)
+bool CreatureObject::addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime)
{
// if we already are doing a slowdown, don't do another
Property * property = getProperty(SlowDownProperty::getClassPropertyId());
@@ -14235,7 +14235,7 @@ void CreatureObject::setRegenRate(Attributes::Enumerator poolAttrib, float value
// ----------------------------------------------------------------------
-void CreatureObject::setLastWaterDamageTime(unsigned long newTime)
+void CreatureObject::setLastWaterDamageTime(uint32_t newTime)
{
m_lastWaterDamageTime = newTime;
}
@@ -14995,14 +14995,13 @@ void CreatureObjectNamespace::GroupHelpers::findAllTargetsForGroup(CreatureObjec
// ----------------------------------------------------------------------
-bool CreatureObjectNamespace::GroupHelpers::roomInGroup(GroupObject const * groupObj, int additionalMembers)
+bool CreatureObjectNamespace::GroupHelpers::roomInGroup(GroupObject const * groupObj, uint32_t additionalMembers)
{
if (groupObj != 0)
{
return groupObj->doesGroupHaveRoomFor(additionalMembers);
}
- additionalMembers = std::max(0, additionalMembers);
return additionalMembers < GroupObject::maximumMembersInGroup();
}
@@ -15345,7 +15344,7 @@ void CreatureObject::addPackedAppearanceWearable(std::string const &appearanceDa
void CreatureObject::saveDecorationLayout(ServerObject const & pobSourceObject, int saveSlotNumber, std::string const & description)
{
int debugNumItems = 0;
- const unsigned long debugStartTimeMs = Clock::timeMs();
+ const uint32_t debugStartTimeMs = Clock::timeMs();
if (!isAuthoritative())
return;
@@ -15539,7 +15538,7 @@ void CreatureObject::saveDecorationLayout(ServerObject const & pobSourceObject,
if ((debugNumItems > 0) && getClient()->isGod())
{
- const unsigned long debugEndTimeMs = Clock::timeMs();
+ const uint32_t debugEndTimeMs = Clock::timeMs();
Chat::sendSystemMessage(*this, Unicode::narrowToWide(FormattedString<256>().sprintf("!!!GOD MODE STATISTICS!!! %d items saved in %lums", debugNumItems, (debugEndTimeMs - debugStartTimeMs))), Unicode::emptyString);
}
}
@@ -15548,7 +15547,7 @@ void CreatureObject::saveDecorationLayout(ServerObject const & pobSourceObject,
void CreatureObject::restoreDecorationLayout(ServerObject const & pobTargetObject, int saveSlotNumber)
{
- const unsigned long debugStartTimeMs = Clock::timeMs();
+ const uint32_t debugStartTimeMs = Clock::timeMs();
if (!isAuthoritative())
return;
@@ -15884,7 +15883,7 @@ void CreatureObject::restoreDecorationLayout(ServerObject const & pobTargetObjec
if ((debugNumItems > 0) && getClient()->isGod())
{
- const unsigned long debugEndTimeMs = Clock::timeMs();
+ const uint32_t debugEndTimeMs = Clock::timeMs();
Chat::sendSystemMessage(*this, Unicode::narrowToWide(FormattedString<256>().sprintf("!!!GOD MODE STATISTICS!!! %d items read (%d will be moved) in %lums", debugNumItems, numItemsToBeMoved, (debugEndTimeMs - debugStartTimeMs))), Unicode::emptyString);
}
}
diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.h b/engine/server/library/serverGame/src/shared/object/CreatureObject.h
index ab06cefde..7dd20d2d8 100755
--- a/engine/server/library/serverGame/src/shared/object/CreatureObject.h
+++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.h
@@ -385,8 +385,8 @@ class CreatureObject : public TangibleObject
void setPerformanceWatchTarget(NetworkId const &who);
int getGuildId() const;
void setGuildId(int guildId);
- unsigned long getTimeToUpdateGuildWarPvpStatus() const;
- void setTimeToUpdateGuildWarPvpStatus(unsigned long timeToUpdateGuildWarPvpStatus);
+ uint32_t getTimeToUpdateGuildWarPvpStatus() const;
+ void setTimeToUpdateGuildWarPvpStatus(uint32_t timeToUpdateGuildWarPvpStatus);
bool getGuildWarEnabled() const;
void setGuildWarEnabled(bool guildWarEnabled);
int getMilitiaOfCityId() const;
@@ -546,8 +546,8 @@ class CreatureObject : public TangibleObject
int loadPackedHouses();
void setClientUsesAnimationLocomotion(bool const enabled);
- void addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime);
- bool addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime);
+ void addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime);
+ bool addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime);
void removeSlowDownEffect();
void removeSlowDownEffectProxy();
void addTerrainSlopeEffect(const Vector & normal);
@@ -645,8 +645,8 @@ class CreatureObject : public TangibleObject
void setRegenRate(Attributes::Enumerator poolAttrib, float value);
float getLavaResistance() const;
- unsigned long getLastWaterDamageTime() const;
- void setLastWaterDamageTime(unsigned long newTime);
+ uint32_t getLastWaterDamageTime() const;
+ void setLastWaterDamageTime(uint32_t newTime);
std::map const & getCommandList() const;
void clearCommands();
@@ -862,7 +862,7 @@ class CreatureObject : public TangibleObject
// when switching guild war pvp status using the guild war exemption/exclusive list,
// add a delay to when the actually switch takes place, to prevent exploit of quickly
// switching in and out guiild war pvp using the guild war exemption/exclusive list
- Archive::AutoDeltaVariable m_timeToUpdateGuildWarPvpStatus;
+ Archive::AutoDeltaVariable m_timeToUpdateGuildWarPvpStatus;
Archive::AutoDeltaVariableObserver m_guildWarEnabled;
Archive::AutoDeltaVariableObserver m_militiaOfCityId;
@@ -1000,7 +1000,7 @@ class CreatureObject : public TangibleObject
bool m_fixedupPersistentBuffsAfterLoading;
bool m_fixedupLevelXpAfterLoading;
float m_lavaResistance;
- unsigned long m_lastWaterDamageTime; // used for timing last damage taken by lava (and other future harmful water types)
+ uint32_t m_lastWaterDamageTime; // used for timing last damage taken by lava (and other future harmful water types)
float m_attribRegenMultipliers[AR_count];
Archive::AutoDeltaMap m_commands; // game commands a creature may execute
@@ -1350,7 +1350,7 @@ inline float CreatureObject::getLavaResistance() const
//-----------------------------------------------------------------------
-inline unsigned long CreatureObject::getLastWaterDamageTime() const
+inline uint32_t CreatureObject::getLastWaterDamageTime() const
{
return m_lastWaterDamageTime;
}
@@ -1412,7 +1412,7 @@ inline int CreatureObject::getGuildId() const
//-----------------------------------------------------------------------
-inline unsigned long CreatureObject::getTimeToUpdateGuildWarPvpStatus() const
+inline uint32_t CreatureObject::getTimeToUpdateGuildWarPvpStatus() const
{
return m_timeToUpdateGuildWarPvpStatus.get();
}
diff --git a/engine/server/library/serverGame/src/shared/object/GroupObject.cpp b/engine/server/library/serverGame/src/shared/object/GroupObject.cpp
index 2aad93283..cfc0795ee 100755
--- a/engine/server/library/serverGame/src/shared/object/GroupObject.cpp
+++ b/engine/server/library/serverGame/src/shared/object/GroupObject.cpp
@@ -55,7 +55,7 @@ namespace GroupObjectNamespace
{
// ----------------------------------------------------------------------
- unsigned int const cs_maximumNumberInGroup = 8;
+ const uint32_t cs_maximumNumberInGroup = 8;
char const * const DEFAULT_GROUP_TEMPLATE = "object/group/group.iff";
std::map s_leaderMap;
static const std::string cs_emptyString;
@@ -226,7 +226,7 @@ void GroupObject::createAllGroupChatRooms() // static
// ----------------------------------------------------------------------
-int GroupObject::maximumMembersInGroup()
+uint32_t GroupObject::maximumMembersInGroup()
{
return cs_maximumNumberInGroup;
}
@@ -327,9 +327,8 @@ bool GroupObject::isMemberPC(NetworkId const & memberId) const
// ----------------------------------------------------------------------
-bool GroupObject::doesGroupHaveRoomFor(int additionalMembers) const
+bool GroupObject::doesGroupHaveRoomFor(uint32_t additionalMembers) const
{
- additionalMembers = std::max(0, additionalMembers);
return (m_groupMembers.size() + additionalMembers) <= cs_maximumNumberInGroup;
}
@@ -519,7 +518,7 @@ void GroupObject::removeGroupMember(NetworkId const &memberId)
else
{
GroupUpdateObserver updater(this, Archive::ADOO_generic);
- for (unsigned int i = 0; i < m_groupMembers.size(); ++i)
+ for (uint32_t i = 0; i < m_groupMembers.size(); ++i)
{
GroupMember const & member = m_groupMembers.get(i);
if (member.first == memberId)
@@ -535,7 +534,7 @@ void GroupObject::removeGroupMember(NetworkId const &memberId)
m_groupMemberProfessions.erase(i);
calcGroupLevel();
- for (unsigned int j = 0; j < m_groupPOBShipAndOwners.size(); ++j)
+ for (uint32_t j = 0; j < m_groupPOBShipAndOwners.size(); ++j)
{
if (m_groupPOBShipAndOwners.get(j).second == memberId)
{
@@ -603,7 +602,7 @@ void GroupObject::disbandGroup()
}
else if (!getKill())
{
- for (unsigned int i = 0; i < m_groupMembers.size(); ++i)
+ for (uint32_t i = 0; i < m_groupMembers.size(); ++i)
{
GroupMember const & member = m_groupMembers.get(i);
removeFromGroupVoiceChatRoom(member.first, member.second);
diff --git a/engine/server/library/serverGame/src/shared/object/GroupObject.h b/engine/server/library/serverGame/src/shared/object/GroupObject.h
index e9e98519f..aa143b23f 100755
--- a/engine/server/library/serverGame/src/shared/object/GroupObject.h
+++ b/engine/server/library/serverGame/src/shared/object/GroupObject.h
@@ -47,7 +47,7 @@ class GroupObject: public UniverseObject
static void removeFromLeaderMap (NetworkId const &leaderId, NetworkId const &groupId);
static NetworkId getGroupIdForLeader (NetworkId const &leaderId);
static void createAllGroupChatRooms ();
- static int maximumMembersInGroup();
+ static uint32_t maximumMembersInGroup();
typedef std::pair GroupMember;
typedef std::vector GroupMemberVector;
@@ -61,7 +61,7 @@ class GroupObject: public UniverseObject
bool isGroupFull () const;
int getPCMemberCount () const;
bool isMemberPC(NetworkId const & memberId) const;
- bool doesGroupHaveRoomFor(int additionalMembers) const;
+ bool doesGroupHaveRoomFor(uint32_t additionalMembers) const;
GroupMemberVector const & getGroupMembers () const;
int getGroupLevel () const;
uint32 getFormationNameCrc() const;
diff --git a/engine/server/library/serverGame/src/shared/object/PlanetObject.cpp b/engine/server/library/serverGame/src/shared/object/PlanetObject.cpp
index 0ecbb8d62..29ae6e719 100755
--- a/engine/server/library/serverGame/src/shared/object/PlanetObject.cpp
+++ b/engine/server/library/serverGame/src/shared/object/PlanetObject.cpp
@@ -2349,7 +2349,7 @@ void PlanetObject::adjustGcwImperialScore(std::string const & source, CreatureOb
// grant GCW Region Defender bonus
float bonus = 0.0f;
if (gcwCategoryData->gcwRegionDefender && PvpData::isImperialFactionId(sourceObject->getPvpFaction()) && (adjustment > 0) && (playerObject->getCurrentGcwRegion() == gcwCategory) && Pvp::getGcwDefenderRegionBonus(*sourceObject, *playerObject, bonus) && (bonus > 0.0f))
- adjustment += std::max(1ll, static_cast(static_cast(bonus) * static_cast(adjustment) / static_cast(100)));
+ adjustment += static_cast(std::max(static_cast(1), static_cast(bonus) * static_cast(adjustment) / 100));
}
LOG("CustomerService", ("GcwScore: imperial %s %d (from %s - %s)", gcwCategory.c_str(), static_cast(adjustment), source.c_str(), sourceObject->getNetworkId().getValueString().c_str()));
@@ -2394,7 +2394,7 @@ void PlanetObject::adjustGcwRebelScore(std::string const & source, CreatureObjec
// grant GCW Region Defender bonus
float bonus = 0.0f;
if (gcwCategoryData->gcwRegionDefender && PvpData::isRebelFactionId(sourceObject->getPvpFaction()) && (adjustment > 0) && (playerObject->getCurrentGcwRegion() == gcwCategory) && Pvp::getGcwDefenderRegionBonus(*sourceObject, *playerObject, bonus) && (bonus > 0.0f))
- adjustment += std::max(1ll, static_cast(static_cast(bonus) * static_cast(adjustment) / static_cast(100)));
+ adjustment += static_cast(std::max(static_cast(1), static_cast(bonus) * static_cast(adjustment) / 100));
}
LOG("CustomerService", ("GcwScore: rebel %s %d (from %s - %s)", gcwCategory.c_str(), static_cast(adjustment), source.c_str(), sourceObject->getNetworkId().getValueString().c_str()));
diff --git a/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp b/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp
index 615c88247..f429e552d 100755
--- a/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp
+++ b/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp
@@ -511,11 +511,11 @@ int PlayerObject::getCurrentBornDate()
baseTimeData.tm_wday = 0;
baseTimeData.tm_yday = 0;
baseTimeData.tm_year = 101;
- time_t baseTime = mktime(&baseTimeData);
+ uint32_t baseTime = mktime(&baseTimeData);
// get the current time and compute the birth date
- time_t currentTime = time(nullptr);
- time_t delta = (currentTime - baseTime) / (60 * 60 * 24);
+ uint32_t currentTime = time(nullptr);
+ uint32_t delta = (currentTime - baseTime) / (60 * 60 * 24);
delta += ((currentTime - baseTime) % (60 * 60 * 24) != 0 ? 1 : 0);
return int(delta);
} // PlayerObject::getCurrentBornDate
@@ -859,7 +859,7 @@ int PlayerObject::grantExperiencePoints(const std::string & experienceType, int
if (ConfigServerScript::getLogBalance() && (total != current))
{
// log the grant
- unsigned long time = ServerClock::getInstance().getGameTimeSeconds();
+ uint32_t time = ServerClock::getInstance().getGameTimeSeconds();
LOG("GameBalance", ("balancelog:%d:XP;%lu;%s;%s;%d;%d;%d;%d",
static_cast(GameServer::getInstance().getProcessId()), time,
owner->getNetworkId().getValueString().c_str(), experienceType.c_str(),
@@ -4231,7 +4231,7 @@ void PlayerObject::handleCMessageTo(const MessageToPayload &message)
{
// see if guild war pvp status has changed, and if yes, start countdown timer to change the status
if (GuildInterface::getGuildMemberGuildWarEnabled(owner->getGuildId(), owner->getNetworkId()) != owner->getGuildWarEnabled())
- owner->setTimeToUpdateGuildWarPvpStatus(ServerClock::getInstance().getGameTimeSeconds() + static_cast(ConfigServerGame::getPvpGuildWarExemptionExclusiveDelaySeconds()));
+ owner->setTimeToUpdateGuildWarPvpStatus(ServerClock::getInstance().getGameTimeSeconds() + static_cast(ConfigServerGame::getPvpGuildWarExemptionExclusiveDelaySeconds()));
}
else if (owner->getGuildWarEnabled())
{
@@ -4770,7 +4770,7 @@ void PlayerObject::logChat(int const logIndex)
{
if (m_chatLog != nullptr)
{
- time_t const logTime = Os::getRealSystemTime();
+ uint32_t const logTime = Os::getRealSystemTime();
ChatLogEntry chatLogEntry;
@@ -4834,13 +4834,13 @@ void PlayerObject::cleanChatLog()
// See if anything needs to be purged from the front of the logs
- time_t const chatLogTime = ConfigServerUtility::getChatLogMinutes() * 60;
+ uint32_t const chatLogTime = ConfigServerUtility::getChatLogMinutes() * 60;
int chatLogCount = static_cast(m_chatLog->size());
ChatLog::iterator iterChatLog = m_chatLog->begin();
while (!m_chatLog->empty())
{
- const time_t messageTime = iterChatLog->m_time;
+ const uint32_t messageTime = iterChatLog->m_time;
if (messageTime < (currentTime - chatLogTime) || (chatLogCount > ConfigServerUtility::getPlayerMaxChatLogLines()))
{
@@ -6115,7 +6115,7 @@ void PlayerObject::getByteStreamFromAutoVariable(const std::string & name, Archi
{
if(name == "quests")
{
- Archive::AutoDeltaMap(m_quests).pack(target);
+ Archive::AutoDeltaMap(m_quests).pack(target);
}
else if(name == "completedQuests")
{
@@ -6202,11 +6202,11 @@ void PlayerObject::setAutoVariableFromByteStream(const std::string & name, const
Archive::ReadIterator ri(source);
if(name == "quests")
{
- typedef Archive::AutoDeltaMap::Command Commands;
+ typedef Archive::AutoDeltaMap::Command Commands;
std::vector quests;
m_quests.clear();
- Archive::AutoDeltaMap(m_quests).unpack(ri, quests);
+ Archive::AutoDeltaMap(m_quests).unpack(ri, quests);
for (std::vector::const_iterator questIter = quests.begin(); questIter != quests.end(); ++questIter)
{
@@ -6337,14 +6337,14 @@ void PlayerObject::setPlayedTimeAccumOnly(float playedTimeAccum)
// ----------------------------------------------------------------------
-unsigned long PlayerObject::getSessionPlayTimeDuration() const
+int32_t PlayerObject::getSessionPlayTimeDuration() const
{
- time_t const sessionStartPlayTime = static_cast(m_sessionStartPlayTime.get());
+ int32_t const sessionStartPlayTime = m_sessionStartPlayTime.get();
if (sessionStartPlayTime > 0)
{
- time_t const now = ::time(nullptr);
+ int32_t const now = ::time(nullptr);
if (now > sessionStartPlayTime)
- return static_cast(now - sessionStartPlayTime);
+ return (now - sessionStartPlayTime);
}
return 0;
@@ -6352,16 +6352,16 @@ unsigned long PlayerObject::getSessionPlayTimeDuration() const
// ----------------------------------------------------------------------
-unsigned long PlayerObject::getSessionActivePlayTimeDuration() const
+int32_t PlayerObject::getSessionActivePlayTimeDuration() const
{
- unsigned long activePlayTimeDuration = m_sessionActivePlayTimeDuration.get();
+ int32_t activePlayTimeDuration = m_sessionActivePlayTimeDuration.get();
- time_t const sessionLastActiveTime = static_cast(m_sessionLastActiveTime.get());
+ int32_t const sessionLastActiveTime = m_sessionLastActiveTime.get();
if (sessionLastActiveTime > 0)
{
- time_t const now = ::time(nullptr);
+ int32_t const now = ::time(nullptr);
if (now > sessionLastActiveTime)
- activePlayTimeDuration += static_cast(now - sessionLastActiveTime);
+ activePlayTimeDuration += (now - sessionLastActiveTime);
}
return activePlayTimeDuration;
@@ -6369,7 +6369,7 @@ unsigned long PlayerObject::getSessionActivePlayTimeDuration() const
// ----------------------------------------------------------------------
-void PlayerObject::setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, unsigned long sessionActivePlayTimeDuration)
+void PlayerObject::setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, uint32_t sessionActivePlayTimeDuration)
{
// shouldn't be calling this on a non-auth object
if (!isAuthoritative())
@@ -6447,7 +6447,7 @@ int PlayerObject::getRoleIconChoice() const
void PlayerObject::setAggroImmuneDuration(int const time)
{
- m_aggroImmuneDuration = static_cast(time);
+ m_aggroImmuneDuration = static_cast(time);
m_aggroImmuneStartTime = Os::getRealSystemTime();
}
@@ -6455,7 +6455,7 @@ void PlayerObject::setAggroImmuneDuration(int const time)
bool PlayerObject::isAggroImmune() const
{
- time_t const elapsedTime = Os::getRealSystemTime() - m_aggroImmuneStartTime.get();
+ uint32_t const elapsedTime = Os::getRealSystemTime() - m_aggroImmuneStartTime.get();
return (elapsedTime < m_aggroImmuneDuration.get());
}
@@ -7185,7 +7185,7 @@ void PlayerObject::setNextGcwRatingCalcTime(bool const alwaysSendMessageToForRec
{
if (m_nextGcwRatingCalcTime.get() <= 0)
{
- time_t const nextCalcTime = CalendarTime::getNextGMTTimeOcurrence(static_cast(now), ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond());
+ uint32_t const nextCalcTime = CalendarTime::getNextGMTTimeOcurrence(static_cast(now), ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond());
if (nextCalcTime > 0)
{
m_nextGcwRatingCalcTime = static_cast(nextCalcTime);
@@ -7250,14 +7250,14 @@ void PlayerObject::handleRecalculateGcwRating()
totalRatingAdjustment = Pvp::calculateRatingAdjustment(static_cast(points), static_cast(currentRating), totalEarnedRating, totalEarnedRatingAfterDecay, cappedRatingAdjustment);
// don't apply rating loss if we are in a "rating loss exclusion interval"
- if ((totalRatingAdjustment < 0) && (Pvp::isInGcwRankDecayExclusionInterval(static_cast(nextCalcInterval))))
+ if ((totalRatingAdjustment < 0) && (Pvp::isInGcwRankDecayExclusionInterval(static_cast(nextCalcInterval))))
{
// CS log
LOG("CustomerService", ("PvP_Ranking:%s|NOT APPLYING RATING LOSS|interval %ld (%s) (%s)|current rating=%ld|points=%ld|total earned rating=%ld|total earned rating after decay=%ld|capped rating adjustment=%ld|final rating adjustment=%ld",
getAccountDescription().c_str(),
nextCalcInterval,
- CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(),
- CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(),
+ CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(),
+ CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(),
currentRating,
points,
totalEarnedRating,
@@ -7279,8 +7279,8 @@ void PlayerObject::handleRecalculateGcwRating()
LOG("CustomerService", ("PvP_Ranking:%s|interval %ld (%s) (%s)|current rating=%ld|new rating=%ld|points=%ld|total earned rating=%ld|total earned rating after decay=%ld|capped rating adjustment=%ld|final rating adjustment=%ld",
getAccountDescription().c_str(),
nextCalcInterval,
- CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(),
- CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(),
+ CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(),
+ CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(),
previousRating,
currentRating,
points,
@@ -7294,7 +7294,7 @@ void PlayerObject::handleRecalculateGcwRating()
points = 0;
// check to see if we need to do another calculation for the next interval
- nextCalcInterval = static_cast(CalendarTime::getNextGMTTimeOcurrence(static_cast(nextCalcInterval)+1, ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond()));
+ nextCalcInterval = static_cast(CalendarTime::getNextGMTTimeOcurrence(static_cast(nextCalcInterval)+1, ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond()));
if (nextCalcInterval <= 0)
break;
@@ -7406,7 +7406,7 @@ void PlayerObject::addSessionActivity(uint32 activity)
{
CreatureObject * const owner = getCreatureObject();
if (owner)
- owner->sendControllerMessageToAuthServer(CM_addSessionActivity, new MessageQueueGenericValueType(static_cast(activity)));
+ owner->sendControllerMessageToAuthServer(CM_addSessionActivity, new MessageQueueGenericValueType(static_cast(activity)));
}
}
@@ -7618,7 +7618,7 @@ bool PlayerObject::modifyCollectionSlotValue(std::string const & slotName, int64
if (currentSlotValue != newSlotValue)
{
BitArray b = collections->get();
- b.setValue(slotInfo->beginSlotId, slotInfo->endSlotId, static_cast(newSlotValue));
+ b.setValue(slotInfo->beginSlotId, slotInfo->endSlotId, static_cast(newSlotValue));
collections->set(b);
LOG("CustomerService", ("Collection:%s modified collection %d-%d (%s/%s/%s/%s) from %lu to %lu",
@@ -7629,10 +7629,10 @@ bool PlayerObject::modifyCollectionSlotValue(std::string const & slotName, int64
slotInfo->collection.page.name.c_str(),
slotInfo->collection.name.c_str(),
slotInfo->name.c_str(),
- static_cast(currentSlotValue),
- static_cast(newSlotValue)));
+ static_cast(currentSlotValue),
+ static_cast(newSlotValue)));
- bool const completedCollectionSlot = hasCompletedCollectionSlot(*slotInfo, static_cast(newSlotValue));
+ bool const completedCollectionSlot = hasCompletedCollectionSlot(*slotInfo, static_cast(newSlotValue));
// for "server first" tracking, we need to check if the collection
// is completed *BEFORE* triggering script, because script may clear
@@ -7692,7 +7692,7 @@ bool PlayerObject::modifyCollectionSlotValue(std::string const & slotName, int64
// ----------------------------------------------------------------------
-bool PlayerObject::getCollectionSlotValue(std::string const & slotName, unsigned long & value) const
+bool PlayerObject::getCollectionSlotValue(std::string const & slotName, uint32_t & value) const
{
value = 0;
@@ -7708,7 +7708,7 @@ bool PlayerObject::getCollectionSlotValue(std::string const & slotName, unsigned
// ----------------------------------------------------------------------
-bool PlayerObject::getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long & value) const
+bool PlayerObject::getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t & value) const
{
// bit-type slot
if (!slotInfo.counterTypeSlot)
@@ -7795,7 +7795,7 @@ bool PlayerObject::hasCompletedCollectionSlot(CollectionsDataTable::CollectionIn
// ----------------------------------------------------------------------
-bool PlayerObject::hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long slotValue)
+bool PlayerObject::hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t slotValue)
{
// bit-type slot
if (!slotInfo.counterTypeSlot)
@@ -8123,7 +8123,7 @@ void PlayerObject::updateChatSpamSpatialNumCharacters(NetworkId const & characte
// sync chat character count with chat server
if ((syncChatServer) || (timeNow > m_chatSpamNextTimeToSyncWithChatServer.get()))
{
- time_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched());
+ uint32_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched());
if (timeUnsquelch > 0)
timeUnsquelch += ::time(nullptr);
@@ -8166,7 +8166,7 @@ void PlayerObject::handleChatStatisticsFromChatServer(NetworkId const & characte
// sync chat character count with chat server
if (syncChatServer || ((spatialNumCharacters != m_chatSpamSpatialNumCharacters.get()) && (timeNow > m_chatSpamNextTimeToSyncWithChatServer.get())))
{
- time_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched());
+ uint32_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched());
if (timeUnsquelch > 0)
timeUnsquelch += ::time(nullptr);
diff --git a/engine/server/library/serverGame/src/shared/object/PlayerObject.h b/engine/server/library/serverGame/src/shared/object/PlayerObject.h
index eab82de30..598cdc3bc 100755
--- a/engine/server/library/serverGame/src/shared/object/PlayerObject.h
+++ b/engine/server/library/serverGame/src/shared/object/PlayerObject.h
@@ -60,7 +60,7 @@ class PlayerObject : public IntangibleObject
ChatLogEntry();
int m_index;
- time_t m_time;
+ uint32_t m_time;
};
typedef std::list ChatLog;
@@ -105,11 +105,11 @@ class PlayerObject : public IntangibleObject
float getPlayedTimeAccumOnly() const;
void setPlayedTimeAccumOnly(float playedTimeAccum);
- unsigned long getSessionPlayTimeDuration() const;
- unsigned long getSessionActivePlayTimeDuration() const;
+ int32_t getSessionPlayTimeDuration() const;
+ int32_t getSessionActivePlayTimeDuration() const;
int32 getSessionStartPlayTime() const;
int32 getSessionLastActiveTime() const;
- void setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, unsigned long sessionActivePlayTimeDuration);
+ void setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, uint32_t sessionActivePlayTimeDuration);
void setStationId(StationId account);
void setCheaterLevel(float level);
@@ -358,15 +358,15 @@ class PlayerObject : public IntangibleObject
bool modifyCollectionSlotValue(std::string const & slotName, int64 delta);
- bool getCollectionSlotValue(std::string const & slotName, unsigned long & value) const;
- bool getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long & value) const;
+ bool getCollectionSlotValue(std::string const & slotName, uint32_t & value) const;
+ bool getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t & value) const;
bool hasCompletedCollectionSlotPrereq(std::string const & slotName, std::vector * collectionInfo = nullptr) const;
bool hasCompletedCollectionSlotPrereq(CollectionsDataTable::CollectionInfoSlot const & slotInfo, std::vector * collectionInfo = nullptr) const;
bool hasCompletedCollectionSlot(std::string const & slotName) const;
bool hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo) const;
- static bool hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long slotValue);
+ static bool hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t slotValue);
bool hasCompletedCollection(std::string const & collectionName) const;
@@ -395,8 +395,8 @@ class PlayerObject : public IntangibleObject
int getChatSpamTimeEndInterval() const;
- time_t getChatSpamNextTimeToNotifyPlayerWhenLimited() const;
- void setChatSpamNextTimeToNotifyPlayerWhenLimited(time_t chatSpamNextTimeToNotifyPlayerWhenLimited);
+ int32_t getChatSpamNextTimeToNotifyPlayerWhenLimited() const;
+ void setChatSpamNextTimeToNotifyPlayerWhenLimited(int32_t chatSpamNextTimeToNotifyPlayerWhenLimited);
// citizenship info
void updateCitizenshipInfo();
@@ -554,7 +554,7 @@ class PlayerObject : public IntangibleObject
// cached here for use by the game server
Archive::AutoDeltaVariable m_sessionStartPlayTime; // time when the player started playing the character
Archive::AutoDeltaVariable m_sessionLastActiveTime; // the client will detect when the player is "active" or "inactive"; this keeps track of the last time that the client said the player was "active"; if 0, it means the client is currently "inactive"
- Archive::AutoDeltaVariable m_sessionActivePlayTimeDuration; // total amount of play time player was active (i.e. at the mouse/keyboard/joystick)
+ Archive::AutoDeltaVariable m_sessionActivePlayTimeDuration; // total amount of play time player was active (i.e. at the mouse/keyboard/joystick)
Archive::AutoDeltaVariable m_food;
Archive::AutoDeltaVariable m_maxFood;
@@ -581,8 +581,8 @@ class PlayerObject : public IntangibleObject
Archive::AutoDeltaVariable m_theaterId;
Archive::AutoDeltaVariable m_theaterLocationType;
Archive::AutoDeltaVariable m_roleIconChoice;
- Archive::AutoDeltaVariable m_aggroImmuneDuration;
- Archive::AutoDeltaVariable m_aggroImmuneStartTime;
+ Archive::AutoDeltaVariable m_aggroImmuneDuration;
+ Archive::AutoDeltaVariable m_aggroImmuneStartTime;
ChatLog * const m_chatLog;
time_t m_chatLogPurgeTime;
@@ -641,7 +641,7 @@ class PlayerObject : public IntangibleObject
Archive::AutoDeltaVariable m_chatSpamNonSpatialNumCharacters;
Archive::AutoDeltaVariable m_chatSpamTimeEndInterval;
Archive::AutoDeltaVariable m_chatSpamNextTimeToSyncWithChatServer;
- time_t m_chatSpamNextTimeToNotifyPlayerWhenLimited;
+ int32_t m_chatSpamNextTimeToNotifyPlayerWhenLimited;
// citizenship info
Archive::AutoDeltaVariable m_citizenshipCity;
@@ -1053,14 +1053,14 @@ inline int PlayerObject::getChatSpamTimeEndInterval() const
// ----------------------------------------------------------------------
-inline time_t PlayerObject::getChatSpamNextTimeToNotifyPlayerWhenLimited() const
+inline int32_t PlayerObject::getChatSpamNextTimeToNotifyPlayerWhenLimited() const
{
return m_chatSpamNextTimeToNotifyPlayerWhenLimited;
}
// ----------------------------------------------------------------------
-inline void PlayerObject::setChatSpamNextTimeToNotifyPlayerWhenLimited(time_t chatSpamNextTimeToNotifyPlayerWhenLimited)
+inline void PlayerObject::setChatSpamNextTimeToNotifyPlayerWhenLimited(int32_t chatSpamNextTimeToNotifyPlayerWhenLimited)
{
m_chatSpamNextTimeToNotifyPlayerWhenLimited = chatSpamNextTimeToNotifyPlayerWhenLimited;
}
diff --git a/engine/server/library/serverGame/src/shared/object/ResourcePoolObject.cpp b/engine/server/library/serverGame/src/shared/object/ResourcePoolObject.cpp
index 82e2a710d..92d2404a6 100755
--- a/engine/server/library/serverGame/src/shared/object/ResourcePoolObject.cpp
+++ b/engine/server/library/serverGame/src/shared/object/ResourcePoolObject.cpp
@@ -54,7 +54,7 @@ ResourcePoolObject::~ResourcePoolObject()
*/
float ResourcePoolObject::harvest(float installedEfficiency, uint32 lastHarvestTime) const
{
- int elapsedTime=static_cast(std::min(ServerClock::getInstance().getGameTimeSeconds(),m_depletedTimestamp) - lastHarvestTime);
+ uint32_t elapsedTime=static_cast(std::min(ServerClock::getInstance().getGameTimeSeconds(),static_cast(m_depletedTimestamp)) - lastHarvestTime);
if (elapsedTime < 0)
return 0;
float elapsedTicks =static_cast(elapsedTime) / static_cast(ConfigServerGame::getSecondsPerResourceTick());
diff --git a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp
index 28d56891e..33e44b0f9 100755
--- a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp
+++ b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp
@@ -241,7 +241,7 @@ namespace ServerObjectNamespace
const std::string OBJVAR_OPEN_BANK_TERMINAL_ID("open_bank_location");
- unsigned long gs_objectCount = 0;
+ uint32_t gs_objectCount = 0;
const char * const portalPropertyCrcObjectVariableName = "portalProperty.crc";
@@ -262,7 +262,7 @@ namespace ServerObjectNamespace
// sentinel to keep the messageTo current being
// handled from getting removed from m_messageTos
- std::pair, MessageToId> s_currentMessageToBeingHandled = std::make_pair(std::make_pair(0, 0), MessageToId::cms_invalid);
+ std::pair, MessageToId> s_currentMessageToBeingHandled = std::make_pair(std::make_pair(0, 0), MessageToId::cms_invalid);
// ----------------------------------------------------------------------
@@ -1295,7 +1295,7 @@ static const ConstCharCrcLowerString templateName("object/object/base/shared_obj
//-----------------------------------------------------------------------
-const unsigned long ServerObject::getObjectCount()
+const uint32_t ServerObject::getObjectCount()
{
return gs_objectCount;
}
@@ -2350,9 +2350,9 @@ bool ServerObject::handleContentsSetup()
//-----------------------------------------------------------------------
-unsigned long ServerObject::getAndIncrementMoveSequenceNumber()
+uint32_t ServerObject::getAndIncrementMoveSequenceNumber()
{
- unsigned long newValue = m_transformSequence.get();
+ uint32_t newValue = m_transformSequence.get();
newValue++;
m_transformSequence = newValue;
return newValue;
@@ -3431,7 +3431,7 @@ void ServerObject::sendToClientsInUpdateRange(const GameNetworkMessage & message
Vector combatSpamAttackerPosition_w, combatSpamDefenderPosition_w;
if (!clients.empty())
{
- static unsigned long int const controllerMessageCrc = MessageDispatch::MessageBase::makeMessageTypeFromString("ObjControllerMessage");
+ static uint32_t const controllerMessageCrc = MessageDispatch::MessageBase::makeMessageTypeFromString("ObjControllerMessage");
if (controllerMessageCrc == message.getType())
{
ObjControllerMessage const & ocm = static_cast(message);
@@ -5113,10 +5113,10 @@ bool ServerObject::setPackedObjVars(std::string const &packedVarString)
std::string ServerObject::debugGetMessageToList() const
{
- unsigned long const now = ServerClock::getInstance().getGameTimeSeconds();
+ uint32_t const now = ServerClock::getInstance().getGameTimeSeconds();
std::string result;
- time_t const timeNow = ::time(nullptr);
- for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
+ uint32_t const timeNow = ::time(nullptr);
+ for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
{
char temp[256];
@@ -5144,14 +5144,14 @@ std::string ServerObject::debugGetMessageToList() const
* @return The delivery time of the next message, or 0 if there are no more messages
*/
-unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessageToTime)
+uint32_t ServerObject::processQueuedMessageTos(uint32_t effectiveMessageToTime)
{
PROFILER_AUTO_BLOCK_DEFINE("ServerObject::processQueuedMessageTos");
if (isAuthoritative())
{
int handledMessageCount = 0;
- unsigned long startTime = Clock::timeMs();
+ uint32_t startTime = Clock::timeMs();
while (!m_messageTos.empty() && m_messageTos.begin()->second.getCallTime() <= effectiveMessageToTime)
{
++handledMessageCount;
@@ -5161,7 +5161,7 @@ unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessa
std::string nextTenMessages;
{
int count = 1;
- for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator iter = m_messageTos.begin(); ((iter != m_messageTos.end()) && (count <= 10)); ++iter, ++count)
+ for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator iter = m_messageTos.begin(); ((iter != m_messageTos.end()) && (count <= 10)); ++iter, ++count)
{
nextTenMessages += iter->second.getMethod();
nextTenMessages += ", ";
@@ -5180,7 +5180,7 @@ unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessa
break;
}
- Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator message = m_messageTos.begin();
+ Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator message = m_messageTos.begin();
// if the message is going to be recurring, create a
// new messageTo to reschedule the recurring message
@@ -5192,7 +5192,7 @@ unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessa
message->second.getMessageId(),
message->second.getMethod(),
message->second.getPackedDataVector(),
- ServerClock::getInstance().getGameTimeSeconds() + static_cast(message->second.getRecurringTime()),
+ ServerClock::getInstance().getGameTimeSeconds() + static_cast(message->second.getRecurringTime()),
false,
message->second.getDeliveryType(),
NetworkId::cms_invalid,
@@ -5408,7 +5408,7 @@ void ServerObject::handleCMessageTo(const MessageToPayload &message)
else if (message.getMethod() == "CancelRecurringMessageTo")
{
std::string const & methodName = message.getDataAsString();
- for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
+ for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
{
if ((i->second.getRecurringTime() != 0) && (i->second.getMethod() == methodName) && (i->first != s_currentMessageToBeingHandled))
{
@@ -7748,7 +7748,7 @@ void ServerObject::deliverMessageTo(MessageToPayload & message)
{
// Recurring messages can have only one instance each. Ignore
// this message if there is already a recurring one with the same method name.
- for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
+ for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
{
if ((i->second.getRecurringTime() != 0) && (i->second.getMethod() == message.getMethod()))
return;
@@ -7808,7 +7808,7 @@ int ServerObject::cancelMessageTo(std::string const & messageName)
{
removeCount = 0;
- for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();)
+ for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();)
{
if ((i->second.getMethod() == messageName) && (i->first != s_currentMessageToBeingHandled))
{
@@ -7842,7 +7842,7 @@ int ServerObject::cancelMessageToByMessageId(NetworkId const & messageId)
{
removeCount = 0;
- for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();)
+ for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();)
{
if ((i->second.getMessageId() == messageId) && (i->first != s_currentMessageToBeingHandled))
{
@@ -7872,14 +7872,14 @@ int ServerObject::cancelMessageToByMessageId(NetworkId const & messageId)
// returns -1 if object doesn't have the messageTo
int ServerObject::timeUntilMessageTo(std::string const & messageName) const
{
- for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
+ for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i)
{
if (i->second.getMethod() == messageName)
{
if ((i->first != s_currentMessageToBeingHandled) || (i->second.getRecurringTime() > 0))
{
- unsigned long const now = ServerClock::getInstance().getGameTimeSeconds();
- unsigned long const callTime = i->second.getCallTime();
+ uint32_t const now = ServerClock::getInstance().getGameTimeSeconds();
+ uint32_t const callTime = i->second.getCallTime();
if (callTime > now)
return static_cast(callTime - now);
diff --git a/engine/server/library/serverGame/src/shared/object/ServerObject.h b/engine/server/library/serverGame/src/shared/object/ServerObject.h
index 23e12f28b..7f8f9fa6b 100755
--- a/engine/server/library/serverGame/src/shared/object/ServerObject.h
+++ b/engine/server/library/serverGame/src/shared/object/ServerObject.h
@@ -260,7 +260,7 @@ class ServerObject : public Object
int getConversionId () const;
void setConversionId (int newConversionId);
- static const unsigned long getObjectCount ();
+ static const uint32_t getObjectCount ();
const bool getPositionChanged () const;
const Sphere getLocalSphere () const;
const Sphere & getSphereExtent () const;
@@ -485,7 +485,7 @@ class ServerObject : public Object
void attachStartupScripts ();
void customize (const std::string & customName, int value);
void serverObjectEndBaselines (bool fromDatabase);
- unsigned long getAndIncrementMoveSequenceNumber ();
+ uint32_t getAndIncrementMoveSequenceNumber ();
uint32 getAuthServerProcessId () const;
const int getCacheVersion () const;
Client * getClient () const;
@@ -540,7 +540,7 @@ class ServerObject : public Object
int cancelMessageTo (std::string const & messageName);
int cancelMessageToByMessageId (NetworkId const & messageId);
int timeUntilMessageTo (std::string const & messageName) const;
- unsigned long processQueuedMessageTos (unsigned long effectiveMessageToTime);
+ uint32_t processQueuedMessageTos (uint32_t effectiveMessageToTime);
std::string debugGetMessageToList () const;
bool handleTeleportFixup (bool force);
bool serverObjectInitializeFirstTimeObject(ServerObject *cell, Transform const &transform);
@@ -551,7 +551,7 @@ class ServerObject : public Object
virtual bool isVisibleOnClient (const Client & client) const = 0;
virtual void kill ();
- void performSocial (const NetworkId & target, unsigned long socialType, bool animationOk, bool textOk);
+ void performSocial (const NetworkId & target, uint32 socialType, bool animationOk, bool textOk);
void performSocial (const MessageQueueSocial & socialMsg);
void performCombatSpam (const MessageQueueCombatSpam & combatSpam, bool sendToSelf, bool sendToTarget, bool sendToBystanders);
@@ -583,7 +583,7 @@ class ServerObject : public Object
virtual void setOwnerId(const NetworkId &id);
void setSceneIdOnThisAndContents (const std::string & sceneId);
void setPlayerControlled (bool newValue);
- void speakText (NetworkId const &target, unsigned long chatType, unsigned long mood, unsigned long flags, Unicode::String const &speech, int language, Unicode::String const &oob);
+ void speakText (NetworkId const &target, uint32 chatType, uint32 mood, uint32 flags, Unicode::String const &speech, int language, Unicode::String const &oob);
virtual void speakText (MessageQueueSpatialChat const &spatialChat);
virtual void hearText (ServerObject const &source, MessageQueueSpatialChat const &spatialChat, int chatMessageIndex);
void teleportObject (Vector const & position_w, NetworkId const &targetContainer, std::string const &targetCellName, Vector const &position_p, std::string const &scriptCallback, bool forceLoadScreen = false);
@@ -798,7 +798,7 @@ class ServerObject : public Object
Archive::AutoDeltaVariableCallback m_authServerProcessId;
Archive::AutoDeltaSet m_proxyServerProcessIds;
- Archive::AutoDeltaVariable m_transformSequence;
+ Archive::AutoDeltaVariable m_transformSequence;
Archive::AutoDeltaVariable m_cacheVersion;
Archive::AutoDeltaVariable m_loadContents;
@@ -844,7 +844,7 @@ class ServerObject : public Object
private:
Archive::AutoDeltaVector m_triggerVolumeInfo;
- Archive::AutoDeltaMap, MessageToId>, MessageToPayload> m_messageTos;
+ Archive::AutoDeltaMap, MessageToId>, MessageToPayload> m_messageTos;
Sphere m_worldSphere;
diff --git a/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp b/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp
index a547127b4..b5eabfa6f 100755
--- a/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp
+++ b/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp
@@ -570,7 +570,8 @@ TangibleObject::~TangibleObject()
// look up the caller's file and line
if (callStack[callStackOffset])
{
- char lib[4 * 1024] = { '\0' };
+ // unused.
+ // char lib[4 * 1024] = { '\0' };
char file[4 * 1024] = { '\0' };
int line = 0;
REPORT_LOG(true, ("\tCall stack:"));
@@ -2341,8 +2342,8 @@ void TangibleObject::addHateOverTime(NetworkId const & target, float const hate,
if (isAuthoritative())
{
- unsigned long const currentGameTime = ServerClock::getInstance().getGameTimeSeconds();
- unsigned long const endGameTime = currentGameTime + seconds;
+ uint32_t const currentGameTime = ServerClock::getInstance().getGameTimeSeconds();
+ uint32_t const endGameTime = currentGameTime + seconds;
IGNORE_RETURN(addHate(target, hate));
@@ -5149,9 +5150,9 @@ void TangibleObject::handleCMessageTo(const MessageToPayload &message)
if (!m_hateOverTime.empty())
{
std::list expired;
- unsigned long const currentGameTime = ServerClock::getInstance().getGameTimeSeconds();
+ uint32_t const currentGameTime = ServerClock::getInstance().getGameTimeSeconds();
- for (std::map > >::const_iterator iter = m_hateOverTime.begin(); iter != m_hateOverTime.end(); ++iter)
+ for (std::map