Revert "Build System Updated"

This commit is contained in:
Alex
2019-10-12 21:07:06 -07:00
committed by GitHub
parent 579471afcc
commit b9f57f1f28
193 changed files with 14124 additions and 10507 deletions
+11 -2
View File
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(zone_sources
aa.cpp
@@ -79,7 +79,6 @@ SET(zone_sources
horse.cpp
inventory.cpp
loottables.cpp
main.cpp
map.cpp
merc.cpp
mob.cpp
@@ -88,6 +87,7 @@ SET(zone_sources
mob_movement_manager.cpp
mob_info.cpp
mod_functions.cpp
net.cpp
npc.cpp
npc_ai.cpp
npc_scale_manager.cpp
@@ -210,6 +210,7 @@ SET(zone_headers
merc.h
mob.h
mob_movement_manager.h
net.h
npc.h
npc_ai.h
npc_scale_manager.h
@@ -257,4 +258,12 @@ ADD_DEFINITIONS(-DZONE)
TARGET_LINK_LIBRARIES(zone ${SERVER_LIBS})
IF(EQEMU_BUILD_PERL)
TARGET_LINK_LIBRARIES(zone ${PERL_LIBRARY})
ENDIF()
IF(EQEMU_BUILD_LUA)
TARGET_LINK_LIBRARIES(zone luabind ${LUA_LIBRARY})
ENDIF(EQEMU_BUILD_LUA)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+1
View File
@@ -40,6 +40,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <boost/concept_check.hpp>
#ifdef BOTS
#include "bot.h"
+3 -4
View File
@@ -41,6 +41,7 @@ extern volatile bool RunLoops;
#include "../common/profanity_manager.h"
#include "data_bucket.h"
#include "position.h"
#include "net.h"
#include "worldserver.h"
#include "zonedb.h"
#include "petitions.h"
@@ -66,8 +67,6 @@ extern PetitionList petition_list;
bool commandlogged;
char entirecommand[255];
void UpdateWindowTitle(char* iNewTitle);
Client::Client(EQStreamInterface* ieqs)
: Mob("No name", // name
"", // lastname
@@ -245,7 +244,7 @@ Client::Client(EQStreamInterface* ieqs)
PendingRezzSpellID = 0;
numclients++;
// emuerror;
UpdateWindowTitle(nullptr);
UpdateWindowTitle();
horseId = 0;
tgb = false;
tribute_master_id = 0xFFFFFFFF;
@@ -454,7 +453,7 @@ Client::~Client() {
ClearRespawnOptions();
numclients--;
UpdateWindowTitle(nullptr);
UpdateWindowTitle();
if(zone)
zone->RemoveAuth(GetName(), lskey);
-4
View File
@@ -25,10 +25,6 @@ Eglin
#ifndef WIN32
extern "C" { //the perl headers dont do this for us...
#endif
#if _MSC_VER
#define __inline__ __inline
#define __builtin_expect
#endif
#include <perl.h>
#include <XSUB.h>
#ifndef WIN32
-4
View File
@@ -8,10 +8,6 @@
#ifndef WIN32
extern "C" { //the perl headers dont do this for us...
#endif
#if _MSC_VER
#define __inline__ __inline
#define __builtin_expect
#endif
#include <perl.h>
#include <XSUB.h>
#ifndef WIN32
+20 -25
View File
@@ -33,6 +33,7 @@
#include "../common/guilds.h"
#include "guild_mgr.h"
#include "net.h"
#include "petitions.h"
#include "quest_parser_collection.h"
#include "raids.h"
@@ -55,6 +56,7 @@
extern Zone *zone;
extern volatile bool is_zone_loaded;
extern WorldServer worldserver;
extern NetConnection net;
extern uint32 numclients;
extern PetitionList petition_list;
@@ -298,13 +300,6 @@ const Bot *Entity::CastToBot() const
#endif
EntityList::EntityList()
:
object_timer(5000),
door_timer(5000),
corpse_timer(2000),
group_timer(1000),
raid_timer(1000),
trap_timer(1000)
{
// set up ids between 1 and 1500
// neither client or server performs well if you have
@@ -354,7 +349,7 @@ void EntityList::TrapProcess()
return;
if (trap_list.empty()) {
trap_timer.Disable();
net.trap_timer.Disable();
return;
}
@@ -393,7 +388,7 @@ void EntityList::GroupProcess()
return;
if (group_list.empty()) {
group_timer.Disable();
net.group_timer.Disable();
return;
}
@@ -417,7 +412,7 @@ void EntityList::RaidProcess()
return;
if (raid_list.empty()) {
raid_timer.Disable();
net.raid_timer.Disable();
return;
}
@@ -432,7 +427,7 @@ void EntityList::DoorProcess()
return;
#endif
if (door_list.empty()) {
door_timer.Disable();
net.door_timer.Disable();
return;
}
@@ -450,7 +445,7 @@ void EntityList::DoorProcess()
void EntityList::ObjectProcess()
{
if (object_list.empty()) {
object_timer.Disable();
net.object_timer.Disable();
return;
}
@@ -469,7 +464,7 @@ void EntityList::ObjectProcess()
void EntityList::CorpseProcess()
{
if (corpse_list.empty()) {
corpse_timer.Disable(); // No corpses in list
net.corpse_timer.Disable(); // No corpses in list
return;
}
@@ -611,8 +606,8 @@ void EntityList::AddGroup(Group *group, uint32 gid)
{
group->SetID(gid);
group_list.push_back(group);
if (!group_timer.Enabled())
group_timer.Start();
if (!net.group_timer.Enabled())
net.group_timer.Start();
#if EQDEBUG >= 5
CheckGroupList(__FILE__, __LINE__);
#endif
@@ -636,8 +631,8 @@ void EntityList::AddRaid(Raid *raid, uint32 gid)
{
raid->SetID(gid);
raid_list.push_back(raid);
if (!raid_timer.Enabled())
raid_timer.Start();
if (!net.raid_timer.Enabled())
net.raid_timer.Start();
}
@@ -654,8 +649,8 @@ void EntityList::AddCorpse(Corpse *corpse, uint32 in_id)
corpse->CalcCorpseName();
corpse_list.insert(std::pair<uint16, Corpse *>(corpse->GetID(), corpse));
if (!corpse_timer.Enabled())
corpse_timer.Start();
if (!net.corpse_timer.Enabled())
net.corpse_timer.Start();
}
void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
@@ -757,8 +752,8 @@ void EntityList::AddObject(Object *obj, bool SendSpawnPacket)
object_list.insert(std::pair<uint16, Object *>(obj->GetID(), obj));
if (!object_timer.Enabled())
object_timer.Start();
if (!net.object_timer.Enabled())
net.object_timer.Start();
}
void EntityList::AddDoor(Doors *door)
@@ -766,16 +761,16 @@ void EntityList::AddDoor(Doors *door)
door->SetEntityID(GetFreeID());
door_list.insert(std::pair<uint16, Doors *>(door->GetEntityID(), door));
if (!door_timer.Enabled())
door_timer.Start();
if (!net.door_timer.Enabled())
net.door_timer.Start();
}
void EntityList::AddTrap(Trap *trap)
{
trap->SetID(GetFreeID());
trap_list.insert(std::pair<uint16, Trap *>(trap->GetID(), trap));
if (!trap_timer.Enabled())
trap_timer.Start();
if (!net.trap_timer.Enabled())
net.trap_timer.Start();
}
void EntityList::AddBeacon(Beacon *beacon)
-7
View File
@@ -538,13 +538,6 @@ private:
std::list<Area> area_list;
std::queue<uint16> free_ids;
Timer object_timer;
Timer door_timer;
Timer corpse_timer;
Timer group_timer;
Timer raid_timer;
Timer trap_timer;
// Please Do Not Declare Any EntityList Class Members After This Comment
#ifdef BOTS
public:
+7 -7
View File
@@ -508,37 +508,37 @@ luabind::scope lua_register_entity_list() {
luabind::scope lua_register_mob_list() {
return luabind::class_<Lua_Mob_List>("MobList")
.def_readwrite("entries", &Lua_Mob_List::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_Mob_List::entries, luabind::return_stl_iterator);
}
luabind::scope lua_register_client_list() {
return luabind::class_<Lua_Client_List>("ClientList")
.def_readwrite("entries", &Lua_Client_List::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_Client_List::entries, luabind::return_stl_iterator);
}
luabind::scope lua_register_npc_list() {
return luabind::class_<Lua_NPC_List>("NPCList")
.def_readwrite("entries", &Lua_NPC_List::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_NPC_List::entries, luabind::return_stl_iterator);
}
luabind::scope lua_register_corpse_list() {
return luabind::class_<Lua_Corpse_List>("CorpseList")
.def_readwrite("entries", &Lua_Corpse_List::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_Corpse_List::entries, luabind::return_stl_iterator);
}
luabind::scope lua_register_object_list() {
return luabind::class_<Lua_Object_List>("ObjectList")
.def_readwrite("entries", &Lua_Object_List::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_Object_List::entries, luabind::return_stl_iterator);
}
luabind::scope lua_register_door_list() {
return luabind::class_<Lua_Doors_List>("DoorList")
.def_readwrite("entries", &Lua_Doors_List::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_Doors_List::entries, luabind::return_stl_iterator);
}
luabind::scope lua_register_spawn_list() {
return luabind::class_<Lua_Spawn_List>("SpawnList")
.def_readwrite("entries", &Lua_Spawn_List::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_Spawn_List::entries, luabind::return_stl_iterator);
}
#endif
+1 -1
View File
@@ -63,7 +63,7 @@ luabind::scope lua_register_hate_entry() {
luabind::scope lua_register_hate_list() {
return luabind::class_<Lua_HateList>("HateList")
.def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator());
.def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator);
}
#endif
+3 -3
View File
@@ -2229,9 +2229,9 @@ bool Lua_Mob::IsBerserk() {
return self->IsBerserk();
}
bool Lua_Mob::TryFinishingBlow(Lua_Mob defender, int *damage) {
bool Lua_Mob::TryFinishingBlow(Lua_Mob defender, int &damage) {
Lua_Safe_Call_Bool();
return self->TryFinishingBlow(defender, *damage);
return self->TryFinishingBlow(defender, damage);
}
int Lua_Mob::GetBodyType()
@@ -2636,7 +2636,7 @@ luabind::scope lua_register_mob() {
.def("AttackAnimation", &Lua_Mob::AttackAnimation)
.def("GetWeaponDamage", &Lua_Mob::GetWeaponDamage)
.def("IsBerserk", &Lua_Mob::IsBerserk)
.def("TryFinishingBlow", (bool(Lua_Mob::*)(int*))&Lua_Mob::TryFinishingBlow)
.def("TryFinishingBlow", &Lua_Mob::TryFinishingBlow)
.def("GetBodyType", &Lua_Mob::GetBodyType)
.def("GetOrigBodyType", &Lua_Mob::GetOrigBodyType)
.def("CheckNumHitsRemaining", &Lua_Mob::CheckNumHitsRemaining);
+1 -1
View File
@@ -418,7 +418,7 @@ public:
int AttackAnimation(int Hand, Lua_ItemInst weapon);
int GetWeaponDamage(Lua_Mob against, Lua_ItemInst weapon);
bool IsBerserk();
bool TryFinishingBlow(Lua_Mob defender, int *damage);
bool TryFinishingBlow(Lua_Mob defender, int &damage);
int GetBodyType();
int GetOrigBodyType();
void CheckNumHitsRemaining(int type, int32 buff_slot, uint16 spell_id);
-4
View File
@@ -1,5 +1,3 @@
#ifdef LUA_EQEMU
#include "lua.hpp"
#include <luabind/luabind.hpp>
#include <luabind/object.hpp>
@@ -631,5 +629,3 @@ void LuaMod::GetExperienceForKill(Client *self, Mob *against, uint32 &returnValu
lua_pop(L, n);
}
}
#endif
+2 -2
View File
@@ -1300,6 +1300,8 @@ QuestEventID LuaParser::ConvertLuaEvent(QuestEventID evt) {
}
}
#endif
void LuaParser::MeleeMitigation(Mob *self, Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault)
{
for (auto &mod : mods_) {
@@ -1372,5 +1374,3 @@ uint32 LuaParser::GetExperienceForKill(Client *self, Mob *against, bool &ignoreD
}
return retval;
}
#endif
+1 -5
View File
@@ -1,5 +1,3 @@
#ifdef LUA_EQEMU
#include "lua.hpp"
#include <luabind/luabind.hpp>
@@ -1544,6 +1542,4 @@ luabind::scope lua_register_stat_bonuses() {
.def("Assassinate", &Lua_StatBonuses::GetAssassinate)
.def("AssassinateLevel", &Lua_StatBonuses::GetAssassinateLevel)
.def("ReduceTradeskillFail", &Lua_StatBonuses::GetReduceTradeskillFail);
}
#endif
}
+74 -10
View File
@@ -47,6 +47,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "zone_config.h"
#include "masterentity.h"
#include "worldserver.h"
#include "net.h"
#include "zone.h"
#include "queryserv.h"
#include "command.h"
@@ -95,6 +96,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
volatile bool RunLoops = true;
extern volatile bool is_zone_loaded;
NetConnection net;
EntityList entity_list;
WorldServer worldserver;
uint32 numclients = 0;
@@ -113,9 +115,6 @@ const ZoneConfig *Config;
double frame_time = 0.0;
void Shutdown();
void UpdateWindowTitle(char* iNewTitle);
void CatchSignal(int sig_num);
extern void MapOpcodes();
int main(int argc, char** argv) {
@@ -441,7 +440,7 @@ int main(int argc, char** argv) {
bool websocker_server_opened = false;
Timer quest_timers(100);
UpdateWindowTitle(nullptr);
UpdateWindowTitle();
std::shared_ptr<EQStreamInterface> eqss;
EQStreamInterface *eqsi;
std::unique_ptr<EQ::Net::EQStreamManager> eqsm;
@@ -515,12 +514,23 @@ int main(int argc, char** argv) {
if (is_zone_loaded) {
{
entity_list.GroupProcess();
entity_list.DoorProcess();
entity_list.ObjectProcess();
entity_list.CorpseProcess();
entity_list.TrapProcess();
entity_list.RaidProcess();
if (net.group_timer.Enabled() && net.group_timer.Check())
entity_list.GroupProcess();
if (net.door_timer.Enabled() && net.door_timer.Check())
entity_list.DoorProcess();
if (net.object_timer.Enabled() && net.object_timer.Check())
entity_list.ObjectProcess();
if (net.corpse_timer.Enabled() && net.corpse_timer.Check())
entity_list.CorpseProcess();
if (net.trap_timer.Enabled() && net.trap_timer.Check())
entity_list.TrapProcess();
if (net.raid_timer.Enabled() && net.raid_timer.Check())
entity_list.RaidProcess();
entity_list.Process();
entity_list.MobProcess();
@@ -612,6 +622,60 @@ void Shutdown()
LogSys.CloseFileLogs();
}
uint32 NetConnection::GetIP()
{
char name[255 + 1];
size_t len = 0;
hostent* host = 0;
if (gethostname(name, len) < 0 || len <= 0)
{
return 0;
}
host = (hostent*)gethostbyname(name);
if (host == 0)
{
return 0;
}
return inet_addr(host->h_addr);
}
uint32 NetConnection::GetIP(char* name)
{
hostent* host = 0;
host = (hostent*)gethostbyname(name);
if (host == 0)
{
return 0;
}
return inet_addr(host->h_addr);
}
NetConnection::NetConnection()
:
object_timer(5000),
door_timer(5000),
corpse_timer(2000),
group_timer(1000),
raid_timer(1000),
trap_timer(1000)
{
group_timer.Disable();
raid_timer.Disable();
corpse_timer.Disable();
door_timer.Disable();
object_timer.Disable();
trap_timer.Disable();
}
NetConnection::~NetConnection() {
}
/* Update Window Title with relevant information */
void UpdateWindowTitle(char* iNewTitle) {
#ifdef _WINDOWS
+48
View File
@@ -0,0 +1,48 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WINDOWS
#include <winsock2.h>
#include <windows.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netdb.h>
#endif
#include "../common/types.h"
#include "../common/timer.h"
void CatchSignal(int);
void UpdateWindowTitle(char* iNewTitle = 0);
class NetConnection
{
public:
~NetConnection();
NetConnection();
uint32 GetIP();
uint32 GetIP(char* name);
Timer object_timer;
Timer door_timer;
Timer corpse_timer;
Timer group_timer;
Timer raid_timer;
Timer trap_timer;
};
+1851
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef OLDCODE_H
#define OLDCODE_H
#endif
+1
View File
@@ -21,6 +21,7 @@ Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
#include "../common/string_util.h"
#include "queryserv.h"
#include "worldserver.h"
#include "net.h"
extern WorldServer worldserver;
+2
View File
@@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "quest_parser_collection.h"
#include "guild_mgr.h"
#include "mob.h"
#include "net.h"
#include "petitions.h"
#include "raids.h"
#include "string_ids.h"
@@ -58,6 +59,7 @@ extern Zone* zone;
extern volatile bool is_zone_loaded;
extern void CatchSignal(int);
extern WorldServer worldserver;
extern NetConnection net;
extern PetitionList petition_list;
extern uint32 numclients;
extern volatile bool RunLoops;
+5 -5
View File
@@ -39,6 +39,7 @@
#include "guild_mgr.h"
#include "map.h"
#include "net.h"
#include "npc.h"
#include "object.h"
#include "pathfinder_null.h"
@@ -67,6 +68,7 @@
#endif
extern bool staticzone;
extern NetConnection net;
extern PetitionList petition_list;
extern QuestParserCollection* parse;
extern uint32 numclients;
@@ -79,8 +81,6 @@ Mutex MZoneShutdown;
volatile bool is_zone_loaded = false;
Zone* zone = 0;
void UpdateWindowTitle(char* iNewTitle);
bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
const char* zonename = database.GetZoneName(iZoneID);
@@ -147,7 +147,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
LogInfo("---- Zone server [{}], listening on port:[{}] ----", zonename, ZoneConfig::get()->ZonePort);
LogInfo("Zone Bootup: [{}] ([{}]: [{}])", zonename, iZoneID, iInstanceID);
parse->Init();
UpdateWindowTitle(nullptr);
UpdateWindowTitle();
zone->GetTimeSync();
zone->RequestUCSServerStatus();
@@ -727,7 +727,7 @@ void Zone::Shutdown(bool quiet)
safe_delete(zone);
entity_list.ClearAreas();
parse->ReloadQuests(true);
UpdateWindowTitle(nullptr);
UpdateWindowTitle();
LogSys.CloseFileLogs();
@@ -2422,4 +2422,4 @@ void Zone::CalculateNpcUpdateDistanceSpread()
update_distance,
combined_spread
);
}
}