Support for protocol 963
This commit is contained in:
parent
fe6f6c2d20
commit
97e1c9d5a9
|
@ -49,7 +49,8 @@ end
|
|||
function g_game.getSupportedProtocols()
|
||||
return {
|
||||
810, 853, 854, 860, 861, 862, 870,
|
||||
910, 940, 944, 953, 954, 960, 961
|
||||
910, 940, 944, 953, 954, 960, 961,
|
||||
963
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -692,13 +692,6 @@ void LuaInterface::createLuaState()
|
|||
rawSeti(5);
|
||||
pop(2);
|
||||
|
||||
// replace loadfile
|
||||
getGlobal("package");
|
||||
getField("loaders");
|
||||
pushCFunction(&LuaInterface::luaScriptLoader);
|
||||
rawSeti(5);
|
||||
pop(2);
|
||||
|
||||
// replace dofile
|
||||
pushCFunction(&LuaInterface::lua_dofile);
|
||||
setGlobal("dofile");
|
||||
|
|
|
@ -635,6 +635,9 @@ void Game::look(const ThingPtr& thing)
|
|||
if(!canPerformGameAction() || !thing)
|
||||
return;
|
||||
|
||||
if(thing->isCreature() && m_clientVersion >= 961)
|
||||
m_protocolGame->sendLookCreature(thing->getId());
|
||||
else
|
||||
m_protocolGame->sendLook(thing->getPosition(), thing->getId(), thing->getStackpos());
|
||||
}
|
||||
|
||||
|
@ -774,7 +777,12 @@ void Game::attack(CreaturePtr creature)
|
|||
cancelFollow();
|
||||
|
||||
setAttackingCreature(creature);
|
||||
|
||||
if(m_clientVersion >= 963)
|
||||
m_seq = creature->getId();
|
||||
else
|
||||
m_seq++;
|
||||
|
||||
m_protocolGame->sendAttack(creature ? creature->getId() : 0, m_seq);
|
||||
}
|
||||
|
||||
|
@ -791,7 +799,12 @@ void Game::follow(CreaturePtr creature)
|
|||
cancelAttack();
|
||||
|
||||
setFollowingCreature(creature);
|
||||
|
||||
if(m_clientVersion >= 963)
|
||||
m_seq = creature->getId();
|
||||
else
|
||||
m_seq++;
|
||||
|
||||
m_protocolGame->sendFollow(creature ? creature->getId() : 0, m_seq);
|
||||
}
|
||||
|
||||
|
@ -1151,7 +1164,7 @@ void Game::setClientVersion(int version)
|
|||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change client version while online");
|
||||
|
||||
if(version != 0 && (version < 810 || version > 961))
|
||||
if(version != 0 && (version < 810 || version > 963))
|
||||
stdext::throw_exception(stdext::format("Protocol version %d not supported", version));
|
||||
|
||||
m_features.reset();
|
||||
|
|
|
@ -191,6 +191,7 @@ namespace Proto {
|
|||
ClientEditText = 137,
|
||||
ClientEditList = 138,
|
||||
ClientLook = 140,
|
||||
ClientLookCreature = 141,
|
||||
ClientTalk = 150,
|
||||
ClientRequestChannels = 151,
|
||||
ClientJoinChannel = 152,
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
void sendEditText(uint id, const std::string& text);
|
||||
void sendEditList(uint id, int doorId, const std::string& text);
|
||||
void sendLook(const Position& position, int thingId, int stackpos);
|
||||
void sendLookCreature(uint creatureId);
|
||||
void sendTalk(Otc::MessageMode mode, int channelId, const std::string& receiver, const std::string& message);
|
||||
void sendRequestChannels();
|
||||
void sendJoinChannel(int channelId);
|
||||
|
|
|
@ -1254,9 +1254,18 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg)
|
|||
|
||||
void ProtocolGame::parseVipAdd(const InputMessagePtr& msg)
|
||||
{
|
||||
uint id = msg->getU32();
|
||||
std::string name = g_game.formatCreatureName(msg->getString());
|
||||
bool online = msg->getU8() != 0;
|
||||
uint id, markId;
|
||||
std::string name, desc;
|
||||
bool online, notifyLogin;
|
||||
|
||||
id = msg->getU32();
|
||||
name = g_game.formatCreatureName(msg->getString());
|
||||
if(g_game.getClientVersion() >= 963) {
|
||||
desc = msg->getString();
|
||||
markId = msg->getU32();
|
||||
notifyLogin = msg->getU8();
|
||||
}
|
||||
online = msg->getU8();
|
||||
|
||||
g_game.processVipAdd(id, name, online);
|
||||
}
|
||||
|
|
|
@ -436,6 +436,14 @@ void ProtocolGame::sendLook(const Position& position, int thingId, int stackpos)
|
|||
send(msg);
|
||||
}
|
||||
|
||||
void ProtocolGame::sendLookCreature(uint32 creatureId)
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
msg->addU8(0x8D);
|
||||
msg->addU32(creatureId);
|
||||
send(msg);
|
||||
}
|
||||
|
||||
void ProtocolGame::sendTalk(Otc::MessageMode mode, int channelId, const std::string& receiver, const std::string& message)
|
||||
{
|
||||
if(message.empty())
|
||||
|
|
Loading…
Reference in New Issue