Merge pull request #23 from addtheice/master

Fixed missing include that blocked compile on linux.
This commit is contained in:
Alex 2013-03-05 23:05:27 -08:00
commit f7469412f1
11 changed files with 1223 additions and 1222 deletions

View File

@ -20,7 +20,7 @@ public:
EmuTCPConnection *FindConnection(uint32 iID); EmuTCPConnection *FindConnection(uint32 iID);
//exposed for some crap we pull. Do not call from outside this object. //exposed for some crap we pull. Do not call from outside this object.
TCPServer<EmuTCPConnection>::AddConnection; using TCPServer<EmuTCPConnection>::AddConnection;
protected: protected:
virtual void Process(); virtual void Process();

View File

@ -23,6 +23,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h>
#endif #endif
#include "types.h" #include "types.h"
#include "eqemu_exception.h" #include "eqemu_exception.h"

View File

@ -554,7 +554,7 @@ void build_hex_line(const char *buffer, unsigned long length, unsigned long offs
char *ptr=out_buffer; char *ptr=out_buffer;
int i; int i;
char printable[17]; char printable[17];
ptr+=sprintf(ptr,"%0*i:",padding,offset); ptr+=sprintf(ptr,"%0*lu:",padding,offset);
for(i=0;i<16; i++) { for(i=0;i<16; i++) {
if (i==8) { if (i==8) {
strcpy(ptr," -"); strcpy(ptr," -");

View File

@ -347,7 +347,7 @@ bool PTimerList::Load(Database *db) {
//if it expired allready, dont bother. //if it expired allready, dont bother.
cur = new PersistentTimer(_char_id, type, start_time, timer_time, enabled); cur = new PersistentTimer(_char_id, type, start_time, timer_time, enabled);
if(!cur->Expired(false)) if(!cur->Expired(NULL, false))
_list[type] = cur; _list[type] = cur;
else else
delete cur; delete cur;

View File

@ -292,7 +292,7 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) {
{ {
safe_delete_array(query); safe_delete_array(query);
while((row = mysql_fetch_row(result))) { while((row = mysql_fetch_row(result))) {
if(!SetRule(row[0], row[1], false)) if(!SetRule(row[0], row[1],NULL, false))
_log(RULES__ERROR, "Unable to interpret rule record for %s", row[0]); _log(RULES__ERROR, "Unable to interpret rule record for %s", row[0]);
} }
mysql_free_result(result); mysql_free_result(result);

View File

@ -215,7 +215,7 @@ bool QTBuilder::build(const char *shortname) {
AddFace(v1, v2, v3); AddFace(v1, v2, v3);
} }
printf("There are %u vertices and %u faces.\n", _FaceList.size()*3, _FaceList.size()); printf("There are %lu vertices and %lu faces.\n", _FaceList.size()*3, _FaceList.size());
if(fileloader->model_data.plac_count) if(fileloader->model_data.plac_count)
{ {
@ -232,7 +232,7 @@ bool QTBuilder::build(const char *shortname) {
else else
printf("No placeable objects (or perhaps %s_obj.s3d not present).\n", shortname); printf("No placeable objects (or perhaps %s_obj.s3d not present).\n", shortname);
printf("After processing placeable objects, there are %u vertices and %u faces.\n", _FaceList.size()*3, _FaceList.size()); printf("After processing placeable objects, there are %lu vertices and %lu faces.\n", _FaceList.size()*3, _FaceList.size());
unsigned long r; unsigned long r;
@ -1262,7 +1262,7 @@ void QTBuilder::AddPlaceableV4(FileLoader *fileloader, char *ZoneFileName, bool
//return; //return;
printf("EQG V4 Placeable Zone Support\n"); printf("EQG V4 Placeable Zone Support\n");
printf("ObjectGroupCount = %i\n", fileloader->model_data.ObjectGroups.size()); printf("ObjectGroupCount = %lu\n", fileloader->model_data.ObjectGroups.size());
vector<ObjectGroupEntry>::iterator Iterator; vector<ObjectGroupEntry>::iterator Iterator;

View File

@ -88,7 +88,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) {
namebuf, dynamic_count), errbuf)) { namebuf, dynamic_count), errbuf)) {
LogFile->write(EQEMuLog::Error, "Error in CreateLauncher query: %s", errbuf); LogFile->write(EQEMuLog::Error, "Error in CreateLauncher query: %s", errbuf);
safe_delete_array(query); safe_delete_array(query);
return false; return NULL;
} }
safe_delete_array(query); safe_delete_array(query);

View File

@ -3836,7 +3836,7 @@ void Bot::AI_Process() {
if(instweapon) if(instweapon)
weapon = instweapon->GetItem(); weapon = instweapon->GetItem();
int weapontype = NULL; int weapontype = 0; // No weapon type.
bool bIsFist = true; bool bIsFist = true;
if(weapon) { if(weapon) {
@ -17359,8 +17359,8 @@ bool Bot::RemoveHealRotationTarget( int index ) {
} }
void Bot::ClearHealRotationMembers() { void Bot::ClearHealRotationMembers() {
_healRotationMemberPrev = NULL; _healRotationMemberPrev = 0; // No previous member
_healRotationMemberNext = NULL; _healRotationMemberNext = 0; // No next member
} }
void Bot::ClearHealRotationTargets() { void Bot::ClearHealRotationTargets() {

View File

@ -32,7 +32,7 @@ const int MaxSpellTypes = 16;
const int MaxHealRotationMembers = 6; const int MaxHealRotationMembers = 6;
const int MaxHealRotationTargets = 3; const int MaxHealRotationTargets = 3;
typedef enum BotStanceType { enum BotStanceType {
BotStancePassive, BotStancePassive,
BotStanceBalanced, BotStanceBalanced,
BotStanceEfficient, BotStanceEfficient,
@ -42,7 +42,7 @@ typedef enum BotStanceType {
BotStanceBurnAE BotStanceBurnAE
}; };
typedef enum SpellTypeIndex { enum SpellTypeIndex {
SpellType_NukeIndex, SpellType_NukeIndex,
SpellType_HealIndex, SpellType_HealIndex,
SpellType_RootIndex, SpellType_RootIndex,
@ -64,7 +64,7 @@ typedef enum SpellTypeIndex {
class Bot : public NPC { class Bot : public NPC {
public: public:
// Class enums // Class enums
typedef enum BotfocusType { //focus types enum BotfocusType { //focus types
BotfocusSpellHaste = 1, BotfocusSpellHaste = 1,
BotfocusSpellDuration, BotfocusSpellDuration,
BotfocusRange, BotfocusRange,
@ -97,18 +97,18 @@ public:
BotfocusAdditionalHeal, BotfocusAdditionalHeal,
}; };
typedef enum BotTradeType { // types of trades a bot can do enum BotTradeType { // types of trades a bot can do
BotTradeClientNormal, BotTradeClientNormal,
BotTradeClientNoDropNoTrade BotTradeClientNoDropNoTrade
}; };
typedef enum BotRoleType { enum BotRoleType {
BotRoleMainAssist, BotRoleMainAssist,
BotRoleGroupHealer, BotRoleGroupHealer,
BotRoleRaidHealer BotRoleRaidHealer
}; };
typedef enum EqExpansions { enum EqExpansions {
ExpansionNone, ExpansionNone,
ExpansionEQ, ExpansionEQ,
ExpansionRoK, ExpansionRoK,
@ -237,7 +237,7 @@ public:
bool RemoveHealRotationTarget( Mob* target ); bool RemoveHealRotationTarget( Mob* target );
bool RemoveHealRotationTarget( int index); bool RemoveHealRotationTarget( int index);
void NotifyNextHealRotationMember( bool notifyNow = false ); void NotifyNextHealRotationMember( bool notifyNow = false );
void ClearHealRotationLeader() { _healRotationLeader = NULL; } void ClearHealRotationLeader() { _healRotationLeader = 0; }
void ClearHealRotationMembers(); void ClearHealRotationMembers();
void ClearHealRotationTargets(); void ClearHealRotationTargets();
inline virtual int16 GetMaxStat(); inline virtual int16 GetMaxStat();

View File

@ -3850,7 +3850,7 @@ void Client::Handle_OP_LDoNInspect(const EQApplicationPacket *app)
void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Dye(const EQApplicationPacket *app)
{ {
if(app->size!=sizeof(DyeStruct)) if(app->size!=sizeof(DyeStruct))
printf("Wrong size of DyeStruct, Got: %i, Expected: %i\n",app->size,sizeof(DyeStruct)); printf("Wrong size of DyeStruct, Got: %i, Expected: %lu\n",app->size,sizeof(DyeStruct));
else{ else{
DyeStruct* dye = (DyeStruct*)app->pBuffer; DyeStruct* dye = (DyeStruct*)app->pBuffer;
DyeArmor(dye); DyeArmor(dye);
@ -3921,7 +3921,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app)
if (app->size < sizeof(GuildUpdate_PublicNote)) { if (app->size < sizeof(GuildUpdate_PublicNote)) {
// client calls for a motd on login even if they arent in a guild // client calls for a motd on login even if they arent in a guild
printf("Error: app size of %i < size of OP_GuildPublicNote of %i\n",app->size,sizeof(GuildUpdate_PublicNote)); printf("Error: app size of %i < size of OP_GuildPublicNote of %lu\n",app->size,sizeof(GuildUpdate_PublicNote));
return; return;
} }
GuildUpdate_PublicNote* gpn=(GuildUpdate_PublicNote*)app->pBuffer; GuildUpdate_PublicNote* gpn=(GuildUpdate_PublicNote*)app->pBuffer;
@ -3979,7 +3979,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app)
if (app->size != sizeof(GuildMOTD_Struct)) { if (app->size != sizeof(GuildMOTD_Struct)) {
// client calls for a motd on login even if they arent in a guild // client calls for a motd on login even if they arent in a guild
printf("Error: app size of %i != size of GuildMOTD_Struct of %i\n",app->size,sizeof(GuildMOTD_Struct)); printf("Error: app size of %i != size of GuildMOTD_Struct of %lu\n",app->size,sizeof(GuildMOTD_Struct));
return; return;
} }
if(!IsInAGuild()) { if(!IsInAGuild()) {
@ -6876,7 +6876,7 @@ void Client::Handle_OP_DeleteSpell(const EQApplicationPacket *app)
void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app)
{ {
if(app->size!=sizeof(LoadSpellSet_Struct)) { if(app->size!=sizeof(LoadSpellSet_Struct)) {
printf("Wrong size of LoadSpellSet_Struct! Expected: %i, Got: %i\n",sizeof(LoadSpellSet_Struct),app->size); printf("Wrong size of LoadSpellSet_Struct! Expected: %lu, Got: %i\n",sizeof(LoadSpellSet_Struct),app->size);
return; return;
} }
int i; int i;
@ -6891,7 +6891,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app)
void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app)
{ {
if(app->size!=sizeof(PetitionBug_Struct)) if(app->size!=sizeof(PetitionBug_Struct))
printf("Wrong size of BugStruct! Expected: %i, Got: %i\n",sizeof(PetitionBug_Struct),app->size); printf("Wrong size of BugStruct! Expected: %lu, Got: %i\n",sizeof(PetitionBug_Struct),app->size);
else{ else{
Message(0, "Petition Bugs are not supported, please use /bug."); Message(0, "Petition Bugs are not supported, please use /bug.");
} }
@ -6901,7 +6901,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app)
void Client::Handle_OP_Bug(const EQApplicationPacket *app) void Client::Handle_OP_Bug(const EQApplicationPacket *app)
{ {
if(app->size!=sizeof(BugStruct)) if(app->size!=sizeof(BugStruct))
printf("Wrong size of BugStruct got %d expected %d!\n", app->size, sizeof(BugStruct)); printf("Wrong size of BugStruct got %d expected %lu!\n", app->size, sizeof(BugStruct));
else{ else{
BugStruct* bug=(BugStruct*)app->pBuffer; BugStruct* bug=(BugStruct*)app->pBuffer;
database.UpdateBug(bug); database.UpdateBug(bug);
@ -8306,7 +8306,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app)
_pkt(TRIBUTE__IN, app); _pkt(TRIBUTE__IN, app);
if(app->size != sizeof(StartTribute_Struct)) if(app->size != sizeof(StartTribute_Struct))
printf("Error in OP_OpenTributeMaster. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size); printf("Error in OP_OpenTributeMaster. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else { else {
//Opens the tribute master window //Opens the tribute master window
StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer; StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer;
@ -8331,7 +8331,7 @@ void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app)
_pkt(TRIBUTE__IN, app); _pkt(TRIBUTE__IN, app);
if(app->size != sizeof(StartTribute_Struct)) if(app->size != sizeof(StartTribute_Struct))
printf("Error in OP_OpenGuildTributeMaster. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size); printf("Error in OP_OpenGuildTributeMaster. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else { else {
//Opens the guild tribute master window //Opens the guild tribute master window
StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer; StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer;
@ -8357,7 +8357,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app)
//player donates an item... //player donates an item...
if(app->size != sizeof(TributeItem_Struct)) if(app->size != sizeof(TributeItem_Struct))
printf("Error in OP_TributeItem. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size); printf("Error in OP_TributeItem. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else { else {
TributeItem_Struct* t = (TributeItem_Struct*)app->pBuffer; TributeItem_Struct* t = (TributeItem_Struct*)app->pBuffer;
@ -8386,7 +8386,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app)
//player donates money //player donates money
if(app->size != sizeof(TributeMoney_Struct)) if(app->size != sizeof(TributeMoney_Struct))
printf("Error in OP_TributeMoney. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size); printf("Error in OP_TributeMoney. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else { else {
TributeMoney_Struct* t = (TributeMoney_Struct*)app->pBuffer; TributeMoney_Struct* t = (TributeMoney_Struct*)app->pBuffer;
@ -8534,7 +8534,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app)
void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app)
{ {
if(app->size != sizeof(FindPersonRequest_Struct)) if(app->size != sizeof(FindPersonRequest_Struct))
printf("Error in FindPersonRequest_Struct. Expected size of: %i, but got: %i\n",sizeof(FindPersonRequest_Struct),app->size); printf("Error in FindPersonRequest_Struct. Expected size of: %lu, but got: %i\n",sizeof(FindPersonRequest_Struct),app->size);
else { else {
FindPersonRequest_Struct* t = (FindPersonRequest_Struct*)app->pBuffer; FindPersonRequest_Struct* t = (FindPersonRequest_Struct*)app->pBuffer;

View File

@ -1812,7 +1812,7 @@ void Merc::AI_Process() {
//now off hand //now off hand
if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) { if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) {
int weapontype = NULL; int weapontype = 0; // No weapon type
bool bIsFist = true; bool bIsFist = true;
if(bIsFist || ((weapontype != ItemType2HS) && (weapontype != ItemType2HPierce) && (weapontype != ItemType2HB))) { if(bIsFist || ((weapontype != ItemType2HS) && (weapontype != ItemType2HPierce) && (weapontype != ItemType2HB))) {