moved string functions from MiscFunctions to StringUtil

This commit is contained in:
Arthur Ice 2013-05-11 00:05:11 -07:00
parent babd3949f6
commit 373ff66240
80 changed files with 381 additions and 323 deletions

View File

@ -55,6 +55,7 @@ SET(common_sources
serverinfo.cpp
shareddb.cpp
spdat.cpp
StringUtil.cpp
StructStrategy.cpp
TCPConnection.cpp
TCPServer.cpp
@ -170,6 +171,7 @@ SET(common_headers
shareddb.h
skills.h
spdat.h
StringUtil.h
StructStrategy.h
TCPBasicServer.h
TCPConnection.h

View File

@ -89,201 +89,7 @@ void CoutTimestamp(bool ms) {
cout << " GMT";
}
// normal strncpy doesnt put a null term on copied strings, this one does
// ref: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecrt/htm/_wcecrt_strncpy_wcsncpy.asp
char* strn0cpy(char* dest, const char* source, uint32 size) {
if (!dest)
return 0;
if (size == 0 || source == 0) {
dest[0] = 0;
return dest;
}
strncpy(dest, source, size);
dest[size - 1] = 0;
return dest;
}
// String N w/null Copy Truncated?
// return value =true if entire string(source) fit, false if it was truncated
bool strn0cpyt(char* dest, const char* source, uint32 size) {
if (!dest)
return 0;
if (size == 0 || source == 0) {
dest[0] = 0;
return false;
}
strncpy(dest, source, size);
dest[size - 1] = 0;
return (bool) (source[strlen(dest)] == 0);
}
const char *MakeUpperString(const char *source) {
static char str[128];
if (!source)
return nullptr;
MakeUpperString(source, str);
return str;
}
void MakeUpperString(const char *source, char *target) {
if (!source || !target) {
*target=0;
return;
}
while (*source)
{
*target = toupper(*source);
target++;source++;
}
*target = 0;
}
const char *MakeLowerString(const char *source) {
static char str[128];
if (!source)
return nullptr;
MakeLowerString(source, str);
return str;
}
void MakeLowerString(const char *source, char *target) {
if (!source || !target) {
*target=0;
return;
}
while (*source)
{
*target = tolower(*source);
target++;source++;
}
*target = 0;
}
int MakeAnyLenString(char** ret, const char* format, ...) {
int buf_len = 128;
int chars = -1;
va_list argptr, tmpargptr;
va_start(argptr, format);
while (chars == -1 || chars >= buf_len) {
safe_delete_array(*ret);
if (chars == -1)
buf_len *= 2;
else
buf_len = chars + 1;
*ret = new char[buf_len];
va_copy(tmpargptr, argptr);
chars = vsnprintf(*ret, buf_len, format, tmpargptr);
}
va_end(argptr);
return chars;
}
uint32 AppendAnyLenString(char** ret, uint32* bufsize, uint32* strlen, const char* format, ...) {
if (*bufsize == 0)
*bufsize = 256;
if (*ret == 0)
*strlen = 0;
int chars = -1;
char* oldret = 0;
va_list argptr, tmpargptr;
va_start(argptr, format);
while (chars == -1 || chars >= (int32)(*bufsize-*strlen)) {
if (chars == -1)
*bufsize += 256;
else
*bufsize += chars + 25;
oldret = *ret;
*ret = new char[*bufsize];
if (oldret) {
if (*strlen)
memcpy(*ret, oldret, *strlen);
safe_delete_array(oldret);
}
va_copy(tmpargptr, argptr);
chars = vsnprintf(&(*ret)[*strlen], (*bufsize-*strlen), format, tmpargptr);
}
va_end(argptr);
*strlen += chars;
return *strlen;
}
uint32 hextoi(char* num) {
int len = strlen(num);
if (len < 3)
return 0;
if (num[0] != '0' || (num[1] != 'x' && num[1] != 'X'))
return 0;
uint32 ret = 0;
int mul = 1;
for (int i=len-1; i>=2; i--) {
if (num[i] >= 'A' && num[i] <= 'F')
ret += ((num[i] - 'A') + 10) * mul;
else if (num[i] >= 'a' && num[i] <= 'f')
ret += ((num[i] - 'a') + 10) * mul;
else if (num[i] >= '0' && num[i] <= '9')
ret += (num[i] - '0') * mul;
else
return 0;
mul *= 16;
}
return ret;
}
uint64 hextoi64(char* num) {
int len = strlen(num);
if (len < 3)
return 0;
if (num[0] != '0' || (num[1] != 'x' && num[1] != 'X'))
return 0;
uint64 ret = 0;
int mul = 1;
for (int i=len-1; i>=2; i--) {
if (num[i] >= 'A' && num[i] <= 'F')
ret += ((num[i] - 'A') + 10) * mul;
else if (num[i] >= 'a' && num[i] <= 'f')
ret += ((num[i] - 'a') + 10) * mul;
else if (num[i] >= '0' && num[i] <= '9')
ret += (num[i] - '0') * mul;
else
return 0;
mul *= 16;
}
return ret;
}
bool atobool(char* iBool) {
if (!strcasecmp(iBool, "true"))
return true;
if (!strcasecmp(iBool, "false"))
return false;
if (!strcasecmp(iBool, "yes"))
return true;
if (!strcasecmp(iBool, "no"))
return false;
if (!strcasecmp(iBool, "on"))
return true;
if (!strcasecmp(iBool, "off"))
return false;
if (!strcasecmp(iBool, "enable"))
return true;
if (!strcasecmp(iBool, "disable"))
return false;
if (!strcasecmp(iBool, "enabled"))
return true;
if (!strcasecmp(iBool, "disabled"))
return false;
if (!strcasecmp(iBool, "y"))
return true;
if (!strcasecmp(iBool, "n"))
return false;
if (atoi(iBool))
return true;
return false;
}
int32 filesize(FILE* fp) {
#ifdef _WINDOWS
@ -546,28 +352,6 @@ static unsigned int case_6 (void){
// end WELL RNG code
// solar: removes the crap and turns the underscores into spaces.
char *CleanMobName(const char *in, char *out)
{
unsigned i, j;
for(i = j = 0; i < strlen(in); i++)
{
// convert _ to space.. any other conversions like this? I *think* this
// is the only non alpha char that's not stripped but converted.
if(in[i] == '_')
{
out[j++] = ' ';
}
else
{
if(isalpha(in[i]) || (in[i] == '`')) // numbers, #, or any other crap just gets skipped
out[j++] = in[i];
}
}
out[j] = 0; // terimnate the string before returning it
return out;
}
const char *ConvertArray(int input, char *returnchar)
{
@ -625,23 +409,3 @@ float EQHtoFloat(int d)
return(360.0f - float((d * 360) >> 11));
}
void RemoveApostrophes(std::string &s)
{
for(unsigned int i = 0; i < s.length(); ++i)
if(s[i] == '\'')
s[i] = '_';
}
char *RemoveApostrophes(const char *s)
{
char *NewString = new char[strlen(s) + 1];
strcpy(NewString, s);
for(unsigned int i = 0 ; i < strlen(NewString); ++i)
if(NewString[i] == '\'')
NewString[i] = '_';
return NewString;
}

View File

@ -86,37 +86,16 @@
#define BITMASK 0x41180000
//////////////////////////////////////////////////////////////////////
//
// MakeUpperString
// i : source - allocated null-terminated string
// return: pointer to static buffer with the target string
const char *MakeUpperString(const char *source);
const char *MakeLowerString(const char *source);
//////////////////////////////////////////////////////////////////////
//
// MakeUpperString
// i : source - allocated null-terminated string
// io: target - allocated buffer, at least of size strlen(source)+1
void MakeUpperString(const char *source, char *target);
void MakeLowerString(const char *source, char *target);
int MakeAnyLenString(char** ret, const char* format, ...);
uint32 AppendAnyLenString(char** ret, uint32* bufsize, uint32* strlen, const char* format, ...);
uint32 hextoi(char* num);
uint64 hextoi64(char* num);
bool atobool(char* iBool);
int32 filesize(FILE* fp);
uint32 ResolveIP(const char* hostname, char* errbuf = 0);
bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf = 0);
void CoutTimestamp(bool ms = true);
char* strn0cpy(char* dest, const char* source, uint32 size);
// return value =true if entire string(source) fit, false if it was truncated
bool strn0cpyt(char* dest, const char* source, uint32 size);
int MakeRandomInt(int low, int high);
double MakeRandomFloat(double low, double high);
char *CleanMobName(const char *in, char *out);
const char *ConvertArray(int input, char *returnchar);
const char *ConvertArrayF(float input, char *returnchar);
float EQ13toFloat(int d);
@ -127,8 +106,7 @@ int FloatToEQ13(float d);
int NewFloatToEQ13(float d);
int FloatToEQ19(float d);
int FloatToEQH(float d);
void RemoveApostrophes(std::string &s);
char *RemoveApostrophes(const char *s);

View File

@ -16,6 +16,7 @@
#include "StringUtil.h"
#include <string>
#include <cstring> // for strncpy
#include <cstdarg>
#include <stdexcept>
@ -79,3 +80,243 @@ void StringFormat(std::string& output, const char* format, ...)
output.resize(write_point + bytes_used);
}
}
// normal strncpy doesnt put a null term on copied strings, this one does
// ref: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecrt/htm/_wcecrt_strncpy_wcsncpy.asp
char* strn0cpy(char* dest, const char* source, uint32 size) {
if (!dest)
return 0;
if (size == 0 || source == 0) {
dest[0] = 0;
return dest;
}
strncpy(dest, source, size);
dest[size - 1] = 0;
return dest;
}
// String N w/null Copy Truncated?
// return value =true if entire string(source) fit, false if it was truncated
bool strn0cpyt(char* dest, const char* source, uint32 size) {
if (!dest)
return 0;
if (size == 0 || source == 0) {
dest[0] = 0;
return false;
}
strncpy(dest, source, size);
dest[size - 1] = 0;
return (bool) (source[strlen(dest)] == 0);
}
const char *MakeUpperString(const char *source) {
static char str[128];
if (!source)
return nullptr;
MakeUpperString(source, str);
return str;
}
void MakeUpperString(const char *source, char *target) {
if (!source || !target) {
*target=0;
return;
}
while (*source)
{
*target = toupper(*source);
target++;source++;
}
*target = 0;
}
const char *MakeLowerString(const char *source) {
static char str[128];
if (!source)
return nullptr;
MakeLowerString(source, str);
return str;
}
void MakeLowerString(const char *source, char *target) {
if (!source || !target) {
*target=0;
return;
}
while (*source)
{
*target = tolower(*source);
target++;source++;
}
*target = 0;
}
int MakeAnyLenString(char** ret, const char* format, ...) {
int buf_len = 128;
int chars = -1;
va_list argptr, tmpargptr;
va_start(argptr, format);
while (chars == -1 || chars >= buf_len) {
safe_delete_array(*ret);
if (chars == -1)
buf_len *= 2;
else
buf_len = chars + 1;
*ret = new char[buf_len];
va_copy(tmpargptr, argptr);
chars = vsnprintf(*ret, buf_len, format, tmpargptr);
}
va_end(argptr);
return chars;
}
uint32 AppendAnyLenString(char** ret, uint32* bufsize, uint32* strlen, const char* format, ...) {
if (*bufsize == 0)
*bufsize = 256;
if (*ret == 0)
*strlen = 0;
int chars = -1;
char* oldret = 0;
va_list argptr, tmpargptr;
va_start(argptr, format);
while (chars == -1 || chars >= (int32)(*bufsize-*strlen)) {
if (chars == -1)
*bufsize += 256;
else
*bufsize += chars + 25;
oldret = *ret;
*ret = new char[*bufsize];
if (oldret) {
if (*strlen)
memcpy(*ret, oldret, *strlen);
safe_delete_array(oldret);
}
va_copy(tmpargptr, argptr);
chars = vsnprintf(&(*ret)[*strlen], (*bufsize-*strlen), format, tmpargptr);
}
va_end(argptr);
*strlen += chars;
return *strlen;
}
uint32 hextoi(char* num) {
int len = strlen(num);
if (len < 3)
return 0;
if (num[0] != '0' || (num[1] != 'x' && num[1] != 'X'))
return 0;
uint32 ret = 0;
int mul = 1;
for (int i=len-1; i>=2; i--) {
if (num[i] >= 'A' && num[i] <= 'F')
ret += ((num[i] - 'A') + 10) * mul;
else if (num[i] >= 'a' && num[i] <= 'f')
ret += ((num[i] - 'a') + 10) * mul;
else if (num[i] >= '0' && num[i] <= '9')
ret += (num[i] - '0') * mul;
else
return 0;
mul *= 16;
}
return ret;
}
uint64 hextoi64(char* num) {
int len = strlen(num);
if (len < 3)
return 0;
if (num[0] != '0' || (num[1] != 'x' && num[1] != 'X'))
return 0;
uint64 ret = 0;
int mul = 1;
for (int i=len-1; i>=2; i--) {
if (num[i] >= 'A' && num[i] <= 'F')
ret += ((num[i] - 'A') + 10) * mul;
else if (num[i] >= 'a' && num[i] <= 'f')
ret += ((num[i] - 'a') + 10) * mul;
else if (num[i] >= '0' && num[i] <= '9')
ret += (num[i] - '0') * mul;
else
return 0;
mul *= 16;
}
return ret;
}
bool atobool(char* iBool) {
if (!strcasecmp(iBool, "true"))
return true;
if (!strcasecmp(iBool, "false"))
return false;
if (!strcasecmp(iBool, "yes"))
return true;
if (!strcasecmp(iBool, "no"))
return false;
if (!strcasecmp(iBool, "on"))
return true;
if (!strcasecmp(iBool, "off"))
return false;
if (!strcasecmp(iBool, "enable"))
return true;
if (!strcasecmp(iBool, "disable"))
return false;
if (!strcasecmp(iBool, "enabled"))
return true;
if (!strcasecmp(iBool, "disabled"))
return false;
if (!strcasecmp(iBool, "y"))
return true;
if (!strcasecmp(iBool, "n"))
return false;
if (atoi(iBool))
return true;
return false;
}
// solar: removes the crap and turns the underscores into spaces.
char *CleanMobName(const char *in, char *out)
{
unsigned i, j;
for(i = j = 0; i < strlen(in); i++)
{
// convert _ to space.. any other conversions like this? I *think* this
// is the only non alpha char that's not stripped but converted.
if(in[i] == '_')
{
out[j++] = ' ';
}
else
{
if(isalpha(in[i]) || (in[i] == '`')) // numbers, #, or any other crap just gets skipped
out[j++] = in[i];
}
}
out[j] = 0; // terimnate the string before returning it
return out;
}
void RemoveApostrophes(std::string &s)
{
for(unsigned int i = 0; i < s.length(); ++i)
if(s[i] == '\'')
s[i] = '_';
}
char *RemoveApostrophes(const char *s)
{
char *NewString = new char[strlen(s) + 1];
strcpy(NewString, s);
for(unsigned int i = 0 ; i < strlen(NewString); ++i)
if(NewString[i] == '\'')
NewString[i] = '_';
return NewString;
}

View File

@ -17,7 +17,39 @@
#define _STRINGUTIL_H_
#include <string>
#include "types.h"
void StringFormat(std::string& output, const char* format, ...);
//////////////////////////////////////////////////////////////////////
//
// MakeUpperString
// i : source - allocated null-terminated string
// return: pointer to static buffer with the target string
const char *MakeUpperString(const char *source);
const char *MakeLowerString(const char *source);
//////////////////////////////////////////////////////////////////////
//
// MakeUpperString
// i : source - allocated null-terminated string
// io: target - allocated buffer, at least of size strlen(source)+1
void MakeUpperString(const char *source, char *target);
void MakeLowerString(const char *source, char *target);
int MakeAnyLenString(char** ret, const char* format, ...);
uint32 AppendAnyLenString(char** ret, uint32* bufsize, uint32* strlen, const char* format, ...);
uint32 hextoi(char* num);
uint64 hextoi64(char* num);
bool atobool(char* iBool);
char* strn0cpy(char* dest, const char* source, uint32 size);
// return value =true if entire string(source) fit, false if it was truncated
bool strn0cpyt(char* dest, const char* source, uint32 size);
char *CleanMobName(const char *in, char *out);
void RemoveApostrophes(std::string &s);
char *RemoveApostrophes(const char *s);
#endif

View File

@ -44,7 +44,8 @@ using namespace std;
#include "database.h"
#include "eq_packet_structs.h"
#include "guilds.h"
#include "MiscFunctions.h"
//#include "MiscFunctions.h"
#include "StringUtil.h"
#include "extprofile.h"
extern Client client;

View File

@ -14,7 +14,8 @@ using namespace std;
#include "dbcore.h"
#include "common_profile.h"
#include <string.h>
#include "../common/MiscFunctions.h"
//#include "../common/MiscFunctions.h"
#include "StringUtil.h"
#define ASYNC_LOOP_GRANULARITY 4 //# of ms between checking our work
bool DBAsyncCB_LoadVariables(DBAsyncWork* iWork) {

View File

@ -16,6 +16,8 @@
#include <unistd.h>
#include <stdarg.h>
#endif
#include "../common/StringUtil.h"
#include "../common/MiscFunctions.h"
#include "../common/platform.h"
@ -155,39 +157,49 @@ bool EQEMuLog::write(LogIDs id, const char *fmt, ...) {
va_list argptr, tmpargptr;
va_start(argptr, fmt);
if (dofile) {
va_copy(tmpargptr, argptr);
vfprintf( fp[id], fmt, tmpargptr );
}
if(logCallbackFmt[id]) {
msgCallbackFmt p = logCallbackFmt[id];
va_copy(tmpargptr, argptr);
p(id, fmt, tmpargptr );
}
std::string outputMessage;
StringFormat(outputMessage, fmt, argptr);
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8) {
fprintf(stderr, "[%s] ", LogNames[id]);
vfprintf( stderr, fmt, argptr );
std::cerr << "[" << LogNames[id] << "] ";
std::cerr << outputMessage;
}
else {
fprintf(stdout, "[%s] ", LogNames[id]);
vfprintf( stdout, fmt, argptr );
std::cout << "[" << LogNames[id] << "] ";
std::cout << outputMessage;
}
}
va_end(argptr);
if (dofile)
fprintf(fp[id], "\n");
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8) {
fprintf(stderr, "\n");
fflush(stderr);
std::cerr << std::endl;
} else {
fprintf(stdout, "\n");
fflush(stdout);
std::cout << std::endl;
}
}
if(dofile)
fflush(fp[id]);
return true;
}

View File

@ -20,7 +20,8 @@
#include "guild_base.h"
#include "database.h"
#include "logsys.h"
#include "MiscFunctions.h"
//#include "MiscFunctions.h"
#include "StringUtil.h"
#include <cstdlib>
#include <cstring>

View File

@ -9,7 +9,7 @@
*/
#include <string.h> /* for memcpy() */
#include "../common/md5.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/seperator.h"
MD5::MD5() {

View File

@ -8,6 +8,7 @@
#include "../eq_packet_structs.h"
#include "../MiscFunctions.h"
#include "../StringUtil.h"
#include "../Item.h"
#include "../clientversions.h"
#include "Client62_structs.h"

View File

@ -8,6 +8,7 @@
#include "../eq_packet_structs.h"
#include "../MiscFunctions.h"
#include "../StringUtil.h"
#include "../Item.h"
#include "RoF_structs.h"
#include "../rulesys.h"

View File

@ -8,6 +8,7 @@
#include "../eq_packet_structs.h"
#include "../MiscFunctions.h"
#include "../StringUtil.h"
#include "../Item.h"
#include "SoD_structs.h"
#include "../rulesys.h"

View File

@ -7,7 +7,7 @@
#include "../crc32.h"
#include "../eq_packet_structs.h"
#include "../MiscFunctions.h"
#include "../StringUtil.h"
#include "../Item.h"
#include "SoF_structs.h"
#include "../rulesys.h"

View File

@ -8,7 +8,7 @@
#include "../races.h"
#include "../eq_packet_structs.h"
#include "../MiscFunctions.h"
#include "../StringUtil.h"
#include "../Item.h"
#include "Titanium_structs.h"
#include <sstream>

View File

@ -8,6 +8,7 @@
#include "../eq_packet_structs.h"
#include "../MiscFunctions.h"
#include "../StringUtil.h"
#include "../Item.h"
#include "Underfoot_structs.h"
#include "../rulesys.h"

View File

@ -20,7 +20,7 @@
#include "timer.h"
#include "ptimer.h"
#include "database.h"
#include "MiscFunctions.h"
#include "StringUtil.h"
#include <stdio.h>
#include <cstdlib>
#include <cstring>

View File

@ -19,7 +19,7 @@
#include "rulesys.h"
#include "logsys.h"
#include "database.h"
#include "MiscFunctions.h"
#include "StringUtil.h"
#include <cstdlib>
#include <cstring>

View File

@ -7,7 +7,7 @@
#include "classes.h"
#include "rulesys.h"
#include "seperator.h"
#include "MiscFunctions.h"
#include "StringUtil.h"
#include "eq_packet_structs.h"
#include "guilds.h"
#include "extprofile.h"

View File

@ -20,6 +20,7 @@
#include "../common/servertalk.h"
#include "ZoneLaunch.h"
#include "../common/EQEmuConfig.h"
#include "../common/StringUtil.h"
WorldServer::WorldServer(map<string, ZoneLaunch *> &zones, const char *name, const EQEmuConfig *config)

View File

@ -46,7 +46,7 @@ using namespace std;
#include "database.h"
#include "../common/eq_packet_structs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/servertalk.h"
Database::Database ()

View File

@ -2,7 +2,7 @@
#include "lfguild.h"
#include "database.h"
#include "worldserver.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/packet_dump.h"
#include "../common/rulesys.h"

View File

@ -22,7 +22,7 @@
#include "chatchannel.h"
#include "clientlist.h"
#include "database.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include <cstdlib>
extern Database database;

View File

@ -20,7 +20,7 @@
*/
#include "../common/debug.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "clientlist.h"
#include "database.h"

View File

@ -47,6 +47,7 @@ using namespace std;
#include "database.h"
#include "../common/eq_packet_structs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "chatchannel.h"
extern Clientlist *CL;

View File

@ -3,6 +3,7 @@
#include "../common/extprofile.h"
#include "../common/rulesys.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "Adventure.h"
#include "AdventureManager.h"
#include "worlddb.h"
@ -435,4 +436,4 @@ void Adventure::MoveCorpsesToGraveyard()
iter++;
c_iter++;
}
}
}

View File

@ -1,5 +1,6 @@
#include "../common/debug.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/servertalk.h"
#include "../common/rulesys.h"
#include "Adventure.h"

View File

@ -20,7 +20,7 @@
#include "worlddb.h"
#include "LauncherLink.h"
#include "LauncherList.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include <cstdlib>
#include <cstring>

View File

@ -25,7 +25,7 @@
#include "../common/races.h"
#include "../common/classes.h"
#include "../common/misc.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "zoneserver.h"
#include "zonelist.h"
#include "clientlist.h"

View File

@ -25,6 +25,7 @@
#include "../common/packet_dump.h"
#include "../common/servertalk.h"
#include "../common/EmuTCPConnection.h"
#include "../common/StringUtil.h"
#include "worlddb.h"
#include "EQLConfig.h"

View File

@ -58,7 +58,7 @@ using namespace std;
#include "LoginServerList.h"
#include "../common/eq_packet_structs.h"
#include "../common/packet_dump.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "zoneserver.h"
#include "worlddb.h"
#include "zonelist.h"

View File

@ -45,7 +45,7 @@ using namespace std;
#include "../common/languages.h"
#include "../common/skills.h"
#include "../common/extprofile.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "WorldConfig.h"
#include "LoginServer.h"
#include "LoginServerList.h"

View File

@ -24,6 +24,7 @@
#include "zoneserver.h"
#include "WorldConfig.h"
#include "../common/guilds.h"
#include "../common/StringUtil.h"
extern uint32 numplayers;
extern LoginServerList loginserverlist;

View File

@ -22,6 +22,7 @@
#include "client.h"
#include "console.h"
#include "worlddb.h"
#include "../common/StringUtil.h"
#include "../common/guilds.h"
#include "../common/races.h"
#include "../common/classes.h"

View File

@ -39,6 +39,7 @@ using namespace std;
#include "../common/opcodemgr.h"
#include "../common/rulesys.h"
#include "../common/ruletypes.h"
#include "../common/StringUtil.h"
#include "WorldConfig.h"
#include "zoneserver.h"
#include "zonelist.h"

View File

@ -18,7 +18,7 @@
#include "worlddb.h"
//#include "../common/Item.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/eq_packet_structs.h"
#include "../common/Item.h"
#include "../common/dbasync.h"

View File

@ -23,7 +23,7 @@
#include "console.h"
#include "WorldConfig.h"
#include "../common/servertalk.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
extern uint32 numzones;
extern bool holdzones;

View File

@ -29,7 +29,7 @@
#include "../common/guilds.h"
#include "../common/packet_dump.h"
#include "../common/misc.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "cliententry.h"
#include "wguild_mgr.h"
#include "lfplist.h"

View File

@ -34,7 +34,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
#include "../common/classes.h"
#include "../common/eq_packet_structs.h"
#include "../common/packet_dump.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/logsys.h"
#include "zonedb.h"
#include "StringIDs.h"

View File

@ -30,7 +30,7 @@ using namespace std;
#include "../common/moremath.h"
#include "parser.h"
#include "StringIDs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "../common/features.h"
#include "QuestParserCollection.h"

View File

@ -24,7 +24,7 @@
#include "zonedb.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/features.h"
#include "StringIDs.h"
using namespace std;

View File

@ -35,6 +35,7 @@ using namespace std;
#include "masterentity.h"
#include "../common/packet_functions.h"
#include "../common/StringUtil.h"
#include "../common/crc32.h"
#include "StringIDs.h"
#include "worldserver.h"

View File

@ -1,5 +1,5 @@
#include "../common/debug.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "QGlobals.h"
#include "zonedb.h"

View File

@ -38,7 +38,7 @@ using namespace std;
#include "../common/spdat.h"
#include "zone.h"
#include "StringIDs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "QuestParserCollection.h"
#include "watermap.h"

View File

@ -4,6 +4,7 @@
#include "object.h"
#include "doors.h"
#include "QuestParserCollection.h"
#include "../common/StringUtil.h"
extern volatile bool ZoneLoaded;

View File

@ -1,6 +1,7 @@
#ifdef BOTS
#include "bot.h"
#include "../common/StringUtil.h"
bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
_ZP(Bot_AICastSpell);

View File

@ -58,7 +58,7 @@ extern volatile bool RunLoops;
#include "../common/guilds.h"
#include "../common/breakdowns.h"
#include "../common/rulesys.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "forage.h"
#include "command.h"
#include "StringIDs.h"

View File

@ -45,7 +45,7 @@
#include "worldserver.h"
#include "../common/rdtsc.h"
#include "../common/packet_dump_file.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/breakdowns.h"
#include "../common/guilds.h"
#include "../common/rulesys.h"

View File

@ -47,7 +47,7 @@
#include "../common/packet_dump.h"
#include "worldserver.h"
#include "../common/packet_dump_file.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/spdat.h"
#include "petitions.h"
#include "NpcAI.h"

View File

@ -50,7 +50,7 @@
#include "../common/EQPacket.h"
#include "../common/guilds.h"
#include "../common/rulesys.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
//#include "../common/servertalk.h" // for oocmute and revoke
#include "worldserver.h"
#include "masterentity.h"

View File

@ -26,7 +26,7 @@ using namespace std;
#include "zonedb.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "guild_mgr.h"
#define OPEN_DOOR 0x02

View File

@ -30,7 +30,7 @@
#include "questmgr.h"
#include "command.h"
#include "../common/seperator.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "QGlobals.h"
#include "zone.h"

View File

@ -32,7 +32,7 @@ using namespace std;
#include "watermap.h"
#include "titles.h"
#include "StringIDs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "zonedb.h"

View File

@ -20,7 +20,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "NpcAI.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "worldserver.h"
extern EntityList entity_list;
extern WorldServer worldserver;

View File

@ -28,7 +28,7 @@
#include "../common/ZoneNumbers.h"
#include "../common/moremath.h"
#include "../common/guilds.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "guild_mgr.h"
#include "StringIDs.h"
#include "NpcAI.h"

View File

@ -20,6 +20,7 @@
#include "zonedb.h"
#include "worldserver.h"
#include "../common/servertalk.h"
#include "../common/StringUtil.h"
#include "client.h"
#include "entity.h"

View File

@ -22,7 +22,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "masterentity.h"
#include "../common/Item.h"
#include "../common/linked_list.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include <math.h>
#include <assert.h>
#include "worldserver.h"

View File

@ -29,6 +29,7 @@
#include "../common/moremath.h"
#include "../common/guilds.h"
#include "../common/logsys.h"
#include "../common/StringUtil.h"
#include "StringIDs.h"
#include "NpcAI.h"
extern WorldServer worldserver;

View File

@ -8,7 +8,7 @@
#include "../common/spdat.h"
#include "zone.h"
#include "StringIDs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "QuestParserCollection.h"
#include "watermap.h"

View File

@ -21,6 +21,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "StringIDs.h"
#include "worldserver.h"
#include "QuestParserCollection.h"
#include "../common/StringUtil.h"
#include <sstream>
#include <math.h>

View File

@ -41,7 +41,7 @@ using namespace std;
#include "../common/spdat.h"
#include "../common/bodytypes.h"
#include "spawngroup.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "StringIDs.h"

View File

@ -24,6 +24,7 @@ using namespace std;
#include "zonedb.h"
#include "../common/spdat.h"
#include "../common/packet_functions.h"
#include "../common/StringUtil.h"
#include "spawn2.h"
#include "zone.h"
#include "event_codes.h"

View File

@ -32,6 +32,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
#include "../common/StringUtil.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/packet_dump_file.h"

View File

@ -26,7 +26,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemu.org)
#include "../common/skills.h"
#include "../common/bodytypes.h"
#include "../common/classes.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "pets.h"
#include <math.h>
#include <assert.h>

View File

@ -68,7 +68,7 @@ using namespace std;
#include "zonedb.h"
#include "../common/spdat.h"
#include "../common/packet_functions.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "spawn2.h"
#include "zone.h"
#include "parser.h"

View File

@ -20,7 +20,7 @@
#include "NpcAI.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "worldserver.h"
extern EntityList entity_list;
extern WorldServer worldserver;

View File

@ -16,6 +16,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/StringUtil.h"
#include <stdlib.h>
#include "spawn2.h"
#include "entity.h"

View File

@ -25,6 +25,7 @@ using namespace std;
#include "../common/types.h"
#include "zonedb.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
extern EntityList entity_list;

View File

@ -83,13 +83,15 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/bodytypes.h"
#include "../common/classes.h"
#include "../common/rulesys.h"
#include "../common/StringUtil.h"
#include <math.h>
#include <assert.h>
#ifndef WIN32
// #include <pthread.h>
#include <stdlib.h>
#include "../common/unix.h"
#include <stdlib.h>
#include "../common/unix.h"
#endif
#ifdef _GOTFRAGS
#include "../common/packet_dump_file.h"
#endif

View File

@ -27,7 +27,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net)
#define strcasecmp _stricmp
#endif
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "masterentity.h"
#include "../common/features.h"

View File

@ -19,7 +19,7 @@
#include "../common/eq_packet_structs.h"
#include "masterentity.h"
#include "titles.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "worldserver.h"
extern WorldServer worldserver;

View File

@ -30,7 +30,7 @@
#include "../common/packet_dump.h"
#include "titles.h"
#include "StringIDs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "QuestParserCollection.h"

View File

@ -18,7 +18,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/debug.h"
#include "masterentity.h"
#include "StringIDs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "QuestParserCollection.h"
#include "worldserver.h"

View File

@ -20,7 +20,7 @@
#include "entity.h"
#include "masterentity.h"
#include "../common/spdat.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
/*

View File

@ -23,7 +23,8 @@
#include <float.h>
#include "watermap.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#ifdef _WINDOWS
#define snprintf _snprintf
#endif

View File

@ -31,7 +31,7 @@ using namespace std;
#include "../common/moremath.h"
#include "parser.h"
#include "StringIDs.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/rulesys.h"
#include "../common/features.h"
#include "QuestParserCollection.h"

View File

@ -46,7 +46,7 @@ using namespace std;
#include "../common/packet_dump_file.h"
#include "../common/EQStreamFactory.h"
#include "../common/EQStream.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "ZoneConfig.h"
#include "../common/breakdowns.h"
#include "map.h"

View File

@ -1,7 +1,7 @@
#include "zonedb.h"
#include "../common/Item.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/extprofile.h"
#include "../common/guilds.h"
#include "../common/rulesys.h"

View File

@ -3,7 +3,7 @@
using namespace std;
#include "entity.h"
#include "masterentity.h"
#include "../common/MiscFunctions.h"
#include "../common/StringUtil.h"
#include "../common/breakdowns.h"
#include <stdlib.h>

View File

@ -22,6 +22,7 @@
#include "masterentity.h"
#include "../common/packet_dump.h"
#include "../common/rulesys.h"
#include "../common/StringUtil.h"
#include "StringIDs.h"
#include "QuestParserCollection.h"