mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 07:26:49 +01:00
ui fixes
* fix viplist * fix skills update * fix mouse grabber * minimize send interval * add api to get world name
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user