Fix sending os type, bind some functions

This commit is contained in:
Eduardo Bart 2012-07-26 13:41:13 -03:00
parent f5c97c8e8b
commit 5f1e58c138
3 changed files with 4 additions and 2 deletions

View File

@ -229,7 +229,7 @@ public:
// dynamic support for game features // dynamic support for game features
void enableFeature(Otc::GameFeature feature) { m_features.set(feature, true); } void enableFeature(Otc::GameFeature feature) { m_features.set(feature, true); }
void disableFeature(Otc::GameFeature feature) { m_features.set(feature, false); } void disableFeature(Otc::GameFeature feature) { m_features.set(feature, false); }
void setFeature(Otc::GameFeature feature) { m_features.set(feature, false); } void setFeature(Otc::GameFeature feature, bool enabled) { m_features.set(feature, enabled); }
bool getFeature(Otc::GameFeature feature) { return m_features.test(feature); } bool getFeature(Otc::GameFeature feature) { return m_features.test(feature); }
void setClientVersion(int version); void setClientVersion(int version);

View File

@ -200,6 +200,8 @@ void OTClient::registerLuaFunctions()
g_lua.bindSingletonFunction("g_game", "getWorldName", &Game::getWorldName, &g_game); g_lua.bindSingletonFunction("g_game", "getWorldName", &Game::getWorldName, &g_game);
g_lua.bindSingletonFunction("g_game", "getGMActions", &Game::getGMActions, &g_game); g_lua.bindSingletonFunction("g_game", "getGMActions", &Game::getGMActions, &g_game);
g_lua.bindSingletonFunction("g_game", "getFeature", &Game::getFeature, &g_game); g_lua.bindSingletonFunction("g_game", "getFeature", &Game::getFeature, &g_game);
g_lua.bindSingletonFunction("g_game", "setFeature", &Game::setFeature, &g_game);
g_lua.bindSingletonFunction("g_game", "enableFeature", &Game::enableFeature, &g_game);
g_lua.registerSingletonClass("g_shaders"); g_lua.registerSingletonClass("g_shaders");
g_lua.bindSingletonFunction("g_shaders", "createShader", &ShaderManager::createShader, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "createShader", &ShaderManager::createShader, &g_shaders);

View File

@ -50,7 +50,7 @@ void ProtocolGame::sendLoginPacket(uint challangeTimestamp, uint8 challangeRando
msg->addU8(Proto::ClientEnterGame); msg->addU8(Proto::ClientEnterGame);
msg->addU16(g_lua.callGlobalField<int>("g_game", "getOs")); msg->addU16(g_lua.callGlobalField<int>("g_game", "getOsType"));
msg->addU16(g_game.getClientVersion()); msg->addU16(g_game.getClientVersion());
int paddingBytes = 128; int paddingBytes = 128;