mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
More progress on cipserver login for pv973 and a few fixes.
* Fixed the "options" module hotkey (changed boost walker to Ctrl+Shift+D). * Fixed a small issue with UIMiniWindow:setup() function (was setting parent before its pos). * Pic signature has changed for cipsoft client. * Fixed 'client type' byte position in the login packet. * Changed the ping function to execute every 4 seconds rather than 2. * Changed some protocolgame for pv973 support.
This commit is contained in:
@@ -133,6 +133,8 @@ void Game::processPendingGame()
|
||||
void Game::processEnterGame()
|
||||
{
|
||||
m_localPlayer->setPendingGame(false);
|
||||
m_protocolGame->sendEnterGame();
|
||||
|
||||
g_lua.callGlobalField("g_game", "onEnterGame");
|
||||
}
|
||||
|
||||
@@ -156,7 +158,7 @@ void Game::processGameStart()
|
||||
m_protocolGame->sendPing();
|
||||
disableBotCall();
|
||||
}
|
||||
}, 2000);
|
||||
}, 4000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -145,7 +145,8 @@ namespace Proto {
|
||||
enum ClientOpcodes : uint8
|
||||
{
|
||||
ClientEnterAccount = 1,
|
||||
ClientEnterGame = 10,
|
||||
ClientPendingGame = 10,
|
||||
ClientEnterGame = 15,
|
||||
ClientLeaveGame = 20,
|
||||
ClientPing = 29,
|
||||
ClientPingBack = 30,
|
||||
|
@@ -36,6 +36,7 @@ public:
|
||||
|
||||
void sendExtendedOpcode(uint8 opcode, const std::string& buffer);
|
||||
void sendLoginPacket(uint challangeTimestamp, uint8 challangeRandom);
|
||||
void sendEnterGame();
|
||||
void sendLogout();
|
||||
void sendPing();
|
||||
void sendPingBack();
|
||||
|
@@ -43,9 +43,11 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
|
||||
opcode = msg->getU8();
|
||||
|
||||
// must be > so extended will be enabled before GameStart.
|
||||
if(!m_gameInitialized && opcode > Proto::GameServerFirstGameOpcode) {
|
||||
g_game.processGameStart();
|
||||
m_gameInitialized = true;
|
||||
if(!g_game.getFeature(Otc::GameLoginPending)) {
|
||||
if(!m_gameInitialized && opcode > Proto::GameServerFirstGameOpcode) {
|
||||
g_game.processGameStart();
|
||||
m_gameInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
// try to parse in lua first
|
||||
@@ -361,6 +363,11 @@ void ProtocolGame::parseEnterGame(const InputMessagePtr& msg)
|
||||
{
|
||||
//set player to entered game state
|
||||
g_game.processEnterGame();
|
||||
|
||||
if(!m_gameInitialized) {
|
||||
g_game.processGameStart();
|
||||
m_gameInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ProtocolGame::parseGMActions(const InputMessagePtr& msg)
|
||||
|
@@ -48,7 +48,7 @@ void ProtocolGame::sendLoginPacket(uint challangeTimestamp, uint8 challangeRando
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
|
||||
msg->addU8(Proto::ClientEnterGame);
|
||||
msg->addU8(Proto::ClientPendingGame);
|
||||
|
||||
msg->addU16(g_lua.callGlobalField<int>("g_game", "getOsType"));
|
||||
msg->addU16(g_game.getProtocolVersion());
|
||||
@@ -103,6 +103,13 @@ void ProtocolGame::sendLoginPacket(uint challangeTimestamp, uint8 challangeRando
|
||||
enableXteaEncryption();
|
||||
}
|
||||
|
||||
void ProtocolGame::sendEnterGame()
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
msg->addU8(Proto::ClientEnterGame);
|
||||
send(msg);
|
||||
}
|
||||
|
||||
void ProtocolGame::sendLogout()
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
@@ -444,7 +451,7 @@ void ProtocolGame::sendLook(const Position& position, int thingId, int stackpos)
|
||||
void ProtocolGame::sendLookCreature(uint32 creatureId)
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
msg->addU8(0x8D);
|
||||
msg->addU8(Proto::ClientLookCreature);
|
||||
msg->addU32(creatureId);
|
||||
send(msg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user