Fix protocol error #362
TODO: Handle the helpers in LUA, it could be added into Battle Window i think, if someone know where should this be comment here !
This commit is contained in:
parent
8230bf2af4
commit
971d90a596
|
@ -171,6 +171,7 @@ void Game::processEnterGame()
|
|||
g_lua.callGlobalField("g_game", "onEnterGame");
|
||||
}
|
||||
|
||||
|
||||
void Game::processGameStart()
|
||||
{
|
||||
m_online = true;
|
||||
|
@ -234,6 +235,11 @@ void Game::processGMActions(const std::vector<uint8>& actions)
|
|||
g_lua.callGlobalField("g_game", "onGMActions", actions);
|
||||
}
|
||||
|
||||
void Game::processPlayerHelpers(int helpers)
|
||||
{
|
||||
g_lua.callGlobalField("g_game", "onPlayerHelpersUpdate", helpers);
|
||||
}
|
||||
|
||||
void Game::processPing()
|
||||
{
|
||||
g_lua.callGlobalField("g_game", "onPing");
|
||||
|
|
|
@ -73,6 +73,8 @@ protected:
|
|||
void processAttackCancel(uint seq);
|
||||
void processWalkCancel(Otc::Direction direction);
|
||||
|
||||
void processPlayerHelpers(int helpers);
|
||||
|
||||
// message related
|
||||
void processTextMessage(Otc::MessageMode mode, const std::string& text);
|
||||
void processTalk(const std::string& name, int level, Otc::MessageMode mode, const std::string& text, int channelId, const Position& pos);
|
||||
|
|
|
@ -102,6 +102,7 @@ namespace Proto {
|
|||
GameServerCreatureSkull = 144,
|
||||
GameServerCreatureParty = 145,
|
||||
GameServerCreatureUnpass = 146,
|
||||
GameServerPlayerHelpers = 148,
|
||||
GameServerEditText = 150,
|
||||
GameServerEditList = 151,
|
||||
GameServerPlayerDataBasic = 159, // 950
|
||||
|
|
|
@ -125,6 +125,7 @@ public:
|
|||
void addPosition(const OutputMessagePtr& msg, const Position& position);
|
||||
|
||||
private:
|
||||
void parsePlayerHelpers(const InputMessagePtr& msg);
|
||||
void parseMessage(const InputMessagePtr& msg);
|
||||
void parsePendingGame(const InputMessagePtr& msg);
|
||||
void parseEnterGame(const InputMessagePtr& msg);
|
||||
|
|
|
@ -323,6 +323,10 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
|
|||
case Proto::GameServerEnterGame:
|
||||
parseEnterGame(msg);
|
||||
break;
|
||||
// PROTOCOL>=1010
|
||||
case Proto::GameServerPlayerHelpers:
|
||||
parsePlayerHelpers(msg);
|
||||
break;
|
||||
// otclient ONLY
|
||||
case Proto::GameServerExtendedOpcode:
|
||||
parseExtendedOpcode(msg);
|
||||
|
@ -379,6 +383,18 @@ void ProtocolGame::parseEnterGame(const InputMessagePtr& msg)
|
|||
}
|
||||
}
|
||||
|
||||
void ProtocolGame::parsePlayerHelpers(const InputMessagePtr& msg)
|
||||
{
|
||||
uint id = msg->getU32();
|
||||
int helpers = msg->getU16();
|
||||
|
||||
CreaturePtr creature = g_map.getCreatureById(id);
|
||||
if(creature)
|
||||
g_game.processPlayerHelpers(helpers);
|
||||
else
|
||||
g_logger.traceError("could not get creature");
|
||||
}
|
||||
|
||||
void ProtocolGame::parseGMActions(const InputMessagePtr& msg)
|
||||
{
|
||||
std::vector<uint8> actions;
|
||||
|
|
Loading…
Reference in New Issue