* fix viplist
* fix skills update
* fix mouse grabber
* minimize send interval
* add api to get world name
This commit is contained in:
Eduardo Bart
2012-03-29 16:25:04 -03:00
parent 47e7eef716
commit a475384b73
9 changed files with 25 additions and 27 deletions

View File

@@ -36,7 +36,7 @@ class Connection : public std::enable_shared_from_this<Connection>, boost::nonco
enum {
READ_TIMEOUT = 30,
WRITE_TIMEOUT = 30,
SEND_INTERVAL = 10,
SEND_INTERVAL = 1,
SEND_BUFFER_SIZE = 65536,
RECV_BUFFER_SIZE = 65536
};

View File

@@ -315,14 +315,16 @@ void Game::processWalkCancel(Otc::Direction direction)
m_localPlayer->cancelWalk(direction);
}
void Game::loginWorld(const std::string& account, const std::string& password, const std::string& worldHost, int worldPort, const std::string& characterName)
void Game::loginWorld(const std::string& account, const std::string& password, const std::string& worldName, const std::string& worldHost, int worldPort, const std::string& characterName)
{
if(m_protocolGame || isOnline()) {
logTraceError("unable to login into a world while already online or logging");
return;
}
m_protocolGame = ProtocolGamePtr(new ProtocolGame);
m_protocolGame->login(account, password, worldHost, (uint16)worldPort, characterName);
m_worldName = worldName;
}
void Game::cancelLogin()

View File

@@ -114,7 +114,8 @@ protected:
public:
// login related
void loginWorld(const std::string& account,
const std::string& password,
const std::string& password,
const std::string& worldName,
const std::string& worldHost, int worldPort,
const std::string& characterName);
void cancelLogin();
@@ -223,6 +224,7 @@ public:
LocalPlayerPtr getLocalPlayer() { return m_localPlayer; }
ProtocolGamePtr getProtocolGame() { return m_protocolGame; }
int getProtocolVersion() { return PROTOCOL; }
std::string getWorldName() { return m_worldName; }
private:
void setAttackingCreature(const CreaturePtr& creature);
@@ -238,6 +240,7 @@ private:
Otc::FightModes m_fightMode;
Otc::ChaseModes m_chaseMode;
bool m_safeFight;
std::string m_worldName;
};
extern Game g_game;

View File

@@ -182,7 +182,7 @@ void LocalPlayer::setSkill(Otc::Skill skill, int level, int levelPercent)
int oldLevel = m_skillsLevel[skill];
int oldLevelPercent = m_skillsLevelPercent[skill];
if(level != oldLevel && levelPercent != oldLevelPercent) {
if(level != oldLevel || levelPercent != oldLevelPercent) {
m_skillsLevel[skill] = level;
m_skillsLevelPercent[skill] = levelPercent;

View File

@@ -78,7 +78,7 @@ void OTClient::registerLuaFunctions()
g_lua.bindClassStaticFunction("g_map", "findPath", std::bind(&Map::findPath, &g_map, _1, _2, _3));
g_lua.registerStaticClass("g_game");
g_lua.bindClassStaticFunction("g_game", "loginWorld", std::bind(&Game::loginWorld, &g_game, _1, _2, _3, _4, _5));
g_lua.bindClassStaticFunction("g_game", "loginWorld", std::bind(&Game::loginWorld, &g_game, _1, _2, _3, _4, _5, _6));
g_lua.bindClassStaticFunction("g_game", "cancelLogin", std::bind(&Game::cancelLogin, &g_game));
g_lua.bindClassStaticFunction("g_game", "forceLogout", std::bind(&Game::forceLogout, &g_game));
g_lua.bindClassStaticFunction("g_game", "safeLogout", std::bind(&Game::safeLogout, &g_game));
@@ -153,6 +153,7 @@ void OTClient::registerLuaFunctions()
g_lua.bindClassStaticFunction("g_game", "getLocalPlayer", std::bind(&Game::getLocalPlayer, &g_game));
g_lua.bindClassStaticFunction("g_game", "getProtocolGame", std::bind(&Game::getProtocolGame, &g_game));
g_lua.bindClassStaticFunction("g_game", "getProtocolVersion", std::bind(&Game::getProtocolVersion, &g_game));
g_lua.bindClassStaticFunction("g_game", "getWorldName", std::bind(&Game::getWorldName, &g_game));
g_lua.bindGlobalFunction("getOufitColor", Outfit::getColor);