mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-13 21:01:08 -04:00
this is a more "clean" conversion to 64 bit than the type-fixups branch, which does borrow some elements from it but has far less find and replace...it is about 98-99% done, notes to follow later
This commit is contained in:
+7
-3
@@ -94,7 +94,7 @@ elseif (UNIX)
|
||||
-fno-signed-zeros -freciprocal-math -ffp-contract=fast \
|
||||
-fno-threadsafe-statics -fslp-vectorize-aggressive -fslp-vectorize \
|
||||
-fno-stack-protector -fstrict-enums -fstrict-vtable-pointers \
|
||||
-fno-coverage-mapping -fno-spell-checking -fshort-enums -finline-functions \
|
||||
-fno-coverage-mapping -fno-spell-checking -fint16_t-enums -finline-functions \
|
||||
-finline-hint-functions -fno-unroll-loops")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
|
||||
@@ -117,13 +117,17 @@ elseif (UNIX)
|
||||
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 \
|
||||
set(CMAKE_CXX_FLAGS "-pipe -march=native -mtune=native \
|
||||
-msse -msse2 -msse3 -mmmx -m3dnow \
|
||||
-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")
|
||||
|
||||
add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -U_FORTIFY_SOURCE)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set(CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
|
||||
endif ()
|
||||
|
||||
add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -U_FORTIFY_SOURCE -D_IS_LITTLE_ENDIAN)
|
||||
|
||||
# release and debug are internal use only
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
|
||||
add_subdirectory(Miff)
|
||||
#add_subdirectory(Miff)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#line 4 "/swg/whitengold/src/engine/client/application/Miff/src/lex_yy.c"
|
||||
|
||||
#define YY_INT_ALIGNED short int
|
||||
#define YY_INT_ALIGNED int16_t int
|
||||
|
||||
/* A lexical scanner generated by flex */
|
||||
|
||||
@@ -49,10 +49,10 @@ 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 int16_t int flex_int16_t;
|
||||
typedef int flex_int32_t;
|
||||
typedef unsigned char flex_uint8_t;
|
||||
typedef unsigned short int flex_uint16_t;
|
||||
typedef uint16_t flex_uint16_t;
|
||||
typedef unsigned int flex_uint32_t;
|
||||
|
||||
/* Limits of integral types. */
|
||||
@@ -5359,7 +5359,7 @@ static int yy_get_next_buffer (void)
|
||||
while ( num_to_read <= 0 )
|
||||
{ /* Not enough room in the buffer - grow it. */
|
||||
|
||||
/* just a shorter name for the current buffer */
|
||||
/* just a int16_ter name for the current buffer */
|
||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
||||
|
||||
int yy_c_buf_p_offset =
|
||||
|
||||
@@ -32,10 +32,10 @@ int yycost; /* If yyerror is set to a nonzero value by a */
|
||||
#endif
|
||||
|
||||
|
||||
short yyss[YYMAXDEPTH]; /* the state stack */
|
||||
int16_t yyss[YYMAXDEPTH]; /* the state stack */
|
||||
YYSTYPE yyvs[YYMAXDEPTH]; /* the semantic value stack */
|
||||
YYLTYPE yyls[YYMAXDEPTH]; /* the location stack */
|
||||
short yyrq[YYMAXRULES]; /* the rule queue */
|
||||
int16_t yyrq[YYMAXRULES]; /* the rule queue */
|
||||
int yychar; /* the lookahead symbol */
|
||||
|
||||
YYSTYPE yylval; /* the semantic value of the */
|
||||
@@ -56,11 +56,11 @@ YYLTYPE yytloc; /* location data for the state at the */
|
||||
|
||||
|
||||
int yynunlexed;
|
||||
short yyunchar[YYMAXBACKUP];
|
||||
int16_t yyunchar[YYMAXBACKUP];
|
||||
YYSTYPE yyunval[YYMAXBACKUP];
|
||||
YYLTYPE yyunloc[YYMAXBACKUP];
|
||||
|
||||
short *yygssp; /* a pointer to the top of the state */
|
||||
int16_t *yygssp; /* a pointer to the top of the state */
|
||||
/* stack; only set during error */
|
||||
/* recovery. */
|
||||
|
||||
@@ -113,11 +113,11 @@ YYLTYPE loc;
|
||||
|
||||
|
||||
yyrestore(first, last)
|
||||
register short *first;
|
||||
register short *last;
|
||||
register int16_t *first;
|
||||
register int16_t *last;
|
||||
{
|
||||
register short *ssp;
|
||||
register short *rp;
|
||||
register int16_t *ssp;
|
||||
register int16_t *rp;
|
||||
register int symbol;
|
||||
register int state;
|
||||
register int tvalsaved;
|
||||
@@ -177,15 +177,15 @@ yyparse()
|
||||
{
|
||||
register int yystate;
|
||||
register int yyn;
|
||||
register short *yyssp;
|
||||
register short *yyrq0;
|
||||
register short *yyptr;
|
||||
register int16_t *yyssp;
|
||||
register int16_t *yyrq0;
|
||||
register int16_t *yyptr;
|
||||
register YYSTYPE *yyvsp;
|
||||
|
||||
int yylen;
|
||||
YYLTYPE *yylsp;
|
||||
short *yyrq1;
|
||||
short *yyrq2;
|
||||
int16_t *yyrq1;
|
||||
int16_t *yyrq2;
|
||||
|
||||
yystate = 0;
|
||||
yyssp = yyss - 1;
|
||||
|
||||
@@ -225,15 +225,15 @@ yyparse(YYPARSE_PARAM_ARG)
|
||||
{
|
||||
register int yystate;
|
||||
register int yyn;
|
||||
register short *yyssp;
|
||||
register int16_t *yyssp;
|
||||
register YYSTYPE *yyvsp;
|
||||
int yyerrstatus; /* number of tokens to shift before error messages enabled */
|
||||
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
|
||||
|
||||
short yyssa[YYINITDEPTH]; /* the state stack */
|
||||
int16_t yyssa[YYINITDEPTH]; /* the state stack */
|
||||
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
|
||||
|
||||
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
|
||||
int16_t *yyss = yyssa; /* refer to the stacks thru separate pointers */
|
||||
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
|
||||
|
||||
#ifdef YYLSP_NEEDED
|
||||
@@ -296,7 +296,7 @@ yynewstate:
|
||||
/* Give user a chance to reallocate the stack */
|
||||
/* Use copies of these so that the &'s don't force the real ones into memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
short *yyss1 = yyss;
|
||||
int16_t *yyss1 = yyss;
|
||||
#ifdef YYLSP_NEEDED
|
||||
YYLTYPE *yyls1 = yyls;
|
||||
#endif
|
||||
@@ -336,7 +336,7 @@ yynewstate:
|
||||
yystacksize *= 2;
|
||||
if (yystacksize > YYMAXDEPTH)
|
||||
yystacksize = YYMAXDEPTH;
|
||||
yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
|
||||
yyss = (int16_t *) alloca (yystacksize * sizeof (*yyssp));
|
||||
__yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
|
||||
yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
|
||||
__yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
|
||||
@@ -511,7 +511,7 @@ $ /* the action file gets copied in in place of this dollarsign */
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
short *ssp1 = yyss - 1;
|
||||
int16_t *ssp1 = yyss - 1;
|
||||
fprintf (stderr, "state stack now");
|
||||
while (ssp1 != yyssp)
|
||||
fprintf (stderr, " %d", *++ssp1);
|
||||
@@ -644,7 +644,7 @@ yyerrpop: /* pop the current state because it cannot handle the error token */
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
short *ssp1 = yyss - 1;
|
||||
int16_t *ssp1 = yyss - 1;
|
||||
fprintf (stderr, "Error: state stack now");
|
||||
while (ssp1 != yyssp)
|
||||
fprintf (stderr, " %d", *++ssp1);
|
||||
|
||||
@@ -96,7 +96,7 @@ char err_msg[256];
|
||||
errorType errorFlag = ERR_NONE; // assume no error (default)
|
||||
|
||||
|
||||
// long and short name definitions for command line options
|
||||
// long and int16_t name definitions for command line options
|
||||
|
||||
static const char * const LNAME_HELP = "help";
|
||||
static const char * const LNAME_INPUT_FILE = "inputfile";
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// #pragma warning (disable: 6311) /* compiler malloc.h: see previous definition of alloca() */
|
||||
|
||||
/* include files */
|
||||
#include <stdint.h>
|
||||
#include <math.h> /* for pow() and stuff */
|
||||
#include <string.h>
|
||||
#include <stdlib.h> /* for toupper() */
|
||||
@@ -67,10 +68,10 @@ void checkPragmas(void);
|
||||
void includeBinary(char *fname);
|
||||
|
||||
void write32(long i32);
|
||||
void write16(short i16);
|
||||
void write16(int16_t i16);
|
||||
void write8(char i8);
|
||||
void writeU32(unsigned long ui32);
|
||||
void writeU16(unsigned short ui16);
|
||||
void writeU16(uint16_t ui16);
|
||||
void writeU8(unsigned char u8);
|
||||
void writeDouble(double d);
|
||||
void writeFloat(float f);
|
||||
@@ -126,7 +127,7 @@ int usePragmas;
|
||||
**------------------------------------------------------------------------*/
|
||||
int iTemp, jTemp;
|
||||
char byteTemp;
|
||||
short wordTemp;
|
||||
int16_t wordTemp;
|
||||
char tempStr[MAX_STRING_SIZE];
|
||||
|
||||
%}
|
||||
@@ -447,8 +448,8 @@ l32AllocExpr: exprL { write32($<ltype>1); }
|
||||
| l32AllocExpr ',' exprL { write32($<ltype>3); }
|
||||
;
|
||||
|
||||
l16AllocExpr: exprL { write16((short) $<ltype>1); }
|
||||
| l16AllocExpr ',' exprL { write16((short) $<ltype>3); }
|
||||
l16AllocExpr: exprL { write16((int16_t) $<ltype>1); }
|
||||
| l16AllocExpr ',' exprL { write16((int16_t) $<ltype>3); }
|
||||
;
|
||||
|
||||
l8AllocExpr: exprL { write8((char) $<ltype>1); }
|
||||
@@ -459,8 +460,8 @@ lU32AllocExpr: exprL { writeU32($<ltype>1); }
|
||||
| lU32AllocExpr ',' exprL { writeU32($<ltype>3); }
|
||||
;
|
||||
|
||||
lU16AllocExpr: exprL { writeU16((unsigned short) $<ltype>1); }
|
||||
| lU16AllocExpr ',' exprL { writeU16((unsigned short) $<ltype>3); }
|
||||
lU16AllocExpr: exprL { writeU16((uint16_t) $<ltype>1); }
|
||||
| lU16AllocExpr ',' exprL { writeU16((uint16_t) $<ltype>3); }
|
||||
;
|
||||
|
||||
lU8AllocExpr: exprL { writeU8((unsigned char) $<ltype>1); }
|
||||
@@ -632,9 +633,9 @@ void write32(long i32)
|
||||
MIFFinsertChunkData(&i32, sizeof(long));
|
||||
}
|
||||
|
||||
void write16(short i16)
|
||||
void write16(int16_t i16)
|
||||
{
|
||||
MIFFinsertChunkData(&i16, sizeof(short));
|
||||
MIFFinsertChunkData(&i16, sizeof(int16_t));
|
||||
}
|
||||
|
||||
void write8(char i8)
|
||||
@@ -647,9 +648,9 @@ void writeU32(unsigned long ui32)
|
||||
MIFFinsertChunkData(&ui32, sizeof(long));
|
||||
}
|
||||
|
||||
void writeU16(unsigned short ui16)
|
||||
void writeU16(uint16_t ui16)
|
||||
{
|
||||
MIFFinsertChunkData(&ui16, sizeof(short));
|
||||
MIFFinsertChunkData(&ui16, sizeof(int16_t));
|
||||
}
|
||||
|
||||
void writeU8(unsigned char ui8)
|
||||
|
||||
@@ -135,10 +135,10 @@ void checkPragmas(void);
|
||||
void includeBinary(char *fname);
|
||||
|
||||
void write32(long i32);
|
||||
void write16(short i16);
|
||||
void write16(int16_t i16);
|
||||
void write8(char i8);
|
||||
void writeU32(unsigned long ui32);
|
||||
void writeU16(unsigned short ui16);
|
||||
void writeU16(uint16_t ui16);
|
||||
void writeU8(unsigned char u8);
|
||||
void writeDouble(double d);
|
||||
void writeFloat(float f);
|
||||
@@ -194,7 +194,7 @@ int usePragmas;
|
||||
**------------------------------------------------------------------------*/
|
||||
int iTemp, jTemp;
|
||||
char byteTemp;
|
||||
short wordTemp;
|
||||
int16_t wordTemp;
|
||||
char tempStr[MAX_STRING_SIZE];
|
||||
|
||||
|
||||
@@ -300,8 +300,8 @@ typedef union YYSTYPE
|
||||
/* Line 343 of yacc.c */
|
||||
#line 302 "/swg/whitengold/src/engine/client/application/Miff/src/parser.c"
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
#ifdef int16_t
|
||||
# undef int16_t
|
||||
#endif
|
||||
|
||||
#ifdef YYTYPE_UINT8
|
||||
@@ -316,19 +316,19 @@ typedef YYTYPE_INT8 yytype_int8;
|
||||
|| defined __cplusplus || defined _MSC_VER)
|
||||
typedef signed char yytype_int8;
|
||||
#else
|
||||
typedef short int yytype_int8;
|
||||
typedef int16_t int yytype_int8;
|
||||
#endif
|
||||
|
||||
#ifdef YYTYPE_UINT16
|
||||
typedef YYTYPE_UINT16 yytype_uint16;
|
||||
#else
|
||||
typedef unsigned short int yytype_uint16;
|
||||
typedef uint16_t yytype_uint16;
|
||||
#endif
|
||||
|
||||
#ifdef YYTYPE_INT16
|
||||
typedef YYTYPE_INT16 yytype_int16;
|
||||
#else
|
||||
typedef short int yytype_int16;
|
||||
typedef int16_t int yytype_int16;
|
||||
#endif
|
||||
|
||||
#ifndef YYSIZE_T
|
||||
@@ -2145,14 +2145,14 @@ yyreduce:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 450 "/swg/whitengold/src/engine/client/application/Miff/src/linux/parser.yac"
|
||||
{ write16((short) (yyvsp[(1) - (1)].ltype)); }
|
||||
{ write16((int16_t) (yyvsp[(1) - (1)].ltype)); }
|
||||
break;
|
||||
|
||||
case 62:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 451 "/swg/whitengold/src/engine/client/application/Miff/src/linux/parser.yac"
|
||||
{ write16((short) (yyvsp[(3) - (3)].ltype)); }
|
||||
{ write16((int16_t) (yyvsp[(3) - (3)].ltype)); }
|
||||
break;
|
||||
|
||||
case 63:
|
||||
@@ -2187,14 +2187,14 @@ yyreduce:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 462 "/swg/whitengold/src/engine/client/application/Miff/src/linux/parser.yac"
|
||||
{ writeU16((unsigned short) (yyvsp[(1) - (1)].ltype)); }
|
||||
{ writeU16((uint16_t) (yyvsp[(1) - (1)].ltype)); }
|
||||
break;
|
||||
|
||||
case 68:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 463 "/swg/whitengold/src/engine/client/application/Miff/src/linux/parser.yac"
|
||||
{ writeU16((unsigned short) (yyvsp[(3) - (3)].ltype)); }
|
||||
{ writeU16((uint16_t) (yyvsp[(3) - (3)].ltype)); }
|
||||
break;
|
||||
|
||||
case 69:
|
||||
@@ -2834,9 +2834,9 @@ void write32(long i32)
|
||||
MIFFinsertChunkData(&i32, sizeof(long));
|
||||
}
|
||||
|
||||
void write16(short i16)
|
||||
void write16(int16_t i16)
|
||||
{
|
||||
MIFFinsertChunkData(&i16, sizeof(short));
|
||||
MIFFinsertChunkData(&i16, sizeof(int16_t));
|
||||
}
|
||||
|
||||
void write8(char i8)
|
||||
@@ -2849,9 +2849,9 @@ void writeU32(unsigned long ui32)
|
||||
MIFFinsertChunkData(&ui32, sizeof(long));
|
||||
}
|
||||
|
||||
void writeU16(unsigned short ui16)
|
||||
void writeU16(uint16_t ui16)
|
||||
{
|
||||
MIFFinsertChunkData(&ui16, sizeof(short));
|
||||
MIFFinsertChunkData(&ui16, sizeof(int16_t));
|
||||
}
|
||||
|
||||
void writeU8(unsigned char ui8)
|
||||
|
||||
@@ -32,10 +32,10 @@ int yycost; /* If yyerror is set to a nonzero value by a */
|
||||
#endif
|
||||
|
||||
|
||||
short yyss[YYMAXDEPTH]; /* the state stack */
|
||||
int16_t yyss[YYMAXDEPTH]; /* the state stack */
|
||||
YYSTYPE yyvs[YYMAXDEPTH]; /* the semantic value stack */
|
||||
YYLTYPE yyls[YYMAXDEPTH]; /* the location stack */
|
||||
short yyrq[YYMAXRULES]; /* the rule queue */
|
||||
int16_t yyrq[YYMAXRULES]; /* the rule queue */
|
||||
int yychar; /* the lookahead symbol */
|
||||
|
||||
YYSTYPE yylval; /* the semantic value of the */
|
||||
@@ -56,11 +56,11 @@ YYLTYPE yytloc; /* location data for the state at the */
|
||||
|
||||
|
||||
int yynunlexed;
|
||||
short yyunchar[YYMAXBACKUP];
|
||||
int16_t yyunchar[YYMAXBACKUP];
|
||||
YYSTYPE yyunval[YYMAXBACKUP];
|
||||
YYLTYPE yyunloc[YYMAXBACKUP];
|
||||
|
||||
short *yygssp; /* a pointer to the top of the state */
|
||||
int16_t *yygssp; /* a pointer to the top of the state */
|
||||
/* stack; only set during error */
|
||||
/* recovery. */
|
||||
|
||||
@@ -113,11 +113,11 @@ YYLTYPE loc;
|
||||
|
||||
|
||||
yyrestore(first, last)
|
||||
register short *first;
|
||||
register short *last;
|
||||
register int16_t *first;
|
||||
register int16_t *last;
|
||||
{
|
||||
register short *ssp;
|
||||
register short *rp;
|
||||
register int16_t *ssp;
|
||||
register int16_t *rp;
|
||||
register int symbol;
|
||||
register int state;
|
||||
register int tvalsaved;
|
||||
@@ -177,15 +177,15 @@ yyparse()
|
||||
{
|
||||
register int yystate;
|
||||
register int yyn;
|
||||
register short *yyssp;
|
||||
register short *yyrq0;
|
||||
register short *yyptr;
|
||||
register int16_t *yyssp;
|
||||
register int16_t *yyrq0;
|
||||
register int16_t *yyptr;
|
||||
register YYSTYPE *yyvsp;
|
||||
|
||||
int yylen;
|
||||
YYLTYPE *yylsp;
|
||||
short *yyrq1;
|
||||
short *yyrq2;
|
||||
int16_t *yyrq1;
|
||||
int16_t *yyrq2;
|
||||
|
||||
yystate = 0;
|
||||
yyssp = yyss - 1;
|
||||
|
||||
@@ -225,15 +225,15 @@ yyparse(YYPARSE_PARAM_ARG)
|
||||
{
|
||||
register int yystate;
|
||||
register int yyn;
|
||||
register short *yyssp;
|
||||
register int16_t *yyssp;
|
||||
register YYSTYPE *yyvsp;
|
||||
int yyerrstatus; /* number of tokens to shift before error messages enabled */
|
||||
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
|
||||
|
||||
short yyssa[YYINITDEPTH]; /* the state stack */
|
||||
int16_t yyssa[YYINITDEPTH]; /* the state stack */
|
||||
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
|
||||
|
||||
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
|
||||
int16_t *yyss = yyssa; /* refer to the stacks thru separate pointers */
|
||||
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
|
||||
|
||||
#ifdef YYLSP_NEEDED
|
||||
@@ -296,7 +296,7 @@ yynewstate:
|
||||
/* Give user a chance to reallocate the stack */
|
||||
/* Use copies of these so that the &'s don't force the real ones into memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
short *yyss1 = yyss;
|
||||
int16_t *yyss1 = yyss;
|
||||
#ifdef YYLSP_NEEDED
|
||||
YYLTYPE *yyls1 = yyls;
|
||||
#endif
|
||||
@@ -336,7 +336,7 @@ yynewstate:
|
||||
yystacksize *= 2;
|
||||
if (yystacksize > YYMAXDEPTH)
|
||||
yystacksize = YYMAXDEPTH;
|
||||
yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
|
||||
yyss = (int16_t *) alloca (yystacksize * sizeof (*yyssp));
|
||||
__yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
|
||||
yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
|
||||
__yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
|
||||
@@ -511,7 +511,7 @@ $ /* the action file gets copied in in place of this dollarsign */
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
short *ssp1 = yyss - 1;
|
||||
int16_t *ssp1 = yyss - 1;
|
||||
fprintf (stderr, "state stack now");
|
||||
while (ssp1 != yyssp)
|
||||
fprintf (stderr, " %d", *++ssp1);
|
||||
@@ -651,7 +651,7 @@ yyerrpop: /* pop the current state because it cannot handle the error token */
|
||||
#if YYDEBUG != 0
|
||||
if (yydebug)
|
||||
{
|
||||
short *ssp1 = yyss - 1;
|
||||
int16_t *ssp1 = yyss - 1;
|
||||
fprintf (stderr, "Error: state stack now");
|
||||
while (ssp1 != yyssp)
|
||||
fprintf (stderr, " %d", *++ssp1);
|
||||
|
||||
@@ -99,7 +99,7 @@ char err_msg[512];
|
||||
errorType errorFlag = ERR_NONE; // assume no error (default)
|
||||
|
||||
|
||||
// long and short name definitions for command line options
|
||||
// long and int16_t name definitions for command line options
|
||||
|
||||
static const char * const LNAME_HELP = "help";
|
||||
static const char * const LNAME_INPUT_FILE = "inputfile";
|
||||
|
||||
@@ -68,10 +68,10 @@ void checkPragmas(void);
|
||||
void includeBinary(char *fname);
|
||||
|
||||
void write32(long i32);
|
||||
void write16(short i16);
|
||||
void write16(int16_t i16);
|
||||
void write8(char i8);
|
||||
void writeU32(unsigned long ui32);
|
||||
void writeU16(unsigned short ui16);
|
||||
void writeU16(uint16_t ui16);
|
||||
void writeU8(unsigned char u8);
|
||||
void writeDouble(double d);
|
||||
void writeFloat(float f);
|
||||
@@ -127,7 +127,7 @@ int usePragmas;
|
||||
**------------------------------------------------------------------------*/
|
||||
int iTemp, jTemp;
|
||||
char byteTemp;
|
||||
short wordTemp;
|
||||
int16_t wordTemp;
|
||||
char tempStr[MAX_STRING_SIZE];
|
||||
|
||||
%}
|
||||
@@ -448,8 +448,8 @@ l32AllocExpr: exprL { write32($<ltype>1); }
|
||||
| l32AllocExpr ',' exprL { write32($<ltype>3); }
|
||||
;
|
||||
|
||||
l16AllocExpr: exprL { write16((short) $<ltype>1); }
|
||||
| l16AllocExpr ',' exprL { write16((short) $<ltype>3); }
|
||||
l16AllocExpr: exprL { write16((int16_t) $<ltype>1); }
|
||||
| l16AllocExpr ',' exprL { write16((int16_t) $<ltype>3); }
|
||||
;
|
||||
|
||||
l8AllocExpr: exprL { write8((char) $<ltype>1); }
|
||||
@@ -460,8 +460,8 @@ lU32AllocExpr: exprL { writeU32($<ltype>1); }
|
||||
| lU32AllocExpr ',' exprL { writeU32($<ltype>3); }
|
||||
;
|
||||
|
||||
lU16AllocExpr: exprL { writeU16((unsigned short) $<ltype>1); }
|
||||
| lU16AllocExpr ',' exprL { writeU16((unsigned short) $<ltype>3); }
|
||||
lU16AllocExpr: exprL { writeU16((uint16_t) $<ltype>1); }
|
||||
| lU16AllocExpr ',' exprL { writeU16((uint16_t) $<ltype>3); }
|
||||
;
|
||||
|
||||
lU8AllocExpr: exprL { writeU8((unsigned char) $<ltype>1); }
|
||||
@@ -633,9 +633,9 @@ void write32(long i32)
|
||||
MIFFinsertChunkData(&i32, sizeof(long));
|
||||
}
|
||||
|
||||
void write16(short i16)
|
||||
void write16(int16_t i16)
|
||||
{
|
||||
MIFFinsertChunkData(&i16, sizeof(short));
|
||||
MIFFinsertChunkData(&i16, sizeof(int16_t));
|
||||
}
|
||||
|
||||
void write8(char i8)
|
||||
@@ -648,9 +648,9 @@ void writeU32(unsigned long ui32)
|
||||
MIFFinsertChunkData(&ui32, sizeof(long));
|
||||
}
|
||||
|
||||
void writeU16(unsigned short ui16)
|
||||
void writeU16(uint16_t ui16)
|
||||
{
|
||||
MIFFinsertChunkData(&ui16, sizeof(short));
|
||||
MIFFinsertChunkData(&ui16, sizeof(int16_t));
|
||||
}
|
||||
|
||||
void writeU8(unsigned char ui8)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "sharedLog/Log.h"
|
||||
|
||||
|
||||
AuctionTransferClient::AuctionTransferClient(const char *hostName[], const short port[], int count, const char *identifier[], unsigned identifierCount) :
|
||||
AuctionTransferClient::AuctionTransferClient(const char *hostName[], int16_t port[], int count, const char *identifier[], unsigned identifierCount) :
|
||||
AuctionTransferAPI( hostName, port, count, identifier, identifierCount )
|
||||
{
|
||||
}
|
||||
@@ -14,12 +14,12 @@ AuctionTransferClient::~AuctionTransferClient()
|
||||
|
||||
|
||||
// Connection status callbacks
|
||||
void AuctionTransferClient::onConnect(const char* host, unsigned short port, const short current, const short max)
|
||||
void AuctionTransferClient::onConnect(const char* host, uint16_t port, int16_t current, int16_t max)
|
||||
{
|
||||
LOG("AuctionTransferClient", ("onConnect"));
|
||||
}
|
||||
|
||||
void AuctionTransferClient::onDisconnect(const char *host, const short port, const short current, const short max)
|
||||
void AuctionTransferClient::onDisconnect(const char *host, int16_t port, int16_t current, int16_t max)
|
||||
{
|
||||
LOG("AuctionTransferClient", ("onDisconnect"));
|
||||
}
|
||||
|
||||
@@ -4,58 +4,56 @@
|
||||
|
||||
#ifndef _WIN32
|
||||
#include "AuctionTransferGameAPI/AuctionTransferAPI.h"
|
||||
#include <stdint.h>
|
||||
#else
|
||||
|
||||
namespace AuctionTransfer
|
||||
{
|
||||
class AuctionTransferAPI
|
||||
{
|
||||
public:
|
||||
AuctionTransferAPI( const char *[], const short [], int , const char *[], unsigned )
|
||||
AuctionTransferAPI( const char *[], int16_t [], int , const char *[], unsigned )
|
||||
{};
|
||||
virtual void process() {};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class AuctionTransferClient : public AuctionTransfer::AuctionTransferAPI
|
||||
{
|
||||
public:
|
||||
AuctionTransferClient(const char *hostName[], const short port[], int count, const char *identifier[], unsigned identifierCount);
|
||||
AuctionTransferClient(const char *hostName[], int16_t port[], int count, const char *identifier[], unsigned identifierCount);
|
||||
virtual ~AuctionTransferClient();
|
||||
|
||||
|
||||
// Connection status callbacks
|
||||
virtual void onConnect(const char* host, unsigned short port, const short current, const short max);
|
||||
virtual void onDisconnect(const char *host, const short port, const short current, const short max);
|
||||
virtual void onConnect(const char* host, uint16_t port, int16_t current, int16_t max);
|
||||
virtual void onDisconnect(const char *host, int16_t port, int16_t current, int16_t max);
|
||||
|
||||
|
||||
// Callbacks that are responses
|
||||
void onSendPrepareTransaction(unsigned int, unsigned int, void *) {};
|
||||
void onSendPrepareTransactionCompressed(unsigned int, unsigned int, void *) {};
|
||||
void onSendCommitTransaction(unsigned int, unsigned int, void *) {};
|
||||
void onSendAbortTransaction(unsigned int, unsigned int, void *) {};
|
||||
void onSendAuditAssetTransfer(unsigned int, unsigned int, void *) {};
|
||||
void onSendPrepareTransaction(uint32_t, uint32_t, void *) {};
|
||||
void onSendPrepareTransactionCompressed(uint32_t, uint32_t, void *) {};
|
||||
void onSendCommitTransaction(uint32_t, uint32_t, void *) {};
|
||||
void onSendAbortTransaction(uint32_t, uint32_t, void *) {};
|
||||
void onSendAuditAssetTransfer(uint32_t, uint32_t, void *) {};
|
||||
|
||||
void onGetNewTransactionID(unsigned int, unsigned int, int64, void *) {};
|
||||
void onGetNewTransactionID(uint32_t, uint32_t, int64, void *) {};
|
||||
|
||||
// Responses to reply requests
|
||||
void onReplyReceivePrepareTransaction(unsigned int, unsigned int, void *) {};
|
||||
void onReplyReceiveCommitTransaction(unsigned int, unsigned int, void *) {};
|
||||
void onReplyReceiveAbortTransaction(unsigned int, unsigned int, void *) {};
|
||||
void onReplyReceiveGetCharacterList(unsigned int, unsigned int, void *) {};
|
||||
void onReplyReceivePrepareTransaction(uint32_t, uint32_t, void *) {};
|
||||
void onReplyReceiveCommitTransaction(uint32_t, uint32_t, void *) {};
|
||||
void onReplyReceiveAbortTransaction(uint32_t, uint32_t, void *) {};
|
||||
void onReplyReceiveGetCharacterList(uint32_t, uint32_t, void *) {};
|
||||
|
||||
// house keeping
|
||||
void onIdentifyHost(unsigned int, unsigned int, void *) {};
|
||||
void onIdentifyHost(uint32_t, uint32_t, 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(uint32_t, int64, uint32_t, uint32_t, int64, const char *) {};
|
||||
void onReceiveCommitTransaction(uint32_t, int64) {};
|
||||
void onReceiveAbortTransaction(uint32_t, int64) {};
|
||||
void onReceiveGetCharacterList(uint32_t, uint32_t, const char *) {};
|
||||
|
||||
private:
|
||||
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ namespace NAMESPACE
|
||||
|
||||
//----------------------------------------
|
||||
GenericAPICore::GenericAPICore(const char *host,
|
||||
short port,
|
||||
int16_t port,
|
||||
unsigned reqTimeout,
|
||||
unsigned reconnectTimeout,
|
||||
unsigned noDataTimeoutSecs,
|
||||
@@ -51,7 +51,7 @@ namespace NAMESPACE
|
||||
|
||||
//----------------------------------------
|
||||
GenericAPICore::GenericAPICore(const char *game, const char *hosts[],
|
||||
const short port[],
|
||||
const int16_t port[],
|
||||
unsigned arraySize,
|
||||
unsigned reqTimeout,
|
||||
unsigned reconnectTimeout,
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ public:
|
||||
friend class GenericConnection;
|
||||
|
||||
GenericAPICore(const char *host,
|
||||
short port,
|
||||
int16_t port,
|
||||
unsigned reqTimeout,
|
||||
unsigned reconnectTimeout,
|
||||
unsigned noDataTimeoutSecs = 5,
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
* ALSO: cannot specify a 0 array size.
|
||||
*/
|
||||
GenericAPICore(const char *game, const char *hosts[],
|
||||
const short port[],
|
||||
const int16_t port[],
|
||||
unsigned arraySize,
|
||||
unsigned reqTimeout,
|
||||
unsigned reconnectTimeout,
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
virtual ~GenericAPICore();
|
||||
|
||||
void process();
|
||||
virtual void responseCallback(short type, Base::ByteStream::ReadIterator &iter, GenericConnection *con) = 0;
|
||||
virtual void responseCallback(int16_t type, Base::ByteStream::ReadIterator &iter, GenericConnection *con) = 0;
|
||||
virtual void responseCallback(GenericResponse *R) = 0;
|
||||
|
||||
virtual void OnDisconnect(GenericConnection *con) = 0;
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ namespace NAMESPACE
|
||||
using namespace std;
|
||||
using namespace Base;
|
||||
|
||||
GenericConnection::GenericConnection(const char *host, short port, GenericAPICore *apiCore, unsigned reconnectTimeout, unsigned noDataTimeoutSecs, unsigned, unsigned incomingBufSizeInKB, unsigned outgoingBufSizeInKB, unsigned keepAlive, unsigned maxRecvMessageSizeInKB)
|
||||
GenericConnection::GenericConnection(const char *host, int16_t port, GenericAPICore *apiCore, unsigned reconnectTimeout, unsigned noDataTimeoutSecs, unsigned, unsigned incomingBufSizeInKB, unsigned outgoingBufSizeInKB, unsigned keepAlive, unsigned maxRecvMessageSizeInKB)
|
||||
: m_bConnected(CON_NONE),
|
||||
m_apiCore(apiCore),
|
||||
m_con(nullptr),
|
||||
@@ -85,7 +85,7 @@ namespace NAMESPACE
|
||||
|
||||
void GenericConnection::OnRoutePacket(TcpConnection *, const unsigned char *data, int dataLen)
|
||||
{
|
||||
short type;
|
||||
int16_t type;
|
||||
unsigned track;
|
||||
|
||||
ByteStream msg(data, dataLen);
|
||||
@@ -151,7 +151,7 @@ namespace NAMESPACE
|
||||
// identifying us
|
||||
// m_apiCore->OnConnect(this);
|
||||
Base::ByteStream msg;
|
||||
put(msg, (short)REQUEST_SET_API);
|
||||
put(msg, (int16_t)REQUEST_SET_API);
|
||||
put(msg, (unsigned)0); // track
|
||||
put(msg, (unsigned)API_VERSION_CODE);
|
||||
put(msg, GAME_RESOURCE); // identify us as a game connection resource
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ class GenericConnection : public TcpConnectionHandler
|
||||
{
|
||||
public:
|
||||
GenericConnection(const char *host,
|
||||
short port,
|
||||
int16_t port,
|
||||
GenericAPICore *apiCore,
|
||||
unsigned reconnectTimeout,
|
||||
unsigned noDataTimeoutSecs = 5,
|
||||
@@ -62,7 +62,7 @@ class GenericConnection : public TcpConnectionHandler
|
||||
virtual void OnTerminated(TcpConnection *con);
|
||||
void Send(Base::ByteStream &msg);
|
||||
inline const char *getHost() const { return m_host.c_str(); }
|
||||
inline const short getPort() const { return m_port; }
|
||||
inline const int16_t getPort() const { return m_port; }
|
||||
|
||||
inline eConnectStatus isConnected() { return m_bConnected; }
|
||||
void disconnect();
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
TcpManager *m_manager;
|
||||
TcpConnection *m_con;
|
||||
std::string m_host;
|
||||
short m_port;
|
||||
int16_t m_port;
|
||||
eConState m_conState;
|
||||
time_t m_conTimeout;
|
||||
unsigned m_reconnectTimeout;
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@ namespace NAMESPACE
|
||||
using namespace Base;
|
||||
|
||||
//-------------------------------------------
|
||||
GenericRequest::GenericRequest(short type, unsigned server_track)
|
||||
GenericRequest::GenericRequest(int16_t type, unsigned server_track)
|
||||
: m_type(type), m_server_track(server_track), m_track(0), m_timeout(0)
|
||||
//-------------------------------------------
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------
|
||||
GenericResponse::GenericResponse(short type, unsigned result, void *user)
|
||||
GenericResponse::GenericResponse(int16_t type, unsigned result, void *user)
|
||||
: m_type(type), m_result(result), m_user(user), m_track(0), m_timeout(0)
|
||||
//-------------------------------------------
|
||||
{
|
||||
|
||||
+6
-6
@@ -22,11 +22,11 @@ class GenericRequest
|
||||
//-------------------------------------------
|
||||
{
|
||||
public:
|
||||
GenericRequest(short type, unsigned server_track = 0);
|
||||
GenericRequest(int16_t type, unsigned server_track = 0);
|
||||
virtual ~GenericRequest() {};
|
||||
|
||||
virtual void pack(Base::ByteStream &msg) = 0;
|
||||
short getType() const { return m_type; }
|
||||
int16_t getType() const { return m_type; }
|
||||
void setTimeout(time_t t) { m_timeout = t; }
|
||||
time_t getTimeout() { return m_timeout; }
|
||||
void setTrack(unsigned t) { m_track = t; }
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
inline void setServerTrack(unsigned track) { m_server_track = track; }
|
||||
|
||||
protected:
|
||||
short m_type;
|
||||
int16_t m_type;
|
||||
unsigned m_track;
|
||||
time_t m_timeout;
|
||||
unsigned m_server_track;
|
||||
@@ -49,11 +49,11 @@ class GenericResponse
|
||||
//-------------------------------------------
|
||||
{
|
||||
public:
|
||||
GenericResponse(short type, unsigned result, void *user);
|
||||
GenericResponse(int16_t type, unsigned result, void *user);
|
||||
virtual ~GenericResponse() {};
|
||||
virtual void unpack(Base::ByteStream::ReadIterator &iter);
|
||||
|
||||
short getType() const { return m_type; }
|
||||
int16_t getType() const { return m_type; }
|
||||
void setTimeout(time_t t) { m_timeout = t; }
|
||||
time_t getTimeout() { return m_timeout; }
|
||||
void setTrack(unsigned t) { m_track = t; }
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
void setResult(unsigned res) { m_result = res; }
|
||||
void * getUser() const { return m_user; }
|
||||
protected:
|
||||
short m_type;
|
||||
int16_t m_type;
|
||||
unsigned m_track;
|
||||
unsigned m_result;
|
||||
void *m_user;
|
||||
|
||||
+4
-4
@@ -12,7 +12,7 @@ namespace AuctionTransfer
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
AuctionTransferAPI::AuctionTransferAPI(const char *hostName[], const short port[], int count, const char *identifier[], unsigned identifierCount, unsigned reqTimeout, unsigned maxRecvMessageSizeInKB)
|
||||
AuctionTransferAPI::AuctionTransferAPI(const char *hostName[], const int16_t port[], int count, const char *identifier[], unsigned identifierCount, unsigned reqTimeout, unsigned maxRecvMessageSizeInKB)
|
||||
{
|
||||
m_apiCore = new AuctionTransferAPICore(hostName, port, count, this, identifier, identifierCount, reqTimeout, maxRecvMessageSizeInKB);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ AuctionTransferAPI::AuctionTransferAPI(const char *hostNames, const char *identi
|
||||
{
|
||||
std::vector<const char *> hostArray;
|
||||
std::vector<const char *> identifierArray;
|
||||
std::vector<short> portArray;
|
||||
std::vector<int16_t> portArray;
|
||||
char hostConfig[4096];
|
||||
char identifierConfig[4096];
|
||||
if (hostNames == nullptr)
|
||||
@@ -39,11 +39,11 @@ AuctionTransferAPI::AuctionTransferAPI(const char *hostNames, const char *identi
|
||||
{
|
||||
char * host = ptr;
|
||||
char * portStr = strchr(host, ':');
|
||||
unsigned short port = DEFAULT_PORT;
|
||||
uint16_t port = DEFAULT_PORT;
|
||||
if (portStr)
|
||||
{
|
||||
*portStr++ = 0;
|
||||
port = (short)atoi(portStr);
|
||||
port = (int16_t)atoi(portStr);
|
||||
}
|
||||
|
||||
if (::strlen(host) && port)
|
||||
|
||||
+3
-3
@@ -18,7 +18,7 @@ class AuctionTransferAPI
|
||||
{
|
||||
public:
|
||||
// constructor & destructor
|
||||
AuctionTransferAPI(const char *hostName[], const short port[], int count, const char *identifier[], unsigned identifierCount, unsigned reqTimeout = 60, unsigned maxRecvMessageSizeInKB = 16000);
|
||||
AuctionTransferAPI(const char *hostName[], const int16_t port[], int count, const char *identifier[], unsigned identifierCount, unsigned reqTimeout = 60, unsigned maxRecvMessageSizeInKB = 16000);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// the identifier list does not have one entry for each connection, it is a simple list of world names that
|
||||
// are handled by this API connection, no matter how many servers are connected to. In the case of EQ2 this
|
||||
@@ -32,8 +32,8 @@ public:
|
||||
virtual ~AuctionTransferAPI();
|
||||
|
||||
// connect and disconnect call backs
|
||||
virtual void onConnect(const char* hostname, unsigned short port, const short current, const short max) = 0;
|
||||
virtual void onDisconnect(const char *host, const short port, const short current, const short max) = 0;
|
||||
virtual void onConnect(const char* hostname, uint16_t port, const int16_t current, const int16_t max) = 0;
|
||||
virtual void onDisconnect(const char *host, const int16_t port, const int16_t current, const int16_t max) = 0;
|
||||
|
||||
|
||||
//processing
|
||||
|
||||
+5
-5
@@ -7,7 +7,7 @@ namespace AuctionTransfer
|
||||
{
|
||||
|
||||
/*/////////////////////////////////////////////////////////////////////////////////////
|
||||
AuctionTransferAPICore::AuctionTransferAPICore(const char *hostName[], const short port[], int count, AuctionTransferAPI *api, const char *identifier[], unsigned identifierCount)
|
||||
AuctionTransferAPICore::AuctionTransferAPICore(const char *hostName[], const int16_t port[], int count, AuctionTransferAPI *api, const char *identifier[], unsigned identifierCount)
|
||||
: GenericAPICore(identifier[0], hostName, port, count, 45, 5, 0, 90, 32, 32),
|
||||
m_api(api),
|
||||
m_mappedServerTrack(1000)
|
||||
@@ -18,7 +18,7 @@ AuctionTransferAPICore::AuctionTransferAPICore(const char *hostName[], const sho
|
||||
}
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
AuctionTransferAPICore::AuctionTransferAPICore(const char *hostName[], const short port[], int count, AuctionTransferAPI *api, const char *identifier[], unsigned identifierCount, unsigned reqTimeout, unsigned maxRecvMessageSizeInKB)
|
||||
AuctionTransferAPICore::AuctionTransferAPICore(const char *hostName[], const int16_t port[], int count, AuctionTransferAPI *api, const char *identifier[], unsigned identifierCount, unsigned reqTimeout, unsigned maxRecvMessageSizeInKB)
|
||||
: GenericAPICore(identifier[0], hostName, port, count, reqTimeout, 5, 0, 90, 32, 32, 1, maxRecvMessageSizeInKB),
|
||||
m_api(api),
|
||||
m_mappedServerTrack(1000)
|
||||
@@ -39,7 +39,7 @@ void AuctionTransferAPICore::OnConnect(GenericConnection *connection)
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
countOpenConnections();
|
||||
m_api->onConnect(connection->getHost(), connection->getPort(), (short)m_currentConnections, (short)m_maxConnections);
|
||||
m_api->onConnect(connection->getHost(), connection->getPort(), (int16_t)m_currentConnections, (int16_t)m_maxConnections);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -47,7 +47,7 @@ void AuctionTransferAPICore::OnDisconnect(GenericConnection *connection)
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
countOpenConnections();
|
||||
m_api->onDisconnect(connection->getHost(), connection->getPort(), (short)m_currentConnections, (short)m_maxConnections);
|
||||
m_api->onDisconnect(connection->getHost(), connection->getPort(), (int16_t)m_currentConnections, (int16_t)m_maxConnections);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -123,7 +123,7 @@ void AuctionTransferAPICore::responseCallback(GenericResponse *response)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void AuctionTransferAPICore::responseCallback(short type, Base::ByteStream::ReadIterator &iter, GenericConnection *connection)
|
||||
void AuctionTransferAPICore::responseCallback(int16_t type, Base::ByteStream::ReadIterator &iter, GenericConnection *connection)
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
// these are the callbacks that are initiated from the Auction System. These callbacks
|
||||
// will be called to initiate a series of communication between the auction system and
|
||||
|
||||
+2
-2
@@ -15,13 +15,13 @@ class AuctionTransferAPI;
|
||||
class AuctionTransferAPICore : public GenericAPICore
|
||||
{
|
||||
public:
|
||||
AuctionTransferAPICore(const char *hostName[], const short port[], int count, AuctionTransferAPI *api, const char *identifier[], unsigned identifierCount, unsigned timeout = 60, unsigned maxRecvMessageSizeInKB = 16000);
|
||||
AuctionTransferAPICore(const char *hostName[], const int16_t port[], int count, AuctionTransferAPI *api, const char *identifier[], unsigned identifierCount, unsigned timeout = 60, unsigned maxRecvMessageSizeInKB = 16000);
|
||||
virtual ~AuctionTransferAPICore();
|
||||
|
||||
void OnConnect(GenericConnection *connection);
|
||||
void OnDisconnect(GenericConnection *connection);
|
||||
void responseCallback(GenericResponse *response);
|
||||
void responseCallback(short type, Base::ByteStream::ReadIterator &iter, GenericConnection *connection);
|
||||
void responseCallback(int16_t type, Base::ByteStream::ReadIterator &iter, GenericConnection *connection);
|
||||
|
||||
private:
|
||||
AuctionTransferAPI *m_api;
|
||||
|
||||
BIN
Binary file not shown.
+11
-178
@@ -323,71 +323,19 @@ const unsigned MAX_ARRAY_SIZE = 1024;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, ByteStream & target)
|
||||
{
|
||||
target.put(source.getBuffer(), source.getSize());
|
||||
source.advance(source.getSize());
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, double & target)
|
||||
template <typename T>
|
||||
inline void get(ByteStream::ReadIterator & source, T & target)
|
||||
{
|
||||
source.get(&target, 8);
|
||||
source.get(&target, sizeof(T));
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, float & target)
|
||||
{
|
||||
source.get(&target, 4);
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, uint64 & target)
|
||||
{
|
||||
source.get(&target, 8);
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, int64 & target)
|
||||
{
|
||||
source.get(&target, 8);
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, uint32 & target)
|
||||
{
|
||||
source.get(&target, 4);
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, int32 & target)
|
||||
{
|
||||
source.get(&target, 4);
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, uint16 & target)
|
||||
{
|
||||
source.get(&target, 2);
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, int16 & target)
|
||||
{
|
||||
source.get(&target, 2);
|
||||
target = byteSwap(target);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, uint8 & target)
|
||||
{
|
||||
source.get(&target, 1);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, int8 & target)
|
||||
{
|
||||
source.get(&target, 1);
|
||||
}
|
||||
|
||||
inline void get(ByteStream::ReadIterator & source, unsigned char * const target, const unsigned int targetSize)
|
||||
{
|
||||
source.get(target, targetSize);
|
||||
@@ -398,7 +346,6 @@ const unsigned MAX_ARRAY_SIZE = 1024;
|
||||
source.get(&target, 1);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -408,70 +355,13 @@ const unsigned MAX_ARRAY_SIZE = 1024;
|
||||
source.advance(source.getSize());
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const double value)
|
||||
template <typename T>
|
||||
inline void put(ByteStream & target, const T value)
|
||||
{
|
||||
double temp = byteSwap(value);
|
||||
target.put(&temp, 8);
|
||||
T temp = byteSwap(value);
|
||||
target.put(&temp, sizeof(T));
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const float value)
|
||||
{
|
||||
float temp = byteSwap(value);
|
||||
target.put(&temp, 4);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const uint64 value)
|
||||
{
|
||||
uint64 temp = byteSwap(value);
|
||||
target.put(&temp, 8);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const int64 value)
|
||||
{
|
||||
int64 temp = byteSwap(value);
|
||||
target.put(&temp, 8);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const uint32 value)
|
||||
{
|
||||
uint32 temp = byteSwap(value);
|
||||
target.put(&temp, 4);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const int32 value)
|
||||
{
|
||||
int32 temp = byteSwap(value);
|
||||
target.put(&temp, 4);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const uint16 value)
|
||||
{
|
||||
uint16 temp = byteSwap(value);
|
||||
target.put(&temp, 2);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const int16 value)
|
||||
{
|
||||
int16 temp = byteSwap(value);
|
||||
target.put(&temp, 2);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const uint8 value)
|
||||
{
|
||||
target.put(&value, 1);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const int8 value)
|
||||
{
|
||||
target.put(&value, 1);
|
||||
}
|
||||
|
||||
inline void put(ByteStream & target, const bool & source)
|
||||
{
|
||||
target.put(&source, 1);
|
||||
}
|
||||
|
||||
|
||||
inline void put(ByteStream & target, const unsigned char * const source, const unsigned int sourceSize)
|
||||
{
|
||||
target.put(source, sourceSize);
|
||||
@@ -488,68 +378,11 @@ const unsigned MAX_ARRAY_SIZE = 1024;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const double value)
|
||||
template <typename T>
|
||||
inline bool overwriteEnd(ByteStream & target, const T value)
|
||||
{
|
||||
double temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 8);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const float value)
|
||||
{
|
||||
float temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 4);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const uint64 value)
|
||||
{
|
||||
uint64 temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 8);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const int64 value)
|
||||
{
|
||||
int64 temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 8);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const uint32 value)
|
||||
{
|
||||
uint32 temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 4);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const int32 value)
|
||||
{
|
||||
int32 temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 4);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const uint16 value)
|
||||
{
|
||||
uint16 temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 2);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const int16 value)
|
||||
{
|
||||
int16 temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, 2);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const uint8 value)
|
||||
{
|
||||
return target.overwriteEnd(&value, 1);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const int8 value)
|
||||
{
|
||||
return target.overwriteEnd(&value, 1);
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const bool & source)
|
||||
{
|
||||
return target.overwriteEnd(&source, 1);
|
||||
T temp = byteSwap(value);
|
||||
return target.overwriteEnd(&temp, sizeof(T));
|
||||
}
|
||||
|
||||
inline bool overwriteEnd(ByteStream & target, const unsigned char * const source, const unsigned int sourceSize)
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ namespace Base
|
||||
// return (uint64(byteReverse(uint32(value))) << 32) | byteReverse(uint32(value>>32));
|
||||
}
|
||||
|
||||
inline uint32 strlen(const unsigned short * string)
|
||||
inline uint32 strlen(const uint16_t * string)
|
||||
{
|
||||
if (string == 0)
|
||||
return 0;
|
||||
|
||||
+2
-10
@@ -23,16 +23,8 @@ namespace Base
|
||||
inline int16 byteSwap(int16 value) { byteReverse(&value); return value; }
|
||||
|
||||
#else
|
||||
|
||||
inline double byteSwap(double value) { return value; }
|
||||
inline float byteSwap(float value) { return value; }
|
||||
inline uint64 byteSwap(uint64 value) { return value; }
|
||||
inline int64 byteSwap(int64 value) { return value; }
|
||||
inline uint32 byteSwap(uint32 value) { return value; }
|
||||
inline int32 byteSwap(int32 value) { return value; }
|
||||
inline uint16 byteSwap(uint16 value) { return value; }
|
||||
inline int16 byteSwap(int16 value) { return value; }
|
||||
|
||||
template <typename T>
|
||||
inline T byteSwap(T value) { return value; }
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
+9
-7
@@ -11,7 +11,7 @@
|
||||
#ifndef BASE_LINUX_TYPES_H
|
||||
#define BASE_LINUX_TYPES_H
|
||||
|
||||
#include <sys/bitypes.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
namespace NAMESPACE
|
||||
@@ -28,15 +28,17 @@ namespace Base
|
||||
#define UINT32_MAX 0xFFFFFFFF
|
||||
#endif
|
||||
|
||||
typedef signed char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef signed short int16;
|
||||
typedef unsigned short uint16;
|
||||
|
||||
|
||||
typedef int8_t int8;
|
||||
typedef uint8_t uint8;
|
||||
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
|
||||
};
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@ namespace Base
|
||||
|
||||
typedef signed char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int16_t int16;
|
||||
typedef uint16_t uint16;
|
||||
|
||||
typedef int int32;
|
||||
typedef unsigned uint32;
|
||||
|
||||
+8
-8
@@ -63,7 +63,7 @@ void put(Base::ByteStream &msg, const Blob &source);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
ReplyRequest::ReplyRequest( RequestTypes type, unsigned serverTrack, unsigned responseCode )
|
||||
: GenericRequest((short)type, serverTrack), m_responseCode(responseCode)
|
||||
: GenericRequest((int16_t)type, serverTrack), m_responseCode(responseCode)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void ReplyRequest::pack(Base::ByteStream &msg)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CommonRequest::CommonRequest( RequestTypes type, unsigned serverTrack, long long transactionID )
|
||||
: GenericRequest((short)type, serverTrack), m_transactionID(transactionID)
|
||||
: GenericRequest((int16_t)type, serverTrack), m_transactionID(transactionID)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ void CommonRequest::pack(Base::ByteStream &msg)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
GetIDRequest::GetIDRequest( RequestTypes type, unsigned serverTrack )
|
||||
: GenericRequest((short)type, serverTrack)
|
||||
: GenericRequest((int16_t)type, serverTrack)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -102,7 +102,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)
|
||||
: GenericRequest((short)type, serverTrack),
|
||||
: GenericRequest((int16_t)type, serverTrack),
|
||||
m_transactionID(transactionID),
|
||||
m_stationID(stationID),
|
||||
m_characterID(characterID),
|
||||
@@ -126,7 +126,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 )
|
||||
: GenericRequest((short)type, serverTrack),
|
||||
: GenericRequest((int16_t)type, serverTrack),
|
||||
m_transactionID(transactionID),
|
||||
m_stationID(stationID),
|
||||
m_characterID(characterID),
|
||||
@@ -150,7 +150,7 @@ void SendPrepareRequest::pack(Base::ByteStream &msg)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
ReplyGetCharacterListRequest::ReplyGetCharacterListRequest(RequestTypes type, unsigned serverTrack, unsigned responseCode, const Character characters[], unsigned numCharacters)
|
||||
: GenericRequest((short)type, serverTrack), m_responseCode(responseCode)
|
||||
: GenericRequest((int16_t)type, serverTrack), m_responseCode(responseCode)
|
||||
{
|
||||
for(unsigned i = 0; i < numCharacters; i++)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ void ReplyGetCharacterListRequest::pack(Base::ByteStream &msg)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
IdentifyServerRequest::IdentifyServerRequest(RequestTypes type, unsigned serverTrack, const char *serverID[], unsigned numIDs)
|
||||
: GenericRequest((short)type, serverTrack)
|
||||
: GenericRequest((int16_t)type, serverTrack)
|
||||
{
|
||||
for(unsigned i = 0; i < numIDs; i++)
|
||||
{
|
||||
@@ -195,7 +195,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)
|
||||
: GenericRequest((short)type, serverTrack), m_gameCode(gameCode), m_serverCode(serverCode), m_assetID(inGameAssetID),
|
||||
: GenericRequest((int16_t)type, serverTrack), m_gameCode(gameCode), m_serverCode(serverCode), m_assetID(inGameAssetID),
|
||||
m_userID(stationID), m_event(event), m_message(message)
|
||||
{
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
namespace AuctionTransfer
|
||||
{
|
||||
GetIDResponse::GetIDResponse(RequestTypes type, void *user)
|
||||
: GenericResponse( (short)type, TRANSFER_SERVER_TIME_OUT, user), m_transactionID(-1)
|
||||
: GenericResponse( (int16_t)type, TRANSFER_SERVER_TIME_OUT, user), m_transactionID(-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace AuctionTransfer
|
||||
class CommonResponse : public GenericResponse
|
||||
{
|
||||
public:
|
||||
CommonResponse(RequestTypes type, void *user) : GenericResponse((short)type, TRANSFER_SERVER_TIME_OUT, user) {}
|
||||
CommonResponse(RequestTypes type, void *user) : GenericResponse((int16_t)type, TRANSFER_SERVER_TIME_OUT, user) {}
|
||||
virtual ~CommonResponse() {}
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ namespace NAMESPACE
|
||||
|
||||
|
||||
//used when want to open new connection with this socket
|
||||
TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, const IPAddress &destIP, short destPort, unsigned timeout)
|
||||
TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, const IPAddress &destIP, int16_t destPort, unsigned timeout)
|
||||
: m_nextConnection(nullptr),
|
||||
m_prevConnection(nullptr),
|
||||
m_socket(INVALID_SOCKET),
|
||||
@@ -93,7 +93,7 @@ TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAllo
|
||||
}
|
||||
|
||||
//used when server mode creates new connection object representing a connect request
|
||||
TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, SOCKET socket, const IPAddress &destIP, short destPort)
|
||||
TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, SOCKET socket, const IPAddress &destIP, int16_t destPort)
|
||||
: m_nextConnection(nullptr),
|
||||
m_prevConnection(nullptr),
|
||||
m_socket(socket),
|
||||
|
||||
+4
-4
@@ -88,7 +88,7 @@ public:
|
||||
/**
|
||||
* @brief Returns the port on the other side of this conection.
|
||||
*/
|
||||
short GetDestinationPort(){ return m_destPort; }
|
||||
int16_t GetDestinationPort(){ return m_destPort; }
|
||||
|
||||
/**
|
||||
* @brief Standard AddRef/Release scheme
|
||||
@@ -105,9 +105,9 @@ public:
|
||||
|
||||
protected:
|
||||
friend class TcpManager;
|
||||
TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, const IPAddress &destIP, short destPort, unsigned timeout);
|
||||
TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, const IPAddress &destIP, int16_t destPort, unsigned timeout);
|
||||
int finishConnect();/**< returns < 0 if fatal error and connect will not work, =0 if need more time, >0 if connect completed */
|
||||
TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, SOCKET socket, const IPAddress &destIP, short destPort);
|
||||
TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, SOCKET socket, const IPAddress &destIP, int16_t destPort);
|
||||
TcpConnection *m_nextConnection; /**< Double linked list imp. */
|
||||
TcpConnection *m_prevConnection; /**< Double linked list imp. */
|
||||
SOCKET m_socket;
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
Status m_status;
|
||||
TcpConnectionHandler *m_handler;
|
||||
IPAddress m_destIP;
|
||||
short m_destPort;
|
||||
int16_t m_destPort;
|
||||
unsigned m_refCount;
|
||||
TcpBlockAllocator *m_sendAllocator;
|
||||
data_block *m_head;
|
||||
|
||||
+1
-1
@@ -571,7 +571,7 @@ namespace NAMESPACE
|
||||
return processedIncoming;
|
||||
}
|
||||
|
||||
TcpConnection *TcpManager::EstablishConnection(const char *serverAddress, unsigned short serverPort, unsigned timeout)
|
||||
TcpConnection *TcpManager::EstablishConnection(const char *serverAddress, uint16_t serverPort, unsigned timeout)
|
||||
{
|
||||
if (m_boundAsServer)
|
||||
{
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ public:
|
||||
* do so in order to navigate company firewalls which may have specific port numbers open to them for this purpose.
|
||||
* default = 0
|
||||
*/
|
||||
unsigned short port;
|
||||
uint16_t port;
|
||||
|
||||
/**
|
||||
* @ brief Server bind ip.
|
||||
@@ -214,7 +214,7 @@ public:
|
||||
* nullptr if the manager object has exceeded its maximum number of connections
|
||||
* or if the serverAddress cannot be resolved to an IP address.
|
||||
*/
|
||||
TcpConnection *EstablishConnection(const char *serverAddress, unsigned short serverPort, unsigned timeout = 0);
|
||||
TcpConnection *EstablishConnection(const char *serverAddress, uint16_t serverPort, unsigned timeout = 0);
|
||||
|
||||
/**
|
||||
* @brief Binds this manager as a server which will listen for and accept incoming connections.
|
||||
|
||||
+4
-4
@@ -395,7 +395,7 @@ int ZEXPORT deflateParams(strm, level, strategy)
|
||||
}
|
||||
|
||||
/* =========================================================================
|
||||
* Put a short in the pending buffer. The 16-bit value is put in MSB order.
|
||||
* Put a int16_t in the pending buffer. The 16-bit value is put in MSB order.
|
||||
* IN assertion: the stream state is correct and there is enough room in
|
||||
* pending_buf.
|
||||
*/
|
||||
@@ -711,7 +711,7 @@ local void lm_init (s)
|
||||
|
||||
/* ===========================================================================
|
||||
* Set match_start to the longest match starting at the given string and
|
||||
* return its length. Matches shorter or equal to prev_length are discarded,
|
||||
* return its length. Matches int16_ter or equal to prev_length are discarded,
|
||||
* in which case the result is equal to prev_length and match_start is
|
||||
* garbage.
|
||||
* IN assertions: cur_match is the head of the hash chain for the current
|
||||
@@ -778,7 +778,7 @@ local uInt longest_match(s, cur_match)
|
||||
* or if the match length is less than 2:
|
||||
*/
|
||||
#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
|
||||
/* This code assumes sizeof(unsigned short) == 2. Do not use
|
||||
/* This code assumes sizeof(uint16_t) == 2. Do not use
|
||||
* UNALIGNED_OK if your compiler uses a different size.
|
||||
*/
|
||||
if (*(ushf*)(match+best_len-1) != scan_end ||
|
||||
@@ -1133,7 +1133,7 @@ local block_state deflate_stored(s, flush)
|
||||
* Compress as much as possible from the input stream, return the current
|
||||
* block state.
|
||||
* This function does not perform lazy evaluation of matches and inserts
|
||||
* new strings in the dictionary only for unmatched strings or for short
|
||||
* new strings in the dictionary only for unmatched strings or for int16_t
|
||||
* matches. It is used only for the fast compression options.
|
||||
*/
|
||||
local block_state deflate_fast(s, flush)
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ typedef ush Pos;
|
||||
typedef Pos FAR Posf;
|
||||
typedef unsigned IPos;
|
||||
|
||||
/* A Pos is an index in the character window. We use short instead of int to
|
||||
/* A Pos is an index in the character window. We use int16_t instead of int to
|
||||
* save space in the various tables. IPos is used only for parameter passing.
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ local const uInt border[] = { /* Order of the bit length code lengths */
|
||||
only if BitLength(i) is not zero. (Pretty obvious.)
|
||||
11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
|
||||
12. Note: length code 284 can represent 227-258, but length code 285
|
||||
really is 258. The last length deserves its own, short code
|
||||
really is 258. The last length deserves its own, int16_t code
|
||||
since it gets used a lot in very redundant files. The length
|
||||
258 is special since 258 - 3 (the min match length) is 255.
|
||||
13. The literal/length and distance code bit lengths are read as a
|
||||
|
||||
+7
-7
@@ -60,9 +60,9 @@ local const uInt cpdext[30] = { /* Extra bits for distance codes */
|
||||
size is determined by the longest code. However, the time it takes
|
||||
to build this table can also be a factor if the data being decoded
|
||||
is not very long. The most common codes are necessarily the
|
||||
shortest codes, so those codes dominate the decoding time, and hence
|
||||
the speed. The idea is you can have a shorter table that decodes the
|
||||
shorter, more probable codes, and then point to subsidiary tables for
|
||||
int16_test codes, so those codes dominate the decoding time, and hence
|
||||
the speed. The idea is you can have a int16_ter table that decodes the
|
||||
int16_ter, more probable codes, and then point to subsidiary tables for
|
||||
the longer codes. The time it costs to decode the longer codes is
|
||||
then traded against the time it takes to make longer tables.
|
||||
|
||||
@@ -71,9 +71,9 @@ local const uInt cpdext[30] = { /* Extra bits for distance codes */
|
||||
length codes can decode in one step, and dbits is the same thing for
|
||||
the distance codes. Subsequent tables are also less than or equal to
|
||||
those sizes. These values may be adjusted either when all of the
|
||||
codes are shorter than that, in which case the longest code length in
|
||||
bits is used, or when the shortest code is *longer* than the requested
|
||||
table size, in which case the length of the shortest code in bits is
|
||||
codes are int16_ter than that, in which case the longest code length in
|
||||
bits is used, or when the int16_test code is *longer* than the requested
|
||||
table size, in which case the length of the int16_test code in bits is
|
||||
used.
|
||||
|
||||
There are two different values for the two tables, since they code a
|
||||
@@ -198,7 +198,7 @@ uIntf *v; /* working area: values in order of bit length */
|
||||
q = (inflate_huft *)Z_NULL; /* ditto */
|
||||
z = 0; /* ditto */
|
||||
|
||||
/* go through the bit lengths (k already is bits in shortest code) */
|
||||
/* go through the bit lengths (k already is bits in int16_test code) */
|
||||
for (; k <= g; k++)
|
||||
{
|
||||
a = c[k];
|
||||
|
||||
+9
-9
@@ -7,7 +7,7 @@
|
||||
* ALGORITHM
|
||||
*
|
||||
* The "deflation" process uses several Huffman trees. The more
|
||||
* common source values are represented by shorter bit sequences.
|
||||
* common source values are represented by int16_ter bit sequences.
|
||||
*
|
||||
* Each code tree is stored in a compressed form which is itself
|
||||
* a Huffman encoding of the lengths of all the code strings (in
|
||||
@@ -174,10 +174,10 @@ local void gen_trees_header OF((void));
|
||||
#endif
|
||||
|
||||
/* ===========================================================================
|
||||
* Output a short LSB first on the stream.
|
||||
* Output a int16_t LSB first on the stream.
|
||||
* IN assertion: there is enough room in pendingBuf.
|
||||
*/
|
||||
#define put_short(s, w) { \
|
||||
#define put_int16_t(s, w) { \
|
||||
put_byte(s, (uch)((w) & 0xff)); \
|
||||
put_byte(s, (uch)((ush)(w) >> 8)); \
|
||||
}
|
||||
@@ -204,7 +204,7 @@ local void send_bits(s, value, length)
|
||||
*/
|
||||
if (s->bi_valid > (int)Buf_size - length) {
|
||||
s->bi_buf |= (value << s->bi_valid);
|
||||
put_short(s, s->bi_buf);
|
||||
put_int16_t(s, s->bi_buf);
|
||||
s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
|
||||
s->bi_valid += length - Buf_size;
|
||||
} else {
|
||||
@@ -219,7 +219,7 @@ local void send_bits(s, value, length)
|
||||
if (s->bi_valid > (int)Buf_size - len) {\
|
||||
int val = value;\
|
||||
s->bi_buf |= (val << s->bi_valid);\
|
||||
put_short(s, s->bi_buf);\
|
||||
put_int16_t(s, s->bi_buf);\
|
||||
s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
|
||||
s->bi_valid += len - Buf_size;\
|
||||
} else {\
|
||||
@@ -1157,7 +1157,7 @@ local void bi_flush(s)
|
||||
deflate_state *s;
|
||||
{
|
||||
if (s->bi_valid == 16) {
|
||||
put_short(s, s->bi_buf);
|
||||
put_int16_t(s, s->bi_buf);
|
||||
s->bi_buf = 0;
|
||||
s->bi_valid = 0;
|
||||
} else if (s->bi_valid >= 8) {
|
||||
@@ -1174,7 +1174,7 @@ local void bi_windup(s)
|
||||
deflate_state *s;
|
||||
{
|
||||
if (s->bi_valid > 8) {
|
||||
put_short(s, s->bi_buf);
|
||||
put_int16_t(s, s->bi_buf);
|
||||
} else if (s->bi_valid > 0) {
|
||||
put_byte(s, (Byte)s->bi_buf);
|
||||
}
|
||||
@@ -1199,8 +1199,8 @@ local void copy_block(s, buf, len, header)
|
||||
s->last_eob_len = 8; /* enough lookahead for inflate */
|
||||
|
||||
if (header) {
|
||||
put_short(s, (ush)len);
|
||||
put_short(s, (ush)~len);
|
||||
put_int16_t(s, (ush)len);
|
||||
put_int16_t(s, (ush)~len);
|
||||
#ifdef DEBUG
|
||||
s->bits_sent += 2*16;
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -454,7 +454,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
|
||||
The dictionary should consist of strings (byte sequences) that are likely
|
||||
to be encountered later in the data to be compressed, with the most commonly
|
||||
used strings preferably put towards the end of the dictionary. Using a
|
||||
dictionary is most useful when the data to be compressed is short and can be
|
||||
dictionary is most useful when the data to be compressed is int16_t and can be
|
||||
predicted with good accuracy; the data can then be compressed better than
|
||||
with the default empty dictionary.
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
|
||||
typedef unsigned char uch;
|
||||
typedef uch FAR uchf;
|
||||
typedef unsigned short ush;
|
||||
typedef uint16_t ush;
|
||||
typedef ush FAR ushf;
|
||||
typedef unsigned long ulg;
|
||||
|
||||
|
||||
@@ -2876,8 +2876,10 @@ void CentralServer::update()
|
||||
{
|
||||
if ( m_pAuctionTransferClient == nullptr )
|
||||
{
|
||||
// TODO: FIXME
|
||||
/*
|
||||
const char* hostName[1] = { ConfigCentralServer::getAuctionServer() };
|
||||
const short port[1] = { (short)ConfigCentralServer::getAuctionPort() };
|
||||
const uint16_t port[1] = { (uint16_t)ConfigCentralServer::getAuctionPort() };
|
||||
|
||||
std::string s_id = ConfigCentralServer::getAuctionIDPrefix();
|
||||
s_id += ConfigCentralServer::getClusterName();
|
||||
@@ -2886,6 +2888,7 @@ void CentralServer::update()
|
||||
identifier[ 0 ] = s_id.c_str();
|
||||
|
||||
m_pAuctionTransferClient = new AuctionTransferClient( hostName, port, 1, identifier, 1 );
|
||||
*/
|
||||
}
|
||||
m_pAuctionTransferClient->process();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ ChatServerConnection::~ChatServerConnection()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
const unsigned short ChatServerConnection::getGameServicePort() const
|
||||
const uint16_t ChatServerConnection::getGameServicePort() const
|
||||
{
|
||||
return gameServicePort;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ void ChatServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServerConnection::setGameServicePort(const unsigned short p)
|
||||
void ChatServerConnection::setGameServicePort(const uint16_t p)
|
||||
{
|
||||
gameServicePort = p;
|
||||
}
|
||||
|
||||
@@ -16,16 +16,16 @@ class ChatServerConnection : public ServerConnection
|
||||
public:
|
||||
explicit ChatServerConnection(UdpConnectionMT *, TcpClient *);
|
||||
~ChatServerConnection();
|
||||
const unsigned short getGameServicePort () const;
|
||||
const uint16_t getGameServicePort () const;
|
||||
void onConnectionClosed ();
|
||||
void onConnectionOpened ();
|
||||
void onReceive (const Archive::ByteStream & message);
|
||||
void setGameServicePort (const unsigned short gameServicePort);
|
||||
void setGameServicePort (const uint16_t gameServicePort);
|
||||
|
||||
private:
|
||||
ChatServerConnection & operator = (const ChatServerConnection & rhs);
|
||||
ChatServerConnection(const ChatServerConnection & source);
|
||||
unsigned short gameServicePort;
|
||||
uint16_t gameServicePort;
|
||||
|
||||
}; //lint !e1712 default constructor not defined
|
||||
|
||||
|
||||
@@ -76,18 +76,18 @@ public:
|
||||
int webUpdateIntervalSeconds;
|
||||
};
|
||||
|
||||
static const unsigned short getChatServicePort ();
|
||||
static const unsigned short getConnectionServicePort();
|
||||
static const uint16_t getChatServicePort ();
|
||||
static const uint16_t getConnectionServicePort();
|
||||
static const char * getConsoleServiceBindInterface();
|
||||
static const unsigned short getConsoleServicePort();
|
||||
static const unsigned short getCustomerServicePort ();
|
||||
static const uint16_t getConsoleServicePort();
|
||||
static const uint16_t getCustomerServicePort ();
|
||||
static const char * getClusterName ();
|
||||
static const unsigned short getGameServicePort ();
|
||||
static const uint16_t getGameServicePort ();
|
||||
static const char * getLoginServerAddress ();
|
||||
static const unsigned short getLoginServerPort ();
|
||||
static const uint16_t getLoginServerPort ();
|
||||
static const char * getStartPlanet ();
|
||||
static const unsigned short getTaskManagerPort ();
|
||||
static const unsigned short getPlanetServicePort ();
|
||||
static const uint16_t getTaskManagerPort ();
|
||||
static const uint16_t getPlanetServicePort ();
|
||||
static const unsigned int getPlanetServerRestartDelayTimeSeconds();
|
||||
static const unsigned int getConnectionServerRestartDelayTimeSeconds();
|
||||
static const unsigned int getChatServerRestartDelayTimeSeconds();
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
static const char * getGameServiceBindInterface ();
|
||||
static const char * getLoginServiceBindInterface ();
|
||||
static const char * getPlanetServiceBindInterface ();
|
||||
static const unsigned short getLoginServicePort ();
|
||||
static const uint16_t getLoginServicePort ();
|
||||
static void install ();
|
||||
static void remove ();
|
||||
static uint16 getFirstPlanetWatcherPort();
|
||||
@@ -115,13 +115,13 @@ public:
|
||||
static const int getCharacterCreationRateLimitSeconds();
|
||||
static const int getCharacterCtsCreationRateLimitSeconds();
|
||||
static const char * getTransferServerAddress();
|
||||
static unsigned short getTransferServerPort();
|
||||
static uint16_t getTransferServerPort();
|
||||
static const char * getStationPlayersCollectorAddress();
|
||||
static unsigned short getStationPlayersCollectorPort();
|
||||
static uint16_t getStationPlayersCollectorPort();
|
||||
static bool getAllowZeroConnectionServerPort();
|
||||
static int getClusterWideDataLockTimeout();
|
||||
static const char * getCommodityServerServiceBindInterface();
|
||||
static const unsigned short getCommodityServerServicePort();
|
||||
static const uint16_t getCommodityServerServicePort();
|
||||
|
||||
static int getNumberOfStartPlanets();
|
||||
static char const * getStartPlanet(int index);
|
||||
@@ -152,9 +152,9 @@ private:
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigCentralServer::getChatServicePort()
|
||||
inline const uint16_t ConfigCentralServer::getChatServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->chatServicePort);
|
||||
return static_cast<uint16_t>(data->chatServicePort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -166,16 +166,16 @@ inline bool ConfigCentralServer::getShouldSleep()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigCentralServer::getConnectionServicePort()
|
||||
inline const uint16_t ConfigCentralServer::getConnectionServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->connectionServicePort);
|
||||
return static_cast<uint16_t>(data->connectionServicePort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigCentralServer::getCustomerServicePort()
|
||||
inline const uint16_t ConfigCentralServer::getCustomerServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->customerServicePort);
|
||||
return static_cast<uint16_t>(data->customerServicePort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -314,9 +314,9 @@ inline uint16 ConfigCentralServer::getFirstPlanetWatcherPort()
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigCentralServer::getLoginServicePort()
|
||||
inline const uint16_t ConfigCentralServer::getLoginServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->loginServicePort);
|
||||
return static_cast<uint16_t>(data->loginServicePort);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -342,9 +342,9 @@ inline const char * ConfigCentralServer::getConsoleServiceBindInterface()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigCentralServer::getConsoleServicePort()
|
||||
inline const uint16_t ConfigCentralServer::getConsoleServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->consoleServicePort);
|
||||
return static_cast<uint16_t>(data->consoleServicePort);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -405,9 +405,9 @@ inline const char * ConfigCentralServer::getTransferServerAddress()
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
inline unsigned short ConfigCentralServer::getTransferServerPort()
|
||||
inline uint16_t ConfigCentralServer::getTransferServerPort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->transferServerPort);
|
||||
return static_cast<uint16_t>(data->transferServerPort);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -419,9 +419,9 @@ inline const char * ConfigCentralServer::getStationPlayersCollectorAddress()
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
inline unsigned short ConfigCentralServer::getStationPlayersCollectorPort()
|
||||
inline uint16_t ConfigCentralServer::getStationPlayersCollectorPort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->stationPlayersCollectorPort);
|
||||
return static_cast<uint16_t>(data->stationPlayersCollectorPort);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -447,9 +447,9 @@ inline const char * ConfigCentralServer::getCommodityServerServiceBindInterface(
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigCentralServer::getCommodityServerServicePort()
|
||||
inline const uint16_t ConfigCentralServer::getCommodityServerServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->commodityServerServicePort);
|
||||
return static_cast<uint16_t>(data->commodityServerServicePort);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -84,35 +84,35 @@ private:
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConnectionServerConnection::getChatServicePort() const
|
||||
inline const uint16_t ConnectionServerConnection::getChatServicePort() const
|
||||
{
|
||||
return m_chatServicePort;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConnectionServerConnection::getVoiceChatServicePort() const
|
||||
inline const uint16_t ConnectionServerConnection::getVoiceChatServicePort() const
|
||||
{
|
||||
return m_voiceChatServicePort;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConnectionServerConnection::getCustomerServicePort() const
|
||||
inline const uint16_t ConnectionServerConnection::getCustomerServicePort() const
|
||||
{
|
||||
return m_csServicePort;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConnectionServerConnection::getClientServicePortPrivate() const
|
||||
inline const uint16_t ConnectionServerConnection::getClientServicePortPrivate() const
|
||||
{
|
||||
return m_clientServicePortPrivate;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConnectionServerConnection::getClientServicePortPublic() const
|
||||
inline const uint16_t ConnectionServerConnection::getClientServicePortPublic() const
|
||||
{
|
||||
return m_clientServicePortPublic;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ inline int ConnectionServerConnection::getId() const
|
||||
}
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConnectionServerConnection::getGameServicePort() const
|
||||
inline const uint16_t ConnectionServerConnection::getGameServicePort() const
|
||||
{
|
||||
return m_gameServicePort;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ CustomerServiceConnection::~CustomerServiceConnection()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
const unsigned short CustomerServiceConnection::getGameServicePort() const
|
||||
const uint16_t CustomerServiceConnection::getGameServicePort() const
|
||||
{
|
||||
return gameServicePort;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ void CustomerServiceConnection::onReceive(const Archive::ByteStream & message)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void CustomerServiceConnection::setGameServicePort(const unsigned short p)
|
||||
void CustomerServiceConnection::setGameServicePort(const uint16_t p)
|
||||
{
|
||||
gameServicePort = p;
|
||||
}
|
||||
|
||||
@@ -16,16 +16,16 @@ class CustomerServiceConnection : public ServerConnection
|
||||
public:
|
||||
CustomerServiceConnection(UdpConnectionMT *, TcpClient *);
|
||||
~CustomerServiceConnection();
|
||||
const unsigned short getGameServicePort () const;
|
||||
const uint16_t getGameServicePort () const;
|
||||
void onConnectionClosed ();
|
||||
void onConnectionOpened ();
|
||||
void onReceive (const Archive::ByteStream & message);
|
||||
void setGameServicePort (const unsigned short gameServicePort);
|
||||
void setGameServicePort (const uint16_t gameServicePort);
|
||||
|
||||
private:
|
||||
CustomerServiceConnection & operator = (const CustomerServiceConnection & rhs);
|
||||
CustomerServiceConnection(const CustomerServiceConnection & source);
|
||||
unsigned short gameServicePort;
|
||||
uint16_t gameServicePort;
|
||||
|
||||
}; //lint !e1712 default constructor not defined
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
LoginServerConnection::LoginServerConnection(const std::string & a, const unsigned short p) :
|
||||
LoginServerConnection::LoginServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void LoginServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
// see if we need to send to transfer or connection server.
|
||||
if(reply.getValue().getCSToolId() > 0)
|
||||
{
|
||||
// for CS admin login. send to DB. This just shortcuts what would normally
|
||||
// for CS admin login. send to DB. This just int16_tcuts what would normally
|
||||
// happen at the transfer server.
|
||||
GenericValueTypeMessage<TransferCharacterData> login("TransferGetLoginLocationData", reply.getValue());
|
||||
CentralServer::getInstance().sendToDBProcess(login, true);
|
||||
|
||||
@@ -16,7 +16,7 @@ class LoginServerCommandChannel;
|
||||
class LoginServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
LoginServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
LoginServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
LoginServerConnection(UdpConnectionMT *, TcpClient *);
|
||||
~LoginServerConnection();
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
StationPlayersCollectorConnection::StationPlayersCollectorConnection(const std::string & a, const unsigned short p) :
|
||||
StationPlayersCollectorConnection::StationPlayersCollectorConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
class StationPlayersCollectorConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
StationPlayersCollectorConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
StationPlayersCollectorConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
~StationPlayersCollectorConnection();
|
||||
|
||||
void onConnectionClosed();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TaskConnection::TaskConnection(const std::string & a, const unsigned short p) :
|
||||
TaskConnection::TaskConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData()),
|
||||
callback(new MessageDispatch::Callback),
|
||||
m_connected(false)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace MessageDispatch
|
||||
class TaskConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
TaskConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
TaskConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
TaskConnection(UdpConnectionMT * u, TcpClient *);
|
||||
~TaskConnection();
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TransferServerConnection::TransferServerConnection(const std::string & a, const unsigned short p) :
|
||||
TransferServerConnection::TransferServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class TransferServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
TransferServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
TransferServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
~TransferServerConnection();
|
||||
|
||||
void onConnectionClosed();
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
CentralServerConnection::CentralServerConnection(const std::string & a, const unsigned short p) :
|
||||
CentralServerConnection::CentralServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
ChatServer::fileLog(true, "CentralServerConnection", "Connection created...listening on (%s:%d)", a.c_str(), static_cast<int>(p));
|
||||
@@ -78,7 +78,7 @@ void CentralServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
}
|
||||
case constcrc("CustomerServiceServerChatServerServiceAddress") :
|
||||
{
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned short> > msg(ri);
|
||||
GenericValueTypeMessage<std::pair<std::string, uint16_t> > msg(ri);
|
||||
|
||||
ChatServer::instance().connectToCustomerServiceServer(msg.getValue().first, msg.getValue().second);
|
||||
break;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class CentralServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
CentralServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
CentralServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
~CentralServerConnection();
|
||||
|
||||
void onConnectionClosed ();
|
||||
|
||||
@@ -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;
|
||||
unsigned sequence = (uintptr_t)user;
|
||||
std::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(lowerRoomName);
|
||||
if (f != roomList.end() && room)
|
||||
{
|
||||
@@ -430,7 +430,7 @@ void ChatInterface::queryRoom(const NetworkId & id, ConnectionServerConnection *
|
||||
}
|
||||
|
||||
Unicode::String wideName = Unicode::narrowToWide(tmpName);
|
||||
unsigned track = RequestGetRoom(ChatUnicodeString(wideName.data(), wideName.size()), (void *)sequence);
|
||||
unsigned track = RequestGetRoom(ChatUnicodeString(wideName.data(), wideName.size()), (void *)(uintptr_t)sequence);
|
||||
ChatServer::instance().pendingRequests[track] = id;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
unsigned 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;
|
||||
unsigned 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;
|
||||
unsigned 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;
|
||||
unsigned 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;
|
||||
unsigned 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;
|
||||
unsigned sequence = (uintptr_t)user;
|
||||
UNREF(srcAvatar);
|
||||
ChatOnSendPersistentMessage chat(sequence, result);
|
||||
IGNORE_RETURN(ChatServer::sendResponseForTrackId(track, chat));
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace ChatServerNamespace
|
||||
bool s_loggingEnabled = false;
|
||||
|
||||
std::set<std::pair<std::string, ChatAvatarId> > s_pendingEntersByName;
|
||||
std::set<std::pair<NetworkId, std::pair<unsigned int, unsigned int> > > s_pendingEntersById;
|
||||
std::set<std::pair<NetworkId, std::pair<uint32_t, uint32_t> > > s_pendingEntersById;
|
||||
|
||||
Unicode::String getRoomAddress(const std::string & roomName)
|
||||
{
|
||||
@@ -202,10 +202,10 @@ void ChatServer::update()
|
||||
{
|
||||
PROFILER_BLOCK_DEFINE(profileBlockMainLoop, "main loop");
|
||||
PROFILER_BLOCK_ENTER(profileBlockMainLoop);
|
||||
static unsigned int lastTime = 0;
|
||||
unsigned int t1 = Clock::timeMs();
|
||||
static uint32_t lastTime = 0;
|
||||
uint32_t t1 = Clock::timeMs();
|
||||
NetworkHandler::update();
|
||||
unsigned int t2 = Clock::timeMs();
|
||||
uint32_t t2 = Clock::timeMs();
|
||||
|
||||
chatInterface->checkQueuedLogins();
|
||||
chatInterface->sendQueuedHeadersToClient();
|
||||
@@ -216,14 +216,14 @@ if ((t2 - t1) > (1000 * 5))
|
||||
}
|
||||
|
||||
NetworkHandler::dispatch();
|
||||
unsigned int t3 = Clock::timeMs();
|
||||
uint32_t t3 = Clock::timeMs();
|
||||
if ((t3 - t2) > (1000 * 5))
|
||||
{
|
||||
DEBUG_WARNING(true, ("\n\n\n\n\nNetworkHandler::dispatch() took %i ms\n\n\n\n\n", (t3 - t2)));
|
||||
}
|
||||
if (lastTime != 0)
|
||||
{
|
||||
unsigned int time = Clock::timeMs();
|
||||
uint32_t time = Clock::timeMs();
|
||||
if ((time - lastTime) > (1000))
|
||||
{
|
||||
//DEBUG_WARNING(true, ("\n\n\n\n\n\nLong Chat Frame (%i ms)\n\n\n\n", (time - lastTime)));
|
||||
@@ -304,7 +304,7 @@ m_voiceChatIdMap()
|
||||
|
||||
const std::string getGameCode = ConfigChatServer::getGameCode();
|
||||
const std::string getGatewayServerIP = ConfigChatServer::getGatewayServerIP();
|
||||
chatInterface = new ChatInterface(getGameCode, getGatewayServerIP, ConfigChatServer::getGatewayServerPort(), ConfigChatServer::getRegistrarHost(), static_cast<unsigned short>(ConfigChatServer::getRegistrarPort()));
|
||||
chatInterface = new ChatInterface(getGameCode, getGatewayServerIP, ConfigChatServer::getGatewayServerPort(), ConfigChatServer::getRegistrarHost(), static_cast<uint16_t>(ConfigChatServer::getRegistrarPort()));
|
||||
|
||||
|
||||
std::string vChatHost;
|
||||
@@ -593,10 +593,10 @@ void ChatServer::removeServices()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
ChatAvatarId ChatServer::getAvatarIdForTrackId(unsigned trackId)
|
||||
ChatAvatarId ChatServer::getAvatarIdForTrackId(uint32_t trackId)
|
||||
{
|
||||
ChatServer & server = instance();
|
||||
std::unordered_map<unsigned, NetworkId>::iterator f = server.pendingRequests.find(trackId);
|
||||
std::unordered_map<uint32_t, NetworkId>::iterator f = server.pendingRequests.find(trackId);
|
||||
if(f != server.pendingRequests.end())
|
||||
{
|
||||
const ChatAvatar *avatar = getAvatarByNetworkId((*f).second);
|
||||
@@ -669,11 +669,11 @@ const NetworkId & ChatServer::getNetworkIdByAvatarId(const ChatAvatarId & id)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
NetworkId ChatServer::sendResponseForTrackId(unsigned trackId, const GameNetworkMessage & response)
|
||||
NetworkId ChatServer::sendResponseForTrackId(uint32_t trackId, const GameNetworkMessage & response)
|
||||
{
|
||||
NetworkId id;
|
||||
ChatServer & server = instance();
|
||||
std::unordered_map<unsigned, NetworkId>::iterator f = server.pendingRequests.find(trackId);
|
||||
std::unordered_map<uint32_t, NetworkId>::iterator f = server.pendingRequests.find(trackId);
|
||||
if(f != server.pendingRequests.end())
|
||||
{
|
||||
id = (*f).second;
|
||||
@@ -690,10 +690,10 @@ NetworkId ChatServer::sendResponseForTrackId(unsigned trackId, const GameNetwork
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
GameServerConnection *ChatServer::getGameServerConnection(unsigned int sequence)
|
||||
GameServerConnection *ChatServer::getGameServerConnection(uint32_t sequence)
|
||||
{
|
||||
GameServerConnection * result = 0;
|
||||
std::unordered_map<unsigned int, GameServerConnection *>::iterator f = instance().gameServerConnectionMap.find(sequence);
|
||||
std::unordered_map<uint32_t, GameServerConnection *>::iterator f = instance().gameServerConnectionMap.find(sequence);
|
||||
if(f != instance().gameServerConnectionMap.end())
|
||||
{
|
||||
result = (*f).second;
|
||||
@@ -705,7 +705,7 @@ GameServerConnection *ChatServer::getGameServerConnection(unsigned int sequence)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::addGameServerConnection(unsigned int sequence, GameServerConnection *connection)
|
||||
void ChatServer::addGameServerConnection(uint32_t sequence, GameServerConnection *connection)
|
||||
{
|
||||
IGNORE_RETURN(instance().gameServerConnectionMap.insert(std::make_pair(sequence, connection)));
|
||||
s_chatServerMetricsData->setGameServerConnectionCount(instance().gameServerConnectionMap.size());
|
||||
@@ -715,8 +715,8 @@ void ChatServer::addGameServerConnection(unsigned int sequence, GameServerConnec
|
||||
|
||||
void ChatServer::clearGameServerConnection(const GameServerConnection *connection)
|
||||
{
|
||||
std::vector<unsigned int> removeKeyList;
|
||||
std::unordered_map<unsigned int, GameServerConnection *>::const_iterator i;
|
||||
std::vector<uint32_t> removeKeyList;
|
||||
std::unordered_map<uint32_t, GameServerConnection *>::const_iterator i;
|
||||
for(i = instance().gameServerConnectionMap.begin(); i != instance().gameServerConnectionMap.end(); ++i)
|
||||
{
|
||||
if ((*i).second == connection)
|
||||
@@ -725,7 +725,7 @@ void ChatServer::clearGameServerConnection(const GameServerConnection *connectio
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<unsigned int>::const_iterator j;
|
||||
std::vector<uint32_t>::const_iterator j;
|
||||
for (j = removeKeyList.begin(); j != removeKeyList.end(); ++j)
|
||||
{
|
||||
IGNORE_RETURN(instance().gameServerConnectionMap.erase((*j)));
|
||||
@@ -766,7 +766,7 @@ void canonicalizeAvatarId(const ChatAvatarId &id)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::addFriend(const NetworkId & id, const unsigned int sequence, const ChatAvatarId & friendId)
|
||||
void ChatServer::addFriend(const NetworkId & id, const uint32_t sequence, const ChatAvatarId & friendId)
|
||||
{
|
||||
UNREF(sequence);
|
||||
ChatServer::fileLog(false, "ChatServer", "addFriend() id(%s) sequence(%u) friendId(%s)", id.getValueString().c_str(), sequence, friendId.getFullName().c_str());
|
||||
@@ -781,7 +781,7 @@ void ChatServer::addFriend(const NetworkId & id, const unsigned int sequence, co
|
||||
canonicalizeAvatarId(friendId);
|
||||
splitChatAvatarId(friendId, friendName, friendAddress);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestAddFriend(from, ChatUnicodeString(friendName.data(), friendName.length()),
|
||||
uint32_t track = instance().chatInterface->RequestAddFriend(from, ChatUnicodeString(friendName.data(), friendName.length()),
|
||||
ChatUnicodeString(friendAddress.data(), friendAddress.length()),
|
||||
false, nullptr);
|
||||
instance().pendingRequests[track] = id;
|
||||
@@ -794,7 +794,7 @@ void ChatServer::addFriend(const NetworkId & id, const unsigned int sequence, co
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::removeFriend(const NetworkId & id, const unsigned int sequence, const ChatAvatarId & friendId)
|
||||
void ChatServer::removeFriend(const NetworkId & id, const uint32_t sequence, const ChatAvatarId & friendId)
|
||||
{
|
||||
UNREF(sequence);
|
||||
ChatServer::fileLog(false, "ChatServer", "removeFriend() id(%s) sequence(%u) friendId(%s)", id.getValueString().c_str(), sequence, friendId.getFullName().c_str());
|
||||
@@ -809,7 +809,7 @@ void ChatServer::removeFriend(const NetworkId & id, const unsigned int sequence,
|
||||
canonicalizeAvatarId(friendId);
|
||||
splitChatAvatarId(friendId, friendName, friendAddress);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestRemoveFriend(from, ChatUnicodeString(friendName.data(), friendName.length()),
|
||||
uint32_t track = instance().chatInterface->RequestRemoveFriend(from, ChatUnicodeString(friendName.data(), friendName.length()),
|
||||
ChatUnicodeString(friendAddress.data(), friendAddress.length()), nullptr);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
@@ -829,7 +829,7 @@ void ChatServer::getFriendsList(const ChatAvatarId &characterName)
|
||||
const ChatAvatar *avatar = getAvatarByNetworkId(id);
|
||||
if (avatar)
|
||||
{
|
||||
unsigned track = instance().chatInterface->RequestFriendStatus(avatar, nullptr);
|
||||
uint32_t track = instance().chatInterface->RequestFriendStatus(avatar, nullptr);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
else
|
||||
@@ -840,7 +840,7 @@ void ChatServer::getFriendsList(const ChatAvatarId &characterName)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::addIgnore(const NetworkId & id, const unsigned int sequence, const ChatAvatarId & ignoreId)
|
||||
void ChatServer::addIgnore(const NetworkId & id, const uint32_t sequence, const ChatAvatarId & ignoreId)
|
||||
{
|
||||
UNREF(sequence);
|
||||
ChatServer::fileLog(false, "ChatServer", "addIgnore() id(%s) sequence(%u) ignoreId(%s)", id.getValueString().c_str(), sequence, ignoreId.getFullName().c_str());
|
||||
@@ -855,7 +855,7 @@ void ChatServer::addIgnore(const NetworkId & id, const unsigned int sequence, co
|
||||
canonicalizeAvatarId(ignoreId);
|
||||
splitChatAvatarId(ignoreId, ignoreName, ignoreAddress);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestAddIgnore(from, ChatUnicodeString(ignoreName.data(), ignoreName.length()),
|
||||
uint32_t track = instance().chatInterface->RequestAddIgnore(from, ChatUnicodeString(ignoreName.data(), ignoreName.length()),
|
||||
ChatUnicodeString(ignoreAddress.data(), ignoreAddress.length()),
|
||||
nullptr);
|
||||
instance().pendingRequests[track] = id;
|
||||
@@ -868,7 +868,7 @@ void ChatServer::addIgnore(const NetworkId & id, const unsigned int sequence, co
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::removeIgnore(const NetworkId & id, const unsigned int sequence, const ChatAvatarId & ignoreId)
|
||||
void ChatServer::removeIgnore(const NetworkId & id, const uint32_t sequence, const ChatAvatarId & ignoreId)
|
||||
{
|
||||
UNREF(sequence);
|
||||
ChatServer::fileLog(false, "ChatServer", "removeIgnore() id(%s) sequence(%u) ignoreId(%s)", id.getValueString().c_str(), sequence, ignoreId.getFullName().c_str());
|
||||
@@ -883,7 +883,7 @@ void ChatServer::removeIgnore(const NetworkId & id, const unsigned int sequence,
|
||||
canonicalizeAvatarId(ignoreId);
|
||||
splitChatAvatarId(ignoreId, ignoreName, ignoreAddress);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestRemoveIgnore(from, ChatUnicodeString(ignoreName.data(), ignoreName.length()),
|
||||
uint32_t track = instance().chatInterface->RequestRemoveIgnore(from, ChatUnicodeString(ignoreName.data(), ignoreName.length()),
|
||||
ChatUnicodeString(ignoreAddress.data(), ignoreAddress.length()), nullptr);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
@@ -905,7 +905,7 @@ void ChatServer::getIgnoreList(const ChatAvatarId &characterName)
|
||||
|
||||
if (avatar)
|
||||
{
|
||||
unsigned track = instance().chatInterface->RequestIgnoreStatus(avatar, nullptr);
|
||||
uint32_t track = instance().chatInterface->RequestIgnoreStatus(avatar, nullptr);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
else
|
||||
@@ -917,7 +917,7 @@ void ChatServer::getIgnoreList(const ChatAvatarId &characterName)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::addModeratorToRoom(const unsigned int sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName)
|
||||
void ChatServer::addModeratorToRoom(const uint32_t sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName)
|
||||
{
|
||||
canonicalizeAvatarId(avatarId);
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "addModeratorToRoom() sequenceId(%u) id(%s) avatarId(%s) roomName(%s)", sequenceId, id.getValueString().c_str(), avatarId.getFullName().c_str(), roomName.c_str());
|
||||
@@ -925,7 +925,7 @@ void ChatServer::addModeratorToRoom(const unsigned int sequenceId, const Network
|
||||
const ChatAvatar * from = getAvatarByNetworkId(id);
|
||||
if(from)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
const ChatServerRoomOwner *roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (roomOwner)
|
||||
@@ -938,14 +938,14 @@ void ChatServer::addModeratorToRoom(const unsigned int sequenceId, const Network
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(sequenceId, avatarId);
|
||||
|
||||
instance().chatInterface->RequestRemoveBan(from, moderatorName, moderatorAddress, roomOwner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestRemoveBan(from, moderatorName, moderatorAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
|
||||
// Try to make the avatar a moderator
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(sequenceId, avatarId);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestAddModerator(from, moderatorName, moderatorAddress, roomOwner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestAddModerator(from, moderatorName, moderatorAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
}
|
||||
@@ -967,7 +967,7 @@ void ChatServer::addModeratorToRoom(const unsigned int sequenceId, const Network
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::removeModeratorFromRoom(const unsigned int sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName)
|
||||
void ChatServer::removeModeratorFromRoom(const uint32_t sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName)
|
||||
{
|
||||
canonicalizeAvatarId(avatarId);
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "removeModeratorFromRoom() sequenceId(%u) id(%s) avatarId(%s) roomName(%s)", sequenceId, id.getValueString().c_str(), avatarId.getFullName().c_str(), roomName.c_str());
|
||||
@@ -975,7 +975,7 @@ void ChatServer::removeModeratorFromRoom(const unsigned int sequenceId, const Ne
|
||||
const ChatAvatar * from = getAvatarByNetworkId(id);
|
||||
if(from)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
const ChatServerRoomOwner *roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (roomOwner)
|
||||
@@ -987,7 +987,7 @@ void ChatServer::removeModeratorFromRoom(const unsigned int sequenceId, const Ne
|
||||
// User data so that we remember who is being removed as a moderator
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(sequenceId, avatarId);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestRemoveModerator(from, moderatorName, moderatorAddress, roomOwner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestRemoveModerator(from, moderatorName, moderatorAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
else
|
||||
@@ -1027,7 +1027,7 @@ void ChatServer::chatConnectedAvatar(const NetworkId & id, const ChatAvatar & ne
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::connectPlayer(ConnectionServerConnection * connection, const unsigned int suid, const std::string & characterName, const NetworkId & networkId, bool isSecure, bool isSubscribed)
|
||||
void ChatServer::connectPlayer(ConnectionServerConnection * connection, const uint32_t suid, const std::string & characterName, const NetworkId & networkId, bool isSecure, bool isSubscribed)
|
||||
{
|
||||
ChatServer::fileLog(false, "ChatServer", "connectPlayer() address(%s) suid(%u) characterName(%s) networkId(%s)", getConnectionAddress(connection).c_str(), suid, characterName.c_str(), networkId.getValueString().c_str());
|
||||
|
||||
@@ -1071,7 +1071,7 @@ void ChatServer::connectPlayer(ConnectionServerConnection * connection, const un
|
||||
int countDots(const std::string &str)
|
||||
{
|
||||
int num = 0;
|
||||
for (unsigned i = 0; i < str.length(); ++i)
|
||||
for (uint32_t i = 0; i < str.length(); ++i)
|
||||
{
|
||||
if (str[i] == '.')
|
||||
{
|
||||
@@ -1083,7 +1083,7 @@ int countDots(const std::string &str)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::createRoom(const NetworkId & id, const unsigned int sequence, const std::string & roomName, const bool isModerated, const bool isPublic, const std::string & title)
|
||||
void ChatServer::createRoom(const NetworkId & id, const uint32_t sequence, const std::string & roomName, const bool isModerated, const bool isPublic, const std::string & title)
|
||||
{
|
||||
if(roomName.empty())
|
||||
return;
|
||||
@@ -1128,7 +1128,7 @@ void ChatServer::createRoom(const NetworkId & id, const unsigned int sequence, c
|
||||
|
||||
//printf("Creating room %s\n", roomName.c_str());
|
||||
|
||||
unsigned roomAttr = 0;
|
||||
uint32_t roomAttr = 0;
|
||||
|
||||
static Archive::ByteStream a;
|
||||
const ChatAvatar * owner = 0;
|
||||
@@ -1181,7 +1181,7 @@ void ChatServer::createRoom(const NetworkId & id, const unsigned int sequence, c
|
||||
//instance().voiceChatInterface->GetChannel(narrowRoomAddress,narrowRoomName,"text","",0,false,0);
|
||||
|
||||
|
||||
unsigned track = instance().chatInterface->RequestCreateRoom(owner, roomParams, ChatUnicodeString(wideRoomAddress.data(), wideRoomAddress.size()), (void *)sequence); //lint !e641 Converting enum 'ChatRoomType' to int
|
||||
uint32_t track = instance().chatInterface->RequestCreateRoom(owner, roomParams, ChatUnicodeString(wideRoomAddress.data(), wideRoomAddress.size()), (void *)(uintptr_t)sequence); //lint !e641 Converting enum 'ChatRoomType' to int
|
||||
if(id != NetworkId::cms_invalid)
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
@@ -1218,7 +1218,7 @@ void ChatServer::deleteAllPersistentMessages(const NetworkId &sourceNetworkId, c
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::deletePersistentMessage(const NetworkId &id, const unsigned int messageId)
|
||||
void ChatServer::deletePersistentMessage(const NetworkId &id, const uint32_t messageId)
|
||||
{
|
||||
ChatServer::fileLog(false, "ChatServer", "deletePersistentMessage() id(%s) messageId(%u)", id.getValueString().c_str(), messageId);
|
||||
|
||||
@@ -1239,7 +1239,7 @@ ChatInterface *ChatServer::getChatInterface()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::destroyRoom(const NetworkId & id, const unsigned int sequence, const unsigned int roomId)
|
||||
void ChatServer::destroyRoom(const NetworkId & id, const uint32_t sequence, const uint32_t roomId)
|
||||
{
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "destroyRoom() id(%s) sequence(%u) roomId(%u)", id.getValueString().c_str(), sequence, roomId);
|
||||
|
||||
@@ -1279,7 +1279,7 @@ void ChatServer::destroyRoom(const NetworkId & id, const unsigned int sequence,
|
||||
if (avatar && owner)
|
||||
{
|
||||
RoomOwnerSequencePair *pair = new RoomOwnerSequencePair(sequence, owner);
|
||||
unsigned track = instance().chatInterface->RequestDestroyRoom(avatar, owner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestDestroyRoom(avatar, owner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
}
|
||||
@@ -1319,7 +1319,7 @@ void ChatServer::destroyRoom(const std::string & roomName)
|
||||
RoomOwnerSequencePair *pair = new RoomOwnerSequencePair(0, owner);
|
||||
static Unicode::String wideAddr = Unicode::narrowToWide(std::string("SWG") + "+" + ConfigChatServer::getClusterName());
|
||||
static ChatUnicodeString chatAddr(wideAddr.data(), wideAddr.size());
|
||||
instance().chatInterface->RequestDestroyRoom(instance().ownerSystem, owner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestDestroyRoom(instance().ownerSystem, owner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1358,7 +1358,7 @@ void ChatServer::disconnectPlayer(const NetworkId & id)
|
||||
ChatAvatarId avatarId;
|
||||
makeAvatarId((*f).second.chatAvatar, avatarId);
|
||||
instance().chatInterface->disconnectPlayer(avatarId);
|
||||
instance().chatInterface->RequestLogoutAvatar(&((*f).second.chatAvatar), (void *)owner);
|
||||
instance().chatInterface->RequestLogoutAvatar(&((*f).second.chatAvatar), (void *)(uintptr_t)owner);
|
||||
instance().chatAvatars.erase(f);
|
||||
}
|
||||
|
||||
@@ -1393,7 +1393,7 @@ void ChatServer::disconnectPlayer(const NetworkId & id)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::enterRoom(const NetworkId & id, const unsigned int sequence, const unsigned int roomId)
|
||||
void ChatServer::enterRoom(const NetworkId & id, const uint32_t sequence, const uint32_t roomId)
|
||||
{
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "enterRoom() id(%s) sequence(%u) roomId(%u)", id.getValueString().c_str(), sequence, roomId);
|
||||
|
||||
@@ -1403,7 +1403,7 @@ void ChatServer::enterRoom(const NetworkId & id, const unsigned int sequence, co
|
||||
|
||||
if(avatar && room)
|
||||
{
|
||||
unsigned track = instance().chatInterface->RequestEnterRoom(avatar, room->getAddress(), (void *)sequence);
|
||||
uint32_t track = instance().chatInterface->RequestEnterRoom(avatar, room->getAddress(), (void *)(uintptr_t)sequence);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
else
|
||||
@@ -1456,7 +1456,7 @@ void ChatServer::putSystemAvatarInRoom(const std::string & roomName)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::enterRoom(const NetworkId & id, const unsigned int sequence, const std::string & roomName)
|
||||
void ChatServer::enterRoom(const NetworkId & id, const uint32_t sequence, const std::string & roomName)
|
||||
{
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "enterRoom() id(%s) sequence(%u) roomName(%s)", id.getValueString().c_str(), sequence, roomName.c_str());
|
||||
|
||||
@@ -1464,8 +1464,8 @@ void ChatServer::enterRoom(const NetworkId & id, const unsigned int sequence, co
|
||||
const ChatAvatar * avatar = getAvatarByNetworkId(id);
|
||||
if(avatar)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
unsigned roomId = 0;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t roomId = 0;
|
||||
|
||||
const ChatServerRoomOwner *roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (roomOwner)
|
||||
@@ -1483,7 +1483,7 @@ void ChatServer::enterRoom(const NetworkId & id, const unsigned int sequence, co
|
||||
const ChatServerRoomOwner *room = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (room)
|
||||
{
|
||||
unsigned track = instance().chatInterface->RequestEnterRoom(avatar, room->getAddress(), (void *)sequence);
|
||||
uint32_t track = instance().chatInterface->RequestEnterRoom(avatar, room->getAddress(), (void *)(uintptr_t)sequence);
|
||||
instance().pendingRequests[track] = id;
|
||||
|
||||
return;
|
||||
@@ -1511,7 +1511,7 @@ void ChatServer::enterRoom(const NetworkId & id, const unsigned int sequence, co
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::unbanFromRoom(const unsigned sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName)
|
||||
void ChatServer::unbanFromRoom(const uint32_t sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName)
|
||||
{
|
||||
canonicalizeAvatarId(bannee);
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "unbanFromRoom() sequence(%u) banner(%s) bannee(%s) roomName(%s)", sequence, banner.getValueString().c_str(), bannee.getFullName().c_str(), roomName.c_str());
|
||||
@@ -1519,7 +1519,7 @@ void ChatServer::unbanFromRoom(const unsigned sequence, const NetworkId &banner,
|
||||
const ChatAvatar *bannerAvatar = getAvatarByNetworkId(banner);
|
||||
if (bannerAvatar)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
const ChatServerRoomOwner *roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (roomOwner)
|
||||
@@ -1530,7 +1530,7 @@ void ChatServer::unbanFromRoom(const unsigned sequence, const NetworkId &banner,
|
||||
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(sequence, bannee);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestRemoveBan(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestRemoveBan(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = banner;
|
||||
}
|
||||
else
|
||||
@@ -1551,7 +1551,7 @@ void ChatServer::unbanFromRoom(const unsigned sequence, const NetworkId &banner,
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::banFromRoom(const unsigned sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName)
|
||||
void ChatServer::banFromRoom(const uint32_t sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName)
|
||||
{
|
||||
canonicalizeAvatarId(bannee);
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "banFromRoom() sequence(%u) banner(%s) bannee(%s) roomName(%s)", sequence, banner.getValueString().c_str(), bannee.getFullName().c_str(), roomName.c_str());
|
||||
@@ -1566,7 +1566,7 @@ void ChatServer::banFromRoom(const unsigned sequence, const NetworkId &banner, c
|
||||
const ChatAvatar *bannerAvatar = getAvatarByNetworkId(banner);
|
||||
if (bannerAvatar)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
const ChatServerRoomOwner *roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (roomOwner)
|
||||
@@ -1578,20 +1578,20 @@ void ChatServer::banFromRoom(const unsigned sequence, const NetworkId &banner, c
|
||||
// Remove the bannee from the invited list
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, bannee);
|
||||
instance().chatInterface->RequestRemoveInvite(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestRemoveInvite(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
|
||||
// Remove the bannee from the moderator list
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, bannee);
|
||||
instance().chatInterface->RequestRemoveModerator(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestRemoveModerator(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
|
||||
// Ban the avatar
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(sequence, bannee);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestAddBan(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestAddBan(bannerAvatar, banName, banAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = banner;
|
||||
}
|
||||
}
|
||||
@@ -1631,7 +1631,7 @@ void ChatServer::invite(const NetworkId & id, const ChatAvatarId & avatarId, con
|
||||
|
||||
if (invitor)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
ChatServerRoomOwner const * const roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (roomOwner)
|
||||
@@ -1644,14 +1644,14 @@ void ChatServer::invite(const NetworkId & id, const ChatAvatarId & avatarId, con
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, avatarId);
|
||||
|
||||
instance().chatInterface->RequestRemoveBan(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestRemoveBan(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
|
||||
// Invite the avatar
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, avatarId);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestAddInvite(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestAddInvite(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
}
|
||||
@@ -1681,13 +1681,13 @@ void ChatServer::inviteGroupMembers(const NetworkId & id, const ChatAvatarId & a
|
||||
ChatAvatar const * const invitor = getAvatarByNetworkId(id);
|
||||
if (invitor)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
ChatServerRoomOwner const * const roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
if (roomOwner)
|
||||
{
|
||||
// Invite each member
|
||||
for (unsigned i = 0; i < members.size(); ++i)
|
||||
for (uint32_t i = 0; i < members.size(); ++i)
|
||||
{
|
||||
NetworkId const & memberNetworkId = members[i];
|
||||
ChatAvatar const * const memberAvatar = getAvatarByNetworkId(memberNetworkId);
|
||||
@@ -1705,14 +1705,14 @@ void ChatServer::inviteGroupMembers(const NetworkId & id, const ChatAvatarId & a
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, memberId);
|
||||
|
||||
instance().chatInterface->RequestRemoveBan(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestRemoveBan(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
|
||||
// Invite the avatar
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, memberId);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestAddInvite(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestAddInvite(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
}
|
||||
@@ -1759,20 +1759,20 @@ void ChatServer::removeSystemAvatarFromRoom(const ChatRoom *room)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::leaveRoom(const NetworkId & id, const unsigned int sequence, const unsigned int roomId)
|
||||
void ChatServer::leaveRoom(const NetworkId & id, const uint32_t sequence, const uint32_t roomId)
|
||||
{
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "leaveRoom() id(%s) sequence(%u) roomId(%u)", id.getValueString().c_str(), sequence, roomId);
|
||||
|
||||
const ChatAvatar * avatar = getAvatarByNetworkId(id);
|
||||
if (avatar)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
// Try to get the room
|
||||
ChatServerRoomOwner const * const roomOwner = instance().chatInterface->getRoomOwner(roomId);
|
||||
if (roomOwner)
|
||||
{
|
||||
unsigned track = instance().chatInterface->RequestLeaveRoom(avatar, roomOwner->getAddress(), (void *)sequence);
|
||||
uint32_t track = instance().chatInterface->RequestLeaveRoom(avatar, roomOwner->getAddress(), (void *)(uintptr_t)sequence);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
else
|
||||
@@ -1895,7 +1895,7 @@ void ChatServer::kickAvatarFromRoom(const NetworkId & id, const ChatAvatarId & a
|
||||
canonicalizeAvatarId(avatarId);
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "kickAvatarFromRoom() moderator(%s) avatarName(%s) roomName(%s)", id.getValueString().c_str(), avatarId.getFullName().c_str(), roomName.c_str());
|
||||
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
ChatAvatar const * const moderatorChatAvatar = getAvatarByNetworkId(id);
|
||||
if (moderatorChatAvatar)
|
||||
@@ -1910,20 +1910,20 @@ void ChatServer::kickAvatarFromRoom(const NetworkId & id, const ChatAvatarId & a
|
||||
// Remove the avatar from the invited list
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, avatarId);
|
||||
instance().chatInterface->RequestRemoveInvite(moderatorChatAvatar, kickName, kickAddress, roomOwner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestRemoveInvite(moderatorChatAvatar, kickName, kickAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
|
||||
// Remove the avatar from the moderator list
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, avatarId);
|
||||
instance().chatInterface->RequestRemoveModerator(moderatorChatAvatar, kickName, kickAddress, roomOwner->getAddress(), (void *)pair);
|
||||
instance().chatInterface->RequestRemoveModerator(moderatorChatAvatar, kickName, kickAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
}
|
||||
|
||||
// Kick the avatar from the room
|
||||
{
|
||||
AvatarIdSequencePair *pair = new AvatarIdSequencePair(0, avatarId);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestKickAvatar(moderatorChatAvatar, kickName, kickAddress, roomOwner->getAddress(), (void*)pair);
|
||||
uint32_t track = instance().chatInterface->RequestKickAvatar(moderatorChatAvatar, kickName, kickAddress, roomOwner->getAddress(), (void *)(uintptr_t)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
}
|
||||
@@ -1945,7 +1945,7 @@ void ChatServer::kickAvatarFromRoom(const NetworkId & id, const ChatAvatarId & a
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::queryRoom(const NetworkId & id, ConnectionServerConnection * connection, const unsigned int sequence, const std::string & roomName)
|
||||
void ChatServer::queryRoom(const NetworkId & id, ConnectionServerConnection * connection, const uint32_t sequence, const std::string & roomName)
|
||||
{
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "queryRoom() id(%s) roomName(%s)", id.getValueString().c_str(), roomName.c_str());
|
||||
|
||||
@@ -1954,7 +1954,7 @@ void ChatServer::queryRoom(const NetworkId & id, ConnectionServerConnection * co
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::requestPersistentMessage(const NetworkId &id, const unsigned int sequence, const unsigned int messageId)
|
||||
void ChatServer::requestPersistentMessage(const NetworkId &id, const uint32_t sequence, const uint32_t messageId)
|
||||
{
|
||||
ChatServer::fileLog(false, "ChatServer", "requestPersistentMessage() id(%s) sequence(%u) messageId(%u)", id.getValueString().c_str(), sequence, messageId);
|
||||
|
||||
@@ -1962,7 +1962,7 @@ void ChatServer::requestPersistentMessage(const NetworkId &id, const unsigned in
|
||||
|
||||
if (avatar)
|
||||
{
|
||||
IGNORE_RETURN(instance().chatInterface->RequestGetPersistentMessage(avatar, messageId, (void *)sequence));
|
||||
IGNORE_RETURN(instance().chatInterface->RequestGetPersistentMessage(avatar, messageId, (void *)(uintptr_t)sequence));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2039,7 +2039,7 @@ void ChatServer::sendInstantMessage(const ChatAvatarId & from, const ChatAvatarI
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::sendInstantMessage(const NetworkId & fromId, const unsigned int sequence, const ChatAvatarId & n, const Unicode::String & message, const Unicode::String & oob)
|
||||
void ChatServer::sendInstantMessage(const NetworkId & fromId, const uint32_t sequence, const ChatAvatarId & n, const Unicode::String & message, const Unicode::String & oob)
|
||||
{
|
||||
canonicalizeAvatarId(n);
|
||||
ChatServer::fileLog(false, "ChatServer", "sendInstantMessage() fromId(%s) sequence(%u) toName(%s)", fromId.getValueString().c_str(), sequence, n.getFullName().c_str());
|
||||
@@ -2064,7 +2064,7 @@ void ChatServer::sendInstantMessage(const NetworkId & fromId, const unsigned int
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int const maxTellLength = 512;
|
||||
uint32_t const maxTellLength = 512;
|
||||
|
||||
if(message.length() < maxTellLength)
|
||||
{
|
||||
@@ -2114,10 +2114,10 @@ void ChatServer::sendInstantMessage(const NetworkId & fromId, const unsigned int
|
||||
|
||||
splitChatAvatarId(n, friendName, friendAddress);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestSendInstantMessage(from,
|
||||
uint32_t track = instance().chatInterface->RequestSendInstantMessage(from,
|
||||
ChatUnicodeString(friendName.data(), friendName.size()),
|
||||
ChatUnicodeString(friendAddress.data(), friendAddress.size()),
|
||||
ChatUnicodeString(message.data(), message.size()), ChatUnicodeString(oob.data(), oob.size()), (void *)sequence);
|
||||
ChatUnicodeString(message.data(), message.size()), ChatUnicodeString(oob.data(), oob.size()), (void *)(uintptr_t)sequence);
|
||||
|
||||
instance().pendingRequests[track] = fromId;
|
||||
}
|
||||
@@ -2177,7 +2177,7 @@ void ChatServer::sendPersistentMessage(const ChatAvatarId & from, const ChatAvat
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::sendPersistentMessage(const NetworkId & fromId, const unsigned int sequenceId, const ChatAvatarId & to, const Unicode::String & subject, const Unicode::String & message, const Unicode::String & oob)
|
||||
void ChatServer::sendPersistentMessage(const NetworkId & fromId, const uint32_t sequenceId, const ChatAvatarId & to, const Unicode::String & subject, const Unicode::String & message, const Unicode::String & oob)
|
||||
{
|
||||
canonicalizeAvatarId(to);
|
||||
|
||||
@@ -2211,14 +2211,14 @@ void ChatServer::sendPersistentMessage(const NetworkId & fromId, const unsigned
|
||||
Unicode::String friendAddress;
|
||||
|
||||
splitChatAvatarId(to, friendName, friendAddress);
|
||||
unsigned track = instance().chatInterface->RequestSendPersistentMessage(
|
||||
uint32_t track = instance().chatInterface->RequestSendPersistentMessage(
|
||||
from,
|
||||
ChatUnicodeString(friendName.data(), friendName.size()),
|
||||
ChatUnicodeString(friendAddress.data(), friendAddress.size()),
|
||||
ChatUnicodeString(subject.data(), subject.size()),
|
||||
ChatUnicodeString(message.data(), message.size()),
|
||||
ChatUnicodeString(oob.data(), oob.size()),
|
||||
(void *)sequenceId
|
||||
(void *)(uintptr_t)sequenceId
|
||||
);
|
||||
instance().pendingRequests[track] = fromId;
|
||||
}
|
||||
@@ -2272,7 +2272,7 @@ void ChatServer::sendRoomMessage(const ChatAvatarId &id, const std::string & roo
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::sendRoomMessage(const NetworkId & id, const unsigned int sequence, const unsigned int roomId, const Unicode::String &msg, const Unicode::String & oob)
|
||||
void ChatServer::sendRoomMessage(const NetworkId & id, const uint32_t sequence, const uint32_t roomId, const Unicode::String &msg, const Unicode::String & oob)
|
||||
{
|
||||
if(!msg.empty() || !oob.empty())
|
||||
{
|
||||
@@ -2336,7 +2336,7 @@ void ChatServer::sendRoomMessage(const NetworkId & id, const unsigned int sequen
|
||||
if (allowToSpeak)
|
||||
{
|
||||
// character allowed to talk
|
||||
unsigned track = instance().chatInterface->RequestSendRoomMessage(sender, room->getAddress(), ChatUnicodeString(msg.data(), msg.size()), ChatUnicodeString(oob.data(), oob.size()), (void *)sequence);
|
||||
uint32_t track = instance().chatInterface->RequestSendRoomMessage(sender, room->getAddress(), ChatUnicodeString(msg.data(), msg.size()), ChatUnicodeString(oob.data(), oob.size()), (void *)(uintptr_t)sequence);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
else if (!squelched && (ConfigChatServer::getChatSpamNotifyPlayerWhenLimitedIntervalSeconds() > 0) && (timeNow >= aed->chatSpamNextTimeToNotifyPlayerWhenLimited))
|
||||
@@ -2402,7 +2402,7 @@ void ChatServer::sendStandardRoomMessage(const ChatAvatarId &senderId, const std
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::uninvite(const NetworkId &id , const unsigned int sequence, const ChatAvatarId &avatarId , const std::string &roomName )
|
||||
void ChatServer::uninvite(const NetworkId &id , const uint32_t sequence, const ChatAvatarId &avatarId , const std::string &roomName )
|
||||
{
|
||||
canonicalizeAvatarId(avatarId);
|
||||
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "uninvite() id(%s) sequence(%u) avatarId(%s) roomName(%s)", id.getValueString().c_str(), sequence, avatarId.getFullName().c_str(), roomName.c_str());
|
||||
@@ -2411,7 +2411,7 @@ void ChatServer::uninvite(const NetworkId &id , const unsigned int sequence, con
|
||||
ChatAvatar const * invitor = getAvatarByNetworkId(id);
|
||||
if (invitor)
|
||||
{
|
||||
unsigned errorCode = CHATRESULT_SUCCESS;
|
||||
uint32_t errorCode = CHATRESULT_SUCCESS;
|
||||
|
||||
// Try to get the room
|
||||
ChatServerRoomOwner const * const roomOwner = instance().chatInterface->getRoomOwner(roomName);
|
||||
@@ -2423,7 +2423,7 @@ void ChatServer::uninvite(const NetworkId &id , const unsigned int sequence, con
|
||||
|
||||
AvatarIdSequencePair * pair = new AvatarIdSequencePair(sequence, avatarId);
|
||||
|
||||
unsigned track = instance().chatInterface->RequestRemoveInvite(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)pair);
|
||||
uint32_t track = instance().chatInterface->RequestRemoveInvite(invitor, inviteName, inviteAddress, roomOwner->getAddress(), (void *)(uintptr_t)pair);
|
||||
instance().pendingRequests[track] = id;
|
||||
}
|
||||
else
|
||||
@@ -2525,7 +2525,7 @@ std::string ChatServer::toNarrowString(ChatUnicodeString const &chatUnicodeStrin
|
||||
{
|
||||
std::string result;
|
||||
|
||||
for (unsigned int index = 0; index < chatUnicodeString.string_length; ++index)
|
||||
for (uint32_t index = 0; index < chatUnicodeString.string_length; ++index)
|
||||
{
|
||||
result += static_cast<char>(chatUnicodeString.string_data[index]);
|
||||
}
|
||||
@@ -2592,7 +2592,7 @@ void ChatServer::clearCustomerServiceServerConnection()
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::connectToCustomerServiceServer(const std::string &address, const unsigned short port)
|
||||
void ChatServer::connectToCustomerServiceServer(const std::string &address, const uint16_t port)
|
||||
{
|
||||
//DEBUG_REPORT_LOG(true, ("***ChatServer::connectToCustomerServiceServer() address(%s) port(%d)\n", address.c_str(), port));
|
||||
|
||||
@@ -2634,7 +2634,7 @@ bool ChatServer::isValidChatAvatarName(Unicode::String const &chatAvatarName)
|
||||
|
||||
int dotCount = 0;
|
||||
|
||||
for (unsigned int i = 0; i < lowerNarrowName.length(); ++i)
|
||||
for (uint32_t i = 0; i < lowerNarrowName.length(); ++i)
|
||||
{
|
||||
if (lowerNarrowName[i] == '.')
|
||||
{
|
||||
@@ -2766,7 +2766,7 @@ void ChatServer::requestTransferAvatar(const TransferCharacterData & request)
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::onCreateRoomSuccess(const std::string & lowerName, const unsigned int roomId)
|
||||
void ChatServer::onCreateRoomSuccess(const std::string & lowerName, const uint32_t roomId)
|
||||
{
|
||||
std::set<std::pair<std::string, ChatAvatarId> >::iterator nameIter;
|
||||
for(nameIter = s_pendingEntersByName.begin(); nameIter != s_pendingEntersByName.end();)
|
||||
@@ -2782,7 +2782,7 @@ void ChatServer::onCreateRoomSuccess(const std::string & lowerName, const unsign
|
||||
}
|
||||
}
|
||||
|
||||
std::set<std::pair<NetworkId, std::pair<unsigned int, unsigned int> > >::iterator idIter;
|
||||
std::set<std::pair<NetworkId, std::pair<uint32_t, uint32_t> > >::iterator idIter;
|
||||
for(idIter = s_pendingEntersById.begin(); idIter != s_pendingEntersById.end();)
|
||||
{
|
||||
if(idIter->second.second == roomId)
|
||||
@@ -2865,9 +2865,9 @@ VChatInterface* ChatServer::getVChatInterface()
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
unsigned ChatServer::registerGameServerConnection(GameServerConnection *connection)
|
||||
uint32_t ChatServer::registerGameServerConnection(GameServerConnection *connection)
|
||||
{
|
||||
static unsigned nextId = 0;
|
||||
static uint32_t nextId = 0;
|
||||
|
||||
++nextId;
|
||||
m_gameServerConnectionRegistry.insert(std::make_pair(nextId, connection));
|
||||
@@ -2876,7 +2876,7 @@ unsigned ChatServer::registerGameServerConnection(GameServerConnection *connecti
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::unregisterGameServerConnection(unsigned const connectionId)
|
||||
void ChatServer::unregisterGameServerConnection(uint32_t const connectionId)
|
||||
{
|
||||
GameServerMap::iterator i = m_gameServerConnectionRegistry.find(connectionId);
|
||||
if(i != m_gameServerConnectionRegistry.end())
|
||||
@@ -2887,7 +2887,7 @@ void ChatServer::unregisterGameServerConnection(unsigned const connectionId)
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void ChatServer::sendToGameServerById(unsigned const connectionId, GameNetworkMessage const & message)
|
||||
void ChatServer::sendToGameServerById(uint32_t const connectionId, GameNetworkMessage const & message)
|
||||
{
|
||||
GameServerConnection* connection = getGameServerConnectionFromId(connectionId);
|
||||
if(connection)
|
||||
@@ -2902,10 +2902,10 @@ void ChatServer::sendToGameServerById(unsigned const connectionId, GameNetworkMe
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
GameServerConnection *ChatServer::getGameServerConnectionFromId(unsigned int sequence)
|
||||
GameServerConnection *ChatServer::getGameServerConnectionFromId(uint32_t sequence)
|
||||
{
|
||||
GameServerConnection * result = nullptr;
|
||||
std::unordered_map<unsigned int, GameServerConnection *>::iterator f = m_gameServerConnectionRegistry.find(sequence);
|
||||
std::unordered_map<uint32_t, GameServerConnection *>::iterator f = m_gameServerConnectionRegistry.find(sequence);
|
||||
if(f != m_gameServerConnectionRegistry.end())
|
||||
{
|
||||
result = (*f).second;
|
||||
@@ -2987,7 +2987,7 @@ void ChatServer::requestRemoveClientFromChannel(const NetworkId & id, std::strin
|
||||
|
||||
void ChatServer::requestChannelCommand(ReturnAddress const & requester,
|
||||
const std::string &srcUserName, const std::string &destUserName, const std::string &destChannelAddress,
|
||||
unsigned command,unsigned banTimeout)
|
||||
uint32_t command,uint32_t banTimeout)
|
||||
{
|
||||
getVChatInterface()->requestChannelCommand(requester, srcUserName, destUserName, destChannelAddress, command, banTimeout);
|
||||
}
|
||||
|
||||
@@ -44,15 +44,15 @@ namespace MessageDispatch {
|
||||
|
||||
struct AvatarSequencePair
|
||||
{
|
||||
AvatarSequencePair(unsigned s, const ChatAvatar *a) : sequence(s), avatar(a) {}
|
||||
unsigned sequence;
|
||||
AvatarSequencePair(uint32_t s, const ChatAvatar *a) : sequence(s), avatar(a) {}
|
||||
uint32_t sequence;
|
||||
const ChatAvatar *avatar;
|
||||
};
|
||||
|
||||
struct AvatarIdSequencePair
|
||||
{
|
||||
AvatarIdSequencePair(unsigned s, const ChatAvatarId &a) : sequence(s), avatar(a) {}
|
||||
unsigned sequence;
|
||||
AvatarIdSequencePair(uint32_t s, const ChatAvatarId &a) : sequence(s), avatar(a) {}
|
||||
uint32_t sequence;
|
||||
const ChatAvatarId avatar;
|
||||
|
||||
private:
|
||||
@@ -62,8 +62,8 @@ private:
|
||||
|
||||
struct RoomOwnerSequencePair
|
||||
{
|
||||
RoomOwnerSequencePair(unsigned s, const ChatServerRoomOwner * r) : sequence(s), roomOwner(r) {}
|
||||
unsigned sequence;
|
||||
RoomOwnerSequencePair(uint32_t s, const ChatServerRoomOwner * r) : sequence(s), roomOwner(r) {}
|
||||
uint32_t sequence;
|
||||
const ChatServerRoomOwner *roomOwner;
|
||||
};
|
||||
|
||||
@@ -80,10 +80,10 @@ public:
|
||||
|
||||
void sendResponse(ReturnAddress const & requester, const GameNetworkMessage & response);
|
||||
|
||||
GameServerConnection * getGameServerConnectionFromId(unsigned int connectionId);
|
||||
unsigned registerGameServerConnection(GameServerConnection * connection);
|
||||
void unregisterGameServerConnection(unsigned const connectionId);
|
||||
void sendToGameServerById(unsigned const connectionId, GameNetworkMessage const & message);
|
||||
GameServerConnection * getGameServerConnectionFromId(uint32_t connectionId);
|
||||
uint32_t registerGameServerConnection(GameServerConnection * connection);
|
||||
void unregisterGameServerConnection(uint32_t const connectionId);
|
||||
void sendToGameServerById(uint32_t const connectionId, GameNetworkMessage const & message);
|
||||
|
||||
static VChatInterface* getVChatInterface();
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
static void requestAddClientToChannel(const NetworkId & id, std::string const & playerName, std::string const &roomName, bool forceShortlist);
|
||||
static void requestRemoveClientFromChannel(const NetworkId & id, std::string const & playerName, std::string const &roomName);
|
||||
static void requestChannelCommand(ReturnAddress const & requester, const std::string &srcUserName, const std::string &destUserName,
|
||||
const std::string &destChannelAddress, unsigned command, unsigned banTimeout);
|
||||
const std::string &destChannelAddress, uint32_t command, uint32_t banTimeout);
|
||||
|
||||
static void requestBroadcastChannelMessage(std::string const & channelName, std::string const & textMessage, bool isRemove);
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
std::unordered_map<unsigned, NetworkId> pendingRequests;
|
||||
std::unordered_map<uint32_t, NetworkId> pendingRequests;
|
||||
static ChatServer & instance ();
|
||||
|
||||
static bool isValidChatAvatarName(Unicode::String const &chatName);
|
||||
@@ -124,25 +124,25 @@ public:
|
||||
|
||||
static const ChatAvatar * getAvatarByNetworkId (const NetworkId & id);
|
||||
static const NetworkId & getNetworkIdByAvatarId(const ChatAvatarId & id);
|
||||
static NetworkId sendResponseForTrackId (unsigned trackId, const GameNetworkMessage & msg);
|
||||
static NetworkId sendResponseForTrackId (uint32_t trackId, const GameNetworkMessage & msg);
|
||||
static ChatInterface * getChatInterface();
|
||||
|
||||
static void setOwnerSystem (const ChatAvatar * ownerSystem);
|
||||
static ConnectionServerConnection * getConnectionForCharacter(const NetworkId & characterId);
|
||||
static const ChatAvatarId & getSystemAvatarId ();
|
||||
static const Service * getGameService ();
|
||||
static GameServerConnection * getGameServerConnection(unsigned int sequence);
|
||||
static void addGameServerConnection(unsigned int sequence, GameServerConnection *connection);
|
||||
static GameServerConnection * getGameServerConnection(uint32_t sequence);
|
||||
static void addGameServerConnection(uint32_t sequence, GameServerConnection *connection);
|
||||
|
||||
static void clearGameServerConnection(const GameServerConnection *connection);
|
||||
static void clearCustomerServiceServerConnection();
|
||||
|
||||
static void connectToCustomerServiceServer(const std::string &address, const unsigned short port);
|
||||
static void connectToCustomerServiceServer(const std::string &address, const uint16_t port);
|
||||
|
||||
static void sendToClient (const NetworkId & id, const GameNetworkMessage & msg);
|
||||
static void deferChatMessageFor (const NetworkId &, const Archive::ByteStream &);
|
||||
|
||||
static ChatAvatarId getAvatarIdForTrackId (unsigned trackId);
|
||||
static ChatAvatarId getAvatarIdForTrackId (uint32_t trackId);
|
||||
|
||||
static void reconnectToCentralServer ();
|
||||
static void onCentralServerConnectionClosed();
|
||||
@@ -151,46 +151,46 @@ public:
|
||||
static void quit ();
|
||||
static void chatConnectedAvatar (const NetworkId & id, const ChatAvatar & avatar);
|
||||
|
||||
static void connectPlayer (ConnectionServerConnection * connection, const unsigned int suid, const std::string & characterName, const NetworkId & networkId, const bool isSecure, const bool isSubscribed);
|
||||
static void createRoom (const NetworkId & id, const unsigned int sequence, const std::string & name, const bool isModerated, const bool isPublic, const std::string & title);
|
||||
static void connectPlayer (ConnectionServerConnection * connection, const uint32_t suid, const std::string & characterName, const NetworkId & networkId, const bool isSecure, const bool isSubscribed);
|
||||
static void createRoom (const NetworkId & id, const uint32_t sequence, const std::string & name, const bool isModerated, const bool isPublic, const std::string & title);
|
||||
static void putSystemAvatarInRoom (const std::string & roomName);
|
||||
static void enterRoom (const NetworkId & id, const unsigned int sequence, const std::string & roomName);
|
||||
static void enterRoom (const NetworkId & id, const unsigned int sequence, const unsigned int roomId);
|
||||
static void enterRoom (const NetworkId & id, const uint32_t sequence, const std::string & roomName);
|
||||
static void enterRoom (const NetworkId & id, const uint32_t sequence, const uint32_t roomId);
|
||||
static void enterRoom (const ChatAvatarId & id, const std::string & roomName, bool forceCreate, bool createPrivate);
|
||||
static void sendInstantMessage (const NetworkId & fromId, const unsigned int sequence, const ChatAvatarId & to, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void sendInstantMessage (const NetworkId & fromId, const uint32_t sequence, const ChatAvatarId & to, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void sendInstantMessage (const ChatAvatarId & from, const ChatAvatarId & to, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void leaveRoom (const NetworkId & id, const unsigned int sequence, const unsigned int roomId);
|
||||
static void leaveRoom (const NetworkId & id, const uint32_t sequence, const uint32_t roomId);
|
||||
static void removeAvatarFromRoom (const NetworkId & requestor, const ChatAvatarId & avatarId, const std::string & roomName);
|
||||
static void removeSystemAvatarFromRoom(const ChatRoom *room);
|
||||
static void removeAvatarFromRoom (const ChatAvatarId & avatarId, const std::string & roomName);
|
||||
static void kickAvatarFromRoom (const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName);
|
||||
static void sendRoomMessage (const NetworkId & id, const unsigned int sequence, const unsigned int roomId, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void sendRoomMessage (const NetworkId & id, const uint32_t sequence, const uint32_t roomId, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void sendRoomMessage (const ChatAvatarId & from, const std::string & roomName, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void sendStandardRoomMessage (const ChatAvatarId & from, const std::string & roomName, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void destroyRoom (const NetworkId & id, const unsigned int sequence, const unsigned int roomId);
|
||||
static void destroyRoom (const NetworkId & id, const uint32_t sequence, const uint32_t roomId);
|
||||
static void destroyRoom (const std::string & roomName);
|
||||
static void addFriend (const NetworkId & id, const unsigned int sequence, const ChatAvatarId & friendName);
|
||||
static void removeFriend (const NetworkId & id, const unsigned int sequence, const ChatAvatarId & friendName);
|
||||
static void addFriend (const NetworkId & id, const uint32_t sequence, const ChatAvatarId & friendName);
|
||||
static void removeFriend (const NetworkId & id, const uint32_t sequence, const ChatAvatarId & friendName);
|
||||
static void getFriendsList (const ChatAvatarId & characterName);
|
||||
static void addIgnore (const NetworkId & id, const unsigned int sequence, const ChatAvatarId & ignoreName);
|
||||
static void removeIgnore (const NetworkId & id, const unsigned int sequence, const ChatAvatarId & ignoreName);
|
||||
static void addIgnore (const NetworkId & id, const uint32_t sequence, const ChatAvatarId & ignoreName);
|
||||
static void removeIgnore (const NetworkId & id, const uint32_t sequence, const ChatAvatarId & ignoreName);
|
||||
static void getIgnoreList (const ChatAvatarId & characterName);
|
||||
static void disconnectAvatar (const ChatAvatar &);
|
||||
static void disconnectPlayer (const NetworkId &);
|
||||
static void invite (const NetworkId & id, const ChatAvatarId & avatar, const std::string & roomName);
|
||||
static void inviteGroupMembers (const NetworkId & id, const ChatAvatarId & avatar, const std::string & roomName, const std::vector<NetworkId> & members);
|
||||
static void uninvite (const NetworkId & id, const unsigned int sequence, const ChatAvatarId & avatar, const std::string & roomName);
|
||||
static void queryRoom (const NetworkId & id, ConnectionServerConnection * connection, const unsigned int sequence, const std::string & roomName);
|
||||
static void uninvite (const NetworkId & id, const uint32_t sequence, const ChatAvatarId & avatar, const std::string & roomName);
|
||||
static void queryRoom (const NetworkId & id, ConnectionServerConnection * connection, const uint32_t sequence, const std::string & roomName);
|
||||
static void requestRoomList (const NetworkId & id, ConnectionServerConnection * connection);
|
||||
static void addModeratorToRoom (const unsigned int sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName);
|
||||
static void removeModeratorFromRoom (const unsigned int sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName);
|
||||
static void deletePersistentMessage (const NetworkId & ownerId, const unsigned int messageId);
|
||||
static void addModeratorToRoom (const uint32_t sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName);
|
||||
static void removeModeratorFromRoom (const uint32_t sequenceId, const NetworkId & id, const ChatAvatarId & avatarId, const std::string & roomName);
|
||||
static void deletePersistentMessage (const NetworkId & ownerId, const uint32_t messageId);
|
||||
static void deleteAllPersistentMessages(const NetworkId &sourceNetworkId, const NetworkId &targetNetworkId);
|
||||
static void sendPersistentMessage (const NetworkId & fromId, const unsigned int sequence, const ChatAvatarId & to, const Unicode::String & subject, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void sendPersistentMessage (const NetworkId & fromId, const uint32_t sequence, const ChatAvatarId & to, const Unicode::String & subject, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void sendPersistentMessage (const ChatAvatarId & from, const ChatAvatarId & to, const Unicode::String & subject, const Unicode::String & message, const Unicode::String & oob);
|
||||
static void requestPersistentMessage (const NetworkId &id, const unsigned int sequence, const unsigned int messageId);
|
||||
static void banFromRoom (const unsigned sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName);
|
||||
static void unbanFromRoom (const unsigned sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName);
|
||||
static void requestPersistentMessage (const NetworkId &id, const uint32_t sequence, const uint32_t messageId);
|
||||
static void banFromRoom (const uint32_t sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName);
|
||||
static void unbanFromRoom (const uint32_t sequence, const NetworkId &banner, const ChatAvatarId &bannee, const std::string &roomName);
|
||||
static void removeConnectionServerConnection(ConnectionServerConnection * target);
|
||||
|
||||
static void sendToAllConnectionServers(const GameNetworkMessage &message);
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
|
||||
static void fileLog(bool const forceLog, char const * const label, char const * const format, ...);
|
||||
static void requestTransferAvatar(const TransferCharacterData & request);
|
||||
static void onCreateRoomSuccess(const std::string & lowerName, const unsigned int roomId);
|
||||
static void onCreateRoomSuccess(const std::string & lowerName, const uint32_t roomId);
|
||||
static bool isGod(const NetworkId & networkId);
|
||||
|
||||
static void setUnsquelchTime(NetworkId const & character, time_t unsquelchTime);
|
||||
@@ -244,7 +244,7 @@ private:
|
||||
ChatInterface * chatInterface;
|
||||
VChatInterface * voiceChatInterface;
|
||||
std::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash> clientMap;
|
||||
std::unordered_map<unsigned int, GameServerConnection *> gameServerConnectionMap;
|
||||
std::unordered_map<uint32_t, GameServerConnection *> gameServerConnectionMap;
|
||||
std::set<ConnectionServerConnection *> connectionServerConnections;
|
||||
|
||||
bool done;
|
||||
@@ -255,7 +255,7 @@ private:
|
||||
static ChatServer * m_instance;
|
||||
CustomerServiceServerConnection *customerServiceServerConnection;
|
||||
|
||||
typedef std::unordered_map<unsigned int, GameServerConnection *> GameServerMap;
|
||||
typedef std::unordered_map<uint32_t, GameServerConnection *> GameServerMap;
|
||||
GameServerMap m_gameServerConnectionRegistry;
|
||||
VoiceChatAvatarList m_voiceChatIdMap;
|
||||
std::map<std::string, NetworkId> m_voiceChatNameToIdMap;
|
||||
@@ -284,14 +284,14 @@ private:
|
||||
std::hash_map<NetworkId, const ChatAvatar *, NetworkId::Hash> chatAvatars;
|
||||
ChatInterface * chatInterface;
|
||||
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash> clientMap;
|
||||
std::hash_map<unsigned int, GameServerConnection *> gameServerConnectionMap;
|
||||
std::hash_map<uint32_t, GameServerConnection *> gameServerConnectionMap;
|
||||
std::set<ConnectionServerConnection *> connectionServerConnections;
|
||||
bool done;
|
||||
Service * gameService;
|
||||
Service * planetService;
|
||||
const ChatAvatar * ownerSystem;
|
||||
ChatAvatarId systemAvatarId;
|
||||
std::hash_map<unsigned, NetworkId> pendingRequests;
|
||||
std::hash_map<uint32_t, NetworkId> pendingRequests;
|
||||
static ChatServer * m_instance;
|
||||
|
||||
};*/
|
||||
|
||||
@@ -40,13 +40,13 @@ public:
|
||||
};
|
||||
|
||||
static const char * getBackupGatewayServerIP ();
|
||||
static const unsigned short getBackupGatewayServerPort ();
|
||||
static const uint16_t getBackupGatewayServerPort ();
|
||||
static const char * getCentralServerAddress ();
|
||||
static const unsigned short getCentralServerPort ();
|
||||
static const uint16_t getCentralServerPort ();
|
||||
static const char * getClusterName ();
|
||||
static const char * getGameCode ();
|
||||
static const char * getGatewayServerIP ();
|
||||
static const unsigned short getGatewayServerPort ();
|
||||
static const uint16_t getGatewayServerPort ();
|
||||
static const time_t getRoomInactivityTimeout ();
|
||||
static const time_t getRoomUnpopulatedTimeout ();
|
||||
static const char * getGameServiceBindInterface ();
|
||||
@@ -85,9 +85,9 @@ inline const char * ConfigChatServer::getBackupGatewayServerIP()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigChatServer::getBackupGatewayServerPort()
|
||||
inline const uint16_t ConfigChatServer::getBackupGatewayServerPort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->backupGatewayServerPort);
|
||||
return static_cast<uint16_t>(data->backupGatewayServerPort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -99,9 +99,9 @@ inline const char * ConfigChatServer::getCentralServerAddress()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigChatServer::getCentralServerPort()
|
||||
inline const uint16_t ConfigChatServer::getCentralServerPort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->centralServerPort);
|
||||
return static_cast<uint16_t>(data->centralServerPort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -127,9 +127,9 @@ inline const char * ConfigChatServer::getGatewayServerIP()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned short ConfigChatServer::getGatewayServerPort()
|
||||
inline const uint16_t ConfigChatServer::getGatewayServerPort()
|
||||
{
|
||||
return static_cast<unsigned short>(data->gatewayServerPort);
|
||||
return static_cast<uint16_t>(data->gatewayServerPort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
ConnectionServerConnection::ConnectionServerConnection(const std::string & a, const unsigned short p) :
|
||||
ConnectionServerConnection::ConnectionServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData()),
|
||||
m_avatars()
|
||||
{
|
||||
@@ -146,7 +146,7 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
if (!avatar && cmtype == constcrc("ChatInstantMessageToCharacter"))
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("ConnectionServer - ChatInstantMessageToCharacter");
|
||||
//printf("!Sending via the shortcut\n");
|
||||
//printf("!Sending via the int16_tcut\n");
|
||||
cri = c.getByteStream().begin();
|
||||
|
||||
// deliver IM to character
|
||||
|
||||
@@ -18,7 +18,7 @@ class GameNetworkMessage;
|
||||
class ConnectionServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
ConnectionServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
ConnectionServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
~ConnectionServerConnection();
|
||||
|
||||
void addAvatar (ChatServerAvatarOwner * avatar);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "sharedNetworkMessages/ChatOnRequestLog.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
CustomerServiceServerConnection::CustomerServiceServerConnection(const std::string & a, const unsigned short p)
|
||||
CustomerServiceServerConnection::CustomerServiceServerConnection(const std::string & a, const uint16_t p)
|
||||
: ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
ChatServer::fileLog(true, "CSServerConnection", "Connection created...listening on (%s:%d)", a.c_str(), static_cast<int>(p));
|
||||
|
||||
@@ -14,7 +14,7 @@ class CustomerServiceServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
|
||||
CustomerServiceServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
CustomerServiceServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
virtual ~CustomerServiceServerConnection();
|
||||
|
||||
void onConnectionClosed();
|
||||
|
||||
@@ -328,12 +328,12 @@ unsigned VChatInterface::internalGetChannel(const std::string &channelName,
|
||||
info->moderators = moderators;
|
||||
|
||||
//This is dumb. vchat should be consistant about qualifying channel names.
|
||||
std::string shortName, server, game;
|
||||
VChatSystem::GetChannelComponents(channelName,shortName,server,game);
|
||||
std::string int16_tName, server, game;
|
||||
VChatSystem::GetChannelComponents(channelName,int16_tName,server,game);
|
||||
DEBUG_WARNING(game != ConfigChatServer::getGameCode(),("Channel create request with mismatched game code %s (should be %s)", game.c_str(), ConfigChatServer::getGameCode()));
|
||||
DEBUG_WARNING(server != ConfigChatServer::getClusterName(),("Channel create request with mismatched cluster name %s (should be %s)", server.c_str(), ConfigChatServer::getClusterName()));
|
||||
|
||||
unsigned track = VChatAPI::GetChannelV2(shortName, game, server, description, password, limit, persistent, (void*)info);
|
||||
unsigned track = VChatAPI::GetChannelV2(int16_tName, game, server, description, password, limit, persistent, (void*)info);
|
||||
|
||||
ChatServer::fileLog(ms_voiceLoggingEnabled, ms_logLable, "requestGetChannel track(%d) requester(%s) name(%s) desc(%s) pass(%s) public(%s) persist(%s)",
|
||||
track, requester.debugString().c_str(), channelName.c_str(), description.c_str(), password.c_str(), isPublic?"true":"false", persistent?"true":"false");
|
||||
@@ -353,12 +353,12 @@ unsigned VChatInterface::requestDeleteChannel(std::string const &channelName, Re
|
||||
info->channelName = channelName;
|
||||
|
||||
//dumb
|
||||
std::string shortName, server, game;
|
||||
VChatSystem::GetChannelComponents(channelName,shortName,server,game);
|
||||
std::string int16_tName, server, game;
|
||||
VChatSystem::GetChannelComponents(channelName,int16_tName,server,game);
|
||||
DEBUG_WARNING(game != ConfigChatServer::getGameCode(),("Channel delete request with mismatched game code %s (should be %s)", game.c_str(), ConfigChatServer::getGameCode()));
|
||||
DEBUG_WARNING(server != ConfigChatServer::getClusterName(),("Channel delete request with mismatched cluster name %s (should be %s)", server.c_str(), ConfigChatServer::getClusterName()));
|
||||
|
||||
unsigned track = VChatAPI::DeleteChannel(shortName, game, server, info);
|
||||
unsigned track = VChatAPI::DeleteChannel(int16_tName, game, server, info);
|
||||
|
||||
ChatServer::fileLog(ms_voiceLoggingEnabled, ms_logLable, "requestDeleteChannel track(%d) requester(%s) name(%s)",
|
||||
track, requester.debugString().c_str(), channelName.c_str());
|
||||
@@ -417,10 +417,10 @@ unsigned VChatInterface::requestChannelInfo(std::string const & channelName, Ret
|
||||
info->textMessage = broadcastMessage;
|
||||
|
||||
//split the name since we can't request any random channel...
|
||||
std::string shortName, server, game;
|
||||
VChatSystem::GetChannelComponents(info->channelName, shortName, server, game);
|
||||
std::string int16_tName, server, game;
|
||||
VChatSystem::GetChannelComponents(info->channelName, int16_tName, server, game);
|
||||
|
||||
uint32 track = VChatAPI::GetChannelInfo(shortName, game, server, (void*)info);
|
||||
uint32 track = VChatAPI::GetChannelInfo(int16_tName, game, server, (void*)info);
|
||||
|
||||
ChatServer::fileLog(ms_voiceLoggingEnabled, ms_logLable, "requestChannelInfo: track(%d) channel(%s) requester(%s)",
|
||||
track, info->channelName.c_str(), info->requester.debugString().c_str());
|
||||
|
||||
@@ -4323,7 +4323,7 @@ void static decodeOOB(const std::string & UTF8String, Unicode::String & UniStrin
|
||||
{
|
||||
std::string::const_iterator c = UTF8String.begin();
|
||||
std::string tempstring;
|
||||
unsigned short unicharvalue;
|
||||
uint16_t unicharvalue;
|
||||
char * pEnd;
|
||||
|
||||
while (c != UTF8String.end())
|
||||
@@ -4331,10 +4331,10 @@ void static decodeOOB(const std::string & UTF8String, Unicode::String & UniStrin
|
||||
tempstring.push_back(*c);
|
||||
if (tempstring.length() == 4)
|
||||
{
|
||||
unicharvalue = static_cast<unsigned short>(strtoul(tempstring.c_str(), &pEnd, 16));
|
||||
unicharvalue = static_cast<uint16_t>(strtoul(tempstring.c_str(), &pEnd, 16));
|
||||
if (pEnd)
|
||||
{
|
||||
// WARNING(true, ("[Commodities Server ] : Conversion of string hex values to unsigned short failed in: TaskGetAuctionList::decodeOOB.\n"));
|
||||
// WARNING(true, ("[Commodities Server ] : Conversion of string hex values to uint16_t failed in: TaskGetAuctionList::decodeOOB.\n"));
|
||||
}
|
||||
UniString.push_back(unicharvalue);
|
||||
tempstring.clear();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "sharedNetwork/NetworkSetupData.h"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
CentralServerConnection::CentralServerConnection(const std::string & address, const unsigned short port) :
|
||||
CentralServerConnection::CentralServerConnection(const std::string & address, const uint16_t port) :
|
||||
ServerConnection(address, port, NetworkSetupData())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class CentralServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
CentralServerConnection (const std::string & address, const unsigned short port);
|
||||
CentralServerConnection (const std::string & address, const uint16_t port);
|
||||
CentralServerConnection(UdpConnectionMT *, TcpClient *);
|
||||
~CentralServerConnection();
|
||||
void onConnectionClosed();
|
||||
|
||||
@@ -88,14 +88,14 @@ class ConfigCommodityServer
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline unsigned short ConfigCommodityServer::getCMServerServiceBindPort()
|
||||
inline uint16_t ConfigCommodityServer::getCMServerServiceBindPort()
|
||||
{
|
||||
return data->cmServerServiceBindPort;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline unsigned short ConfigCommodityServer::getDatabaseServerPort()
|
||||
inline uint16_t ConfigCommodityServer::getDatabaseServerPort()
|
||||
{
|
||||
return data->databaseServerPort;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ inline const char * ConfigCommodityServer::getDatabaseSchema()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline unsigned short ConfigCommodityServer::getSecondsBetweenDBReconnect()
|
||||
inline uint16_t ConfigCommodityServer::getSecondsBetweenDBReconnect()
|
||||
{
|
||||
return data->secondsBetweenDBReconnect;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ inline bool ConfigCommodityServer::getShowAllDebugInfo()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline unsigned short ConfigCommodityServer::getCentralServerPort()
|
||||
inline uint16_t ConfigCommodityServer::getCentralServerPort()
|
||||
{
|
||||
return data->centralServerPort;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
DatabaseServerConnection::DatabaseServerConnection(const std::string & a, const unsigned short p) :
|
||||
DatabaseServerConnection::DatabaseServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
LOG("DatabaseServerConnection", ("Connection with the database server created"));
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class DatabaseServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
DatabaseServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
DatabaseServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
~DatabaseServerConnection();
|
||||
|
||||
void onConnectionClosed();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
CentralConnection::CentralConnection(const std::string & address, const unsigned short port) :
|
||||
CentralConnection::CentralConnection(const std::string & address, const uint16_t port) :
|
||||
ServerConnection(address, port, NetworkSetupData())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class CentralConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
CentralConnection (const std::string & address, const unsigned short port);
|
||||
CentralConnection (const std::string & address, const uint16_t port);
|
||||
CentralConnection(UdpConnectionMT *, TcpClient *);
|
||||
~CentralConnection();
|
||||
void onConnectionClosed();
|
||||
|
||||
@@ -163,7 +163,7 @@ void Client::receiveMessage(const MessageDispatch::Emitter & source, const Messa
|
||||
|
||||
if(messageType == constcrc("GameConnectionClosed"))
|
||||
{
|
||||
// Game server has crashed. With luck, we'll get transferred to a new server shortly
|
||||
// Game server has crashed. With luck, we'll get transferred to a new server int16_tly
|
||||
// So, clear our connection and put us on a queue. If we don't get transferred in a
|
||||
// reasonable about of time, we'll be dropped.
|
||||
|
||||
|
||||
@@ -925,7 +925,7 @@ void ClientConnection::onReceive(const Archive::ByteStream &message) {
|
||||
default : {
|
||||
//Forward on to Game Server
|
||||
DEBUG_REPORT_LOG((!m_client ||
|
||||
!m_client->getGameConnection()), ("Warn, received game message with no game connection. This may happen for a short time after a GameServer crashes. If it continues to happen, it indicates a bug.\n"));
|
||||
!m_client->getGameConnection()), ("Warn, received game message with no game connection. This may happen for a int16_t time after a GameServer crashes. If it continues to happen, it indicates a bug.\n"));
|
||||
|
||||
if (m_client && m_client->getGameConnection()) {
|
||||
static std::vector <NetworkId> v;
|
||||
@@ -992,7 +992,7 @@ void ClientConnection::onReceive(const Archive::ByteStream &message) {
|
||||
Unicode::String biography(clientCreate.getBiography());
|
||||
if (biography.length() > 1024) {
|
||||
IGNORE_RETURN(biography.erase(1024));
|
||||
DEBUG_REPORT_LOG(true, ("Biography shortened to 1024 characters.\n"));
|
||||
DEBUG_REPORT_LOG(true, ("Biography int16_tened to 1024 characters.\n"));
|
||||
}
|
||||
|
||||
if (m_isAdminAccount) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
GameConnection::GameConnection(const std::string & a, const unsigned short p) :
|
||||
GameConnection::GameConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData()),
|
||||
gameServerId(0),
|
||||
sceneName()
|
||||
|
||||
@@ -16,7 +16,7 @@ class GameCommandChannel;
|
||||
class GameConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
GameConnection(const std::string & remoteAddress, const unsigned short port);
|
||||
GameConnection(const std::string & remoteAddress, const uint16_t port);
|
||||
GameConnection(UdpConnectionMT *, TcpClient *);
|
||||
virtual ~GameConnection();
|
||||
|
||||
|
||||
+3
-3
@@ -17,7 +17,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
CentralServerConnection::CentralServerConnection(const std::string & a, const unsigned short p) :
|
||||
CentralServerConnection::CentralServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
LOG("CentralServerConnection", ("Connection created...listening on (%s:%d)", a.c_str(), static_cast<int>(p)));
|
||||
@@ -56,7 +56,7 @@ void CentralServerConnection::onConnectionOpened()
|
||||
|
||||
//DEBUG_REPORT_LOG(true, ("CustServ: sending chat server service address(%s:%d)\n", address.c_str(), port));
|
||||
|
||||
const GenericValueTypeMessage<std::pair<std::string, unsigned short> > message("CustomerServiceServerChatServerServiceAddress", std::make_pair(address, port));
|
||||
const GenericValueTypeMessage<std::pair<std::string, uint16_t> > message("CustomerServiceServerChatServerServiceAddress", std::make_pair(address, port));
|
||||
|
||||
send(message, true);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ void CentralServerConnection::onConnectionOpened()
|
||||
|
||||
//DEBUG_REPORT_LOG(true, ("CustServ: sending game server service address(%s:%d)\n", address.c_str(), port));
|
||||
|
||||
const GenericValueTypeMessage<std::pair<std::string, unsigned short> > message("CustomerServiceServerGameServerServiceAddress", std::make_pair(address, port));
|
||||
const GenericValueTypeMessage<std::pair<std::string, uint16_t> > message("CustomerServiceServerGameServerServiceAddress", std::make_pair(address, port));
|
||||
|
||||
send(message, true);
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
class CentralServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
CentralServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
CentralServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
~CentralServerConnection();
|
||||
|
||||
void onConnectionClosed ();
|
||||
|
||||
+8
-8
@@ -89,9 +89,9 @@ const char * ConfigCustomerServiceServer::getCustomerServiceServerAddress()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
unsigned short ConfigCustomerServiceServer::getCustomerServiceServerPort()
|
||||
uint16_t ConfigCustomerServiceServer::getCustomerServiceServerPort()
|
||||
{
|
||||
return static_cast<unsigned short>(s_csServerPort);
|
||||
return static_cast<uint16_t>(s_csServerPort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -103,9 +103,9 @@ const char * ConfigCustomerServiceServer::getCentralServerAddress()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
unsigned short ConfigCustomerServiceServer::getCentralServerPort()
|
||||
uint16_t ConfigCustomerServiceServer::getCentralServerPort()
|
||||
{
|
||||
return static_cast<unsigned short>(s_centralServerPort);
|
||||
return static_cast<uint16_t>(s_centralServerPort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -131,16 +131,16 @@ int ConfigCustomerServiceServer::getMaxAllowedNumberOfTickets()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
unsigned short ConfigCustomerServiceServer::getGameServicePort()
|
||||
uint16_t ConfigCustomerServiceServer::getGameServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(s_gameServicePort);
|
||||
return static_cast<uint16_t>(s_gameServicePort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
unsigned short ConfigCustomerServiceServer::getChatServicePort()
|
||||
uint16_t ConfigCustomerServiceServer::getChatServicePort()
|
||||
{
|
||||
return static_cast<unsigned short>(s_chatServicePort);
|
||||
return static_cast<uint16_t>(s_chatServicePort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
+4
-4
@@ -14,16 +14,16 @@ public:
|
||||
static void remove();
|
||||
|
||||
static const char * getCustomerServiceServerAddress();
|
||||
static unsigned short getCustomerServiceServerPort();
|
||||
static uint16_t getCustomerServiceServerPort();
|
||||
static const char * getCentralServerAddress();
|
||||
static unsigned short getCentralServerPort();
|
||||
static uint16_t getCentralServerPort();
|
||||
static const char * getClusterName();
|
||||
static const char * getGameCode();
|
||||
static int getMaxPacketsPerSecond();
|
||||
static unsigned int getRequestTimeoutSeconds();
|
||||
static int getMaxAllowedNumberOfTickets();
|
||||
static unsigned short getGameServicePort();
|
||||
static unsigned short getChatServicePort();
|
||||
static uint16_t getGameServicePort();
|
||||
static uint16_t getChatServicePort();
|
||||
static const char* getChatServiceBindInterface();
|
||||
static const char* getGameServiceBindInterface();
|
||||
static bool getWriteTicketToBugLog();
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
ConnectionServerConnection::ConnectionServerConnection(const std::string & a, const unsigned short p) :
|
||||
ConnectionServerConnection::ConnectionServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
LOG("ConnectionServerConnection", ("Connection created...listening on (%s:%d)", a.c_str(), static_cast<int>(p)));
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ class GameNetworkMessage;
|
||||
class ConnectionServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
ConnectionServerConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
ConnectionServerConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
~ConnectionServerConnection();
|
||||
|
||||
void onConnectionClosed ();
|
||||
|
||||
@@ -283,7 +283,7 @@ void LoggingServerApi::PacketSend(LogicalPacket *lp)
|
||||
}
|
||||
}
|
||||
|
||||
void LoggingServerApi::Log16(const char *filename, int typeCode, const unsigned short *ucs2String)
|
||||
void LoggingServerApi::Log16(const char *filename, int typeCode, const uint16_t *ucs2String)
|
||||
{
|
||||
char buffer[32768];
|
||||
char * const ptr_end_buffer = &buffer[sizeof(buffer)];
|
||||
@@ -293,7 +293,7 @@ void LoggingServerApi::Log16(const char *filename, int typeCode, const unsigned
|
||||
strcpy(ptr, filename);
|
||||
ptr += strlen(ptr) + 1;
|
||||
|
||||
const unsigned short *rawPtr = ucs2String;
|
||||
const uint16_t *rawPtr = ucs2String;
|
||||
char *startPtr = ptr;
|
||||
for (;;)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ class LoggingServerApi : public UdpConnectionHandler
|
||||
|
||||
Status GetStatus() const;
|
||||
void GiveTime();
|
||||
void Log16(const char *filename, int typeCode, const unsigned short *ucs2String); // no formatting support, application will have to do that on it's own
|
||||
void Log16(const char *filename, int typeCode, const uint16_t *ucs2String); // no formatting support, application will have to do that on it's own
|
||||
void Log(const char *filename, int typeCode, const char *message, ...); // printf style formatting
|
||||
|
||||
void StartTransaction();
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
LoginConnection::LoginConnection(const std::string & a, const unsigned short p) :
|
||||
LoginConnection::LoginConnection(const std::string & a, const uint16_t p) :
|
||||
Connection(a, p, NetworkSetupData())
|
||||
{
|
||||
REPORT_LOG(true, ("Waiting for loginserver connection %s:%d\n", a.c_str(), p));
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class LoginConnection : public Connection
|
||||
{
|
||||
public:
|
||||
LoginConnection(const std::string & remoteAddress, const unsigned short port);
|
||||
LoginConnection(const std::string & remoteAddress, const uint16_t port);
|
||||
~LoginConnection();
|
||||
|
||||
virtual void onConnectionClosed ();
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
|
||||
CSToolConnection(
|
||||
const std::string & address,
|
||||
const unsigned short port);
|
||||
const uint16_t port);
|
||||
|
||||
virtual ~CSToolConnection();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ CentralServerConnection::CentralServerConnection(UdpConnectionMT * u, TcpClient
|
||||
|
||||
CentralServerConnection::CentralServerConnection(
|
||||
const std::string & address,
|
||||
const unsigned short port,
|
||||
const uint16_t port,
|
||||
const std::string &clusterName,
|
||||
const uint32 clusterId) :
|
||||
ServerConnection(address,port, NetworkSetupData()),
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
CentralServerConnection(
|
||||
const std::string & address,
|
||||
const unsigned short port,
|
||||
const uint16_t port,
|
||||
const std::string &clusterName,
|
||||
const uint32 clusterId);
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TaskConnection::TaskConnection(const std::string & a, const unsigned short p) :
|
||||
TaskConnection::TaskConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class TaskCommandChannel;
|
||||
class TaskConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
TaskConnection(const std::string & remoteAddress, const unsigned short remotePort);
|
||||
TaskConnection(const std::string & remoteAddress, const uint16_t remotePort);
|
||||
TaskConnection(UdpConnectionMT * u, TcpClient *);
|
||||
~TaskConnection();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
CentralServerConnection::CentralServerConnection(const std::string & a, const unsigned short p) :
|
||||
CentralServerConnection::CentralServerConnection(const std::string & a, const uint16_t p) :
|
||||
ServerConnection(a, p, NetworkSetupData())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
class CentralServerConnection : public ServerConnection
|
||||
{
|
||||
public:
|
||||
CentralServerConnection (const std::string & remoteAddress, const unsigned short port);
|
||||
CentralServerConnection (const std::string & remoteAddress, const uint16_t port);
|
||||
~CentralServerConnection ();
|
||||
|
||||
void onConnectionClosed ();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user