some missing protocol send messages

This commit is contained in:
Henrique Santiago 2012-01-02 20:23:54 -02:00
parent 90600bbd69
commit 41c2d18b93
2 changed files with 174 additions and 0 deletions

View File

@ -46,6 +46,7 @@ public:
void sendWalkEast(); void sendWalkEast();
void sendWalkSouth(); void sendWalkSouth();
void sendWalkWest(); void sendWalkWest();
void sendStopAutowalk();
void sendWalkNorthEast(); void sendWalkNorthEast();
void sendWalkSouthEast(); void sendWalkSouthEast();
void sendWalkSouthWest(); void sendWalkSouthWest();
@ -54,6 +55,15 @@ public:
void sendTurnEast(); void sendTurnEast();
void sendTurnSouth(); void sendTurnSouth();
void sendTurnWest(); void sendTurnWest();
void sendThrow(const Position& fromPos, int thingId, int stackpos, const Position& toPos, int count);
void sendLookInShop(int thingId, int count);
void sendPlayerPurchase(int thingId, int count, int amount, bool ignoreCapacity, bool buyWithBackpack);
void sendPlayerSale(int thingId, int count, int amount, bool ignoreEquipped);
void sendCloseShop();
void sendRequestTrade(const Position& pos, int thingId, int stackpos, int playerId);
void sendLookInTrade(bool counterOffer, int index);
void sendAcceptTrade();
void sendRejectTrade();
void sendUseItem(const Position& position, int itemId, int stackpos, int index); void sendUseItem(const Position& position, int itemId, int stackpos, int index);
void sendLookAt(const Position& position, int thingId, int stackpos); void sendLookAt(const Position& position, int thingId, int stackpos);
void sendTalk(int channelType, int channelId, const std::string& receiver, const std::string& message); void sendTalk(int channelType, int channelId, const std::string& receiver, const std::string& message);

View File

@ -73,6 +73,8 @@ void ProtocolGame::sendPing()
send(oMsg); send(oMsg);
} }
// autowalk
void ProtocolGame::sendWalkNorth() void ProtocolGame::sendWalkNorth()
{ {
OutputMessage oMsg; OutputMessage oMsg;
@ -101,6 +103,13 @@ void ProtocolGame::sendWalkWest()
send(oMsg); send(oMsg);
} }
void ProtocolGame::sendStopAutowalk()
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientStop);
send(oMsg);
}
void ProtocolGame::sendWalkNorthEast() void ProtocolGame::sendWalkNorthEast()
{ {
OutputMessage oMsg; OutputMessage oMsg;
@ -157,6 +166,91 @@ void ProtocolGame::sendTurnWest()
send(oMsg); send(oMsg);
} }
void ProtocolGame::sendThrow(const Position& fromPos, int thingId, int stackpos, const Position& toPos, int count)
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientMoveObject);
addPosition(oMsg, fromPos);
oMsg.addU16(thingId);
oMsg.addU8(stackpos);
addPosition(oMsg, toPos);
oMsg.addU8(count);
send(oMsg);
}
void ProtocolGame::sendLookInShop(int thingId, int count)
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientInspectNpcTrade);
oMsg.addU16(thingId);
oMsg.addU8(count);
send(oMsg);
}
void ProtocolGame::sendPlayerPurchase(int thingId, int count, int amount, bool ignoreCapacity, bool buyWithBackpack)
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientBuyObject);
oMsg.addU16(thingId);
oMsg.addU8(count);
oMsg.addU8(amount);
oMsg.addU8(ignoreCapacity ? 0x01 : 0x00);
oMsg.addU8(buyWithBackpack ? 0x01 : 0x00);
send(oMsg);
}
void ProtocolGame::sendPlayerSale(int thingId, int count, int amount, bool ignoreEquipped)
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientSellObject);
oMsg.addU16(thingId);
oMsg.addU8(count);
oMsg.addU8(amount);
oMsg.addU8(ignoreEquipped ? 0x01 : 0x00);
send(oMsg);
}
void ProtocolGame::sendCloseShop()
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientCloseNpcTrade);
send(oMsg);
}
void ProtocolGame::sendRequestTrade(const Position& pos, int thingId, int stackpos, int playerId)
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientTradeObject);
addPosition(oMsg, pos);
oMsg.addU16(thingId);
oMsg.addU8(stackpos);
oMsg.addU32(playerId);
send(oMsg);
}
void ProtocolGame::sendLookInTrade(bool counterOffer, int index)
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientInspectTrade);
oMsg.addU8(counterOffer ? 0x01 : 0x00);
oMsg.addU8(index);
send(oMsg);
}
void ProtocolGame::sendAcceptTrade()
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientAcceptTrade);
send(oMsg);
}
void ProtocolGame::sendRejectTrade()
{
OutputMessage oMsg;
oMsg.addU8(Otc::ClientRejectTrade);
send(oMsg);
}
void ProtocolGame::sendUseItem(const Position& position, int itemId, int stackpos, int index) void ProtocolGame::sendUseItem(const Position& position, int itemId, int stackpos, int index)
{ {
OutputMessage oMsg; OutputMessage oMsg;
@ -168,6 +262,20 @@ void ProtocolGame::sendUseItem(const Position& position, int itemId, int stackpo
send(oMsg); send(oMsg);
} }
// use item ex
// battle window
// rotate item
// close container
// up arrow container
// text window
// house window
void ProtocolGame::sendLookAt(const Position& position, int thingId, int stackpos) void ProtocolGame::sendLookAt(const Position& position, int thingId, int stackpos)
{ {
OutputMessage oMsg; OutputMessage oMsg;
@ -204,6 +312,52 @@ void ProtocolGame::sendTalk(int channelType, int channelId, const std::string& r
send(oMsg); send(oMsg);
} }
// get channels
// open channels
// close channel
// open priv
// process report
// gm closes report
// cancel report
// close npc
// fight modes
// attack
// follow
// invite to party
// join party
// revoke party invitation
// pass party leadership
// leave party
// enable shared exp
// create private channel
// channel invite
// channel exclude
// cancel move
// update tile
// update container
void ProtocolGame::sendGetOutfit() void ProtocolGame::sendGetOutfit()
{ {
OutputMessage oMsg; OutputMessage oMsg;
@ -242,6 +396,16 @@ void ProtocolGame::sendRemoveVip(int id)
send(oMsg); send(oMsg);
} }
// bug report
// violation window
// debug assert
// quest log
// quest line
void ProtocolGame::addPosition(OutputMessage& msg, const Position& position) void ProtocolGame::addPosition(OutputMessage& msg, const Position& position)
{ {
msg.addU16(position.x); msg.addU16(position.x);