Merge branch 'master' of https://github.com/edubart/otclient into mobile_port

This commit is contained in:
Túlio Henrique
2015-08-13 10:05:00 -03:00
12 changed files with 337 additions and 50 deletions

View File

@@ -1439,7 +1439,7 @@ bool Game::canPerformGameAction()
// - we have a game protocol
// - the game protocol is connected
// - its not a bot action
return m_online && m_localPlayer && !m_dead && m_protocolGame && m_protocolGame->isConnected() && checkBotProtection();
return m_online && m_localPlayer && !m_localPlayer->isDead() && !m_dead && m_protocolGame && m_protocolGame->isConnected() && checkBotProtection();
}
void Game::setProtocolVersion(int version)

View File

@@ -132,9 +132,10 @@ void StaticText::compose()
text += m_name;
text += " yells:\n";
m_color = Color(239, 239, 0);
} else if(m_mode == Otc::MessageMonsterSay || m_mode == Otc::MessageMonsterYell || m_mode == Otc::MessageSpell || m_mode == Otc::MessageBarkLow || m_mode == Otc::MessageBarkLoud) {
} else if(m_mode == Otc::MessageMonsterSay || m_mode == Otc::MessageMonsterYell || m_mode == Otc::MessageSpell
|| m_mode == Otc::MessageBarkLow || m_mode == Otc::MessageBarkLoud) {
m_color = Color(254, 101, 0);
} else if(m_mode == Otc::MessageNpcFrom) {
} else if(m_mode == Otc::MessageNpcFrom || m_mode == Otc::MessageNpcFromStartBlock) {
text += m_name;
text += " says:\n";
m_color = Color(95, 247, 247);

View File

@@ -74,6 +74,8 @@ void EventDispatcher::poll()
event->execute();
}
m_pollEventsSize = m_eventList.size();
loops++;
}
}

View File

@@ -307,13 +307,17 @@ std::string Crypt::sha512Encode(const std::string& decoded_string, bool upperCas
void Crypt::rsaGenerateKey(int bits, int e)
{
RSA *rsa = RSA_generate_key(bits, e, nullptr, nullptr);
RSA *rsa = RSA_new();
BIGNUM *ebn = BN_new();
BN_set_word(ebn, e);
RSA_generate_key_ex(rsa, bits, ebn, nullptr);
g_logger.info(stdext::format("%d bits (%d bytes) RSA key generated", bits, bits / 8));
g_logger.info(std::string("p = ") + BN_bn2dec(m_rsa->p));
g_logger.info(std::string("q = ") + BN_bn2dec(m_rsa->q));
g_logger.info(std::string("d = ") + BN_bn2dec(m_rsa->d));
g_logger.info(std::string("n = ") + BN_bn2dec(m_rsa->n));
g_logger.info(std::string("e = ") + BN_bn2dec(m_rsa->e));
BN_clear_free(ebn);
RSA_free(rsa);
}