Skip to content

Commit

Permalink
[fixed] ubsan compiling issue
Browse files Browse the repository at this point in the history
Change-Id: I69cae4a1c32a979346dea6d23bb224bfa17a7ca0
  • Loading branch information
TheAnswer committed Oct 19, 2018
1 parent 6d0b57e commit 599f2b5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion MMOCoreORB/src/server/ServerCore.cpp
Expand Up @@ -12,7 +12,6 @@

#include "server/chat/ChatManager.h"
#include "server/login/LoginServer.h"
#include "features/Features.h"
#include "ping/PingServer.h"
#include "status/StatusServer.h"
#include "web/WebServer.h"
Expand Down
4 changes: 2 additions & 2 deletions MMOCoreORB/src/server/ServerCore.h
Expand Up @@ -6,6 +6,7 @@
#define SERVERCORE_H_

#include "engine/engine.h"
#include "server/features/Features.h"

namespace server {
namespace zone{
Expand All @@ -26,7 +27,6 @@ using namespace conf;
class ServerDatabase;
class MantisDatabase;
class StatusServer;
class Features;
class PingServer;

namespace server {
Expand Down Expand Up @@ -56,7 +56,7 @@ class ServerCore : public Core, public Logger {

StatusServer* statusServer;

Features* features;
server::features::Features* features;

PingServer* pingServer;

Expand Down
12 changes: 4 additions & 8 deletions MMOCoreORB/src/server/features/Features.cpp
Expand Up @@ -5,20 +5,16 @@
#include "Features.h"
#include "engine/lua/Lua.h"

Features::Features()
: HashTable<String, String>() {
}
using namespace server::features;

Features::~Features() {
Features::Features() {
}

bool Features::loadFeatures() {
Lua* lua = new Lua();
Lua lua;

if (!lua->runFile("conf/features.lua"))
if (!lua.runFile("conf/features.lua"))
return false;

delete lua;

return true;
}
14 changes: 11 additions & 3 deletions MMOCoreORB/src/server/features/Features.h
Expand Up @@ -6,18 +6,26 @@
#define FEATURES_H_

#include "system/lang.h"
#include "system/util/HashTable.h"

class Features : public HashTable<String, String> {
namespace server {
namespace features {

class Features {
protected:
HashTable<String, String> options;

public:
Features();
~Features();

bool loadFeatures();

inline bool hasFeature(const String& key) {
return containsKey(key);
return options.containsKey(key);
}
};

}
}

#endif /* FEATURES_H_ */

0 comments on commit 599f2b5

Please sign in to comment.