mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 23:26:51 +01:00
More refactoring and some changes
* Move protocol safeSend() to send() * Bind some new functions * Refactor lots of enums
This commit is contained in:
@@ -59,8 +59,7 @@ void ModuleManager::autoLoadModules(int maxPriority)
|
||||
if(priority > maxPriority)
|
||||
break;
|
||||
ModulePtr module = pair.second;
|
||||
if(!module->isLoaded() && !module->load())
|
||||
g_logger.fatal("A required module has failed to load, cannot continue to run.");
|
||||
module->load();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ void Application::registerLuaFunctions()
|
||||
g_lua.bindClassMemberFunction<Protocol>("disconnect", &Protocol::disconnect);
|
||||
g_lua.bindClassMemberFunction<Protocol>("isConnected", &Protocol::isConnected);
|
||||
g_lua.bindClassMemberFunction<Protocol>("isConnecting", &Protocol::isConnecting);
|
||||
g_lua.bindClassMemberFunction<Protocol>("send", &Protocol::send); // must change to safeSend
|
||||
g_lua.bindClassMemberFunction<Protocol>("send", &Protocol::send);
|
||||
g_lua.bindClassMemberFunction<Protocol>("recv", &Protocol::recv);
|
||||
g_lua.bindClassMemberFunction<Protocol>("getXteaKey", &Protocol::getXteaKey);
|
||||
g_lua.bindClassMemberFunction<Protocol>("generateXteaKey", &Protocol::generateXteaKey);
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <iomanip>
|
||||
#include <vector>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <otclient/position.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "cast.h"
|
||||
@@ -53,7 +52,7 @@ typename std::enable_if<std::is_integral<T>::value ||
|
||||
std::is_floating_point<T>::value ||
|
||||
std::is_enum<T>::value, T>::type sprintf_cast(const T& t) { return t; }
|
||||
|
||||
/// Cast any class or struct convertible to std::string
|
||||
/// Cast std::string
|
||||
inline const char *sprintf_cast(const std::string& s) { return s.c_str(); }
|
||||
|
||||
template<int N>
|
||||
@@ -181,11 +180,6 @@ inline std::string ip_to_string(uint32 ip) {
|
||||
return std::string(host);
|
||||
}
|
||||
|
||||
inline std::string pos_to_string(const Position& p)
|
||||
{
|
||||
return format("{x = %hd, y = %hd, z = %hd}", p.x, p.y, p.z);
|
||||
}
|
||||
|
||||
/// Convert utf8 characters to latin1
|
||||
inline char utf8CharToLatin1(uchar *utf8, int *read) {
|
||||
char c = '?';
|
||||
|
||||
Reference in New Issue
Block a user