missing files
* add questlog icon * add playertrade otui * some protocol changes for extended messages
This commit is contained in:
parent
0fbd196c55
commit
02c5e7b8ff
|
@ -1,3 +1,6 @@
|
|||
class UIWidget
|
||||
end
|
||||
|
||||
class g_game
|
||||
def self.login() end
|
||||
def self.logout() end
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
TradeWindow < MiniWindow
|
||||
!text: tr('Trade')
|
||||
height: 150
|
||||
|
||||
UIItem
|
||||
id: tradeItem
|
||||
virtual: true
|
||||
item-id: 3253
|
||||
size: 32 32
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
margin-top: -6
|
||||
margin-left: -6
|
||||
|
||||
MiniWindowContents
|
||||
padding: 6
|
||||
|
||||
FlatPanel
|
||||
id: ownTradeContainer
|
||||
anchors.fill: parent
|
||||
anchors.right: parent.horizontalCenter
|
||||
margin-right: 2
|
||||
layout:
|
||||
type: grid
|
||||
cell-size: 40 40
|
||||
flow: true
|
||||
cell-spacing: 0
|
||||
|
||||
FlatPanel
|
||||
id: counterTradeContainer
|
||||
anchors.fill: parent
|
||||
anchors.left: parent.horizontalCenter
|
||||
margin-left: 2
|
||||
layout:
|
||||
type: grid
|
||||
cell-size: 40 40
|
||||
flow: true
|
||||
cell-spacing: 0
|
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
|
@ -65,21 +65,20 @@ void OutputMessage::addU64(uint64 value)
|
|||
m_messageSize += 8;
|
||||
}
|
||||
|
||||
void OutputMessage::addString(const char* value)
|
||||
void OutputMessage::addString(const char* value, int length)
|
||||
{
|
||||
size_t stringLength = strlen(value);
|
||||
if(stringLength > 65535)
|
||||
if(length > 65535)
|
||||
throw NetworkException("[OutputMessage::addString] string length > 65535");
|
||||
checkWrite(stringLength + 2);
|
||||
addU16(stringLength);
|
||||
strcpy((char*)(m_buffer + m_writePos), value);
|
||||
m_writePos += stringLength;
|
||||
m_messageSize += stringLength;
|
||||
checkWrite(length + 2);
|
||||
addU16(length);
|
||||
memcpy((char*)(m_buffer + m_writePos), value, length);
|
||||
m_writePos += length;
|
||||
m_messageSize += length;
|
||||
}
|
||||
|
||||
void OutputMessage::addString(const std::string &value)
|
||||
void OutputMessage::addString(const std::string& value)
|
||||
{
|
||||
addString(value.c_str());
|
||||
addString(value.c_str(), value.length());
|
||||
}
|
||||
|
||||
void OutputMessage::addPaddingBytes(int bytes, uint8 byte)
|
||||
|
|
|
@ -49,8 +49,8 @@ public:
|
|||
void addU16(uint16 value);
|
||||
void addU32(uint32 value);
|
||||
void addU64(uint64 value);
|
||||
void addString(const char* value);
|
||||
void addString(const std::string &value);
|
||||
void addString(const char* value, int length);
|
||||
void addString(const std::string& value);
|
||||
void addPaddingBytes(int bytes, uint8 byte = 0);
|
||||
|
||||
uint8* getBuffer() { return m_buffer; }
|
||||
|
|
|
@ -145,7 +145,8 @@ namespace Proto {
|
|||
GameServerQuestLine = 241,
|
||||
GameServerChannelEvent = 243,
|
||||
GameServerObjectInfo = 244,
|
||||
GameServerPlayerInventory = 245
|
||||
GameServerPlayerInventory = 245,
|
||||
GameServerExtendedOpcode = 254 // otclient only
|
||||
};
|
||||
|
||||
enum ClientOpts {
|
||||
|
@ -221,6 +222,7 @@ namespace Proto {
|
|||
ClientRequestQuestLine = 241,
|
||||
//ClientRuleViolationReport = 242,
|
||||
//ClientGetObjectInfo = 243
|
||||
ClientExtendedOpcode = 254 // otclient only
|
||||
};
|
||||
|
||||
enum ServerSpeakType {
|
||||
|
|
|
@ -103,6 +103,7 @@ public:
|
|||
void sendDebugReport(const std::string& a, const std::string& b, const std::string& c, const std::string& d);
|
||||
void sendRequestQuestLog();
|
||||
void sendRequestQuestLine(int questId);
|
||||
void sendExtendedOpcode(uint8 opcode, const std::string& buffer);
|
||||
|
||||
private:
|
||||
void sendLoginPacket(uint timestamp, uint8 unknown);
|
||||
|
@ -183,6 +184,7 @@ private:
|
|||
void parseAutomapFlag(InputMessage& msg);
|
||||
void parseQuestLog(InputMessage& msg);
|
||||
void parseQuestLine(InputMessage& msg);
|
||||
void parseExtendedOpcode(InputMessage& msg);
|
||||
|
||||
void setMapDescription(InputMessage& msg, int x, int y, int z, int width, int height);
|
||||
void setFloorDescription(InputMessage& msg, int x, int y, int z, int width, int height, int offset, int* skipTiles);
|
||||
|
|
|
@ -37,9 +37,9 @@ void ProtocolGame::parseMessage(InputMessage& msg)
|
|||
{
|
||||
try {
|
||||
while(!msg.eof()) {
|
||||
int opt = msg.getU8();
|
||||
int opcode = msg.getU8();
|
||||
|
||||
switch(opt) {
|
||||
switch(opcode) {
|
||||
case Proto::GameServerInitGame:
|
||||
parseInitGame(msg);
|
||||
break;
|
||||
|
@ -264,8 +264,11 @@ void ProtocolGame::parseMessage(InputMessage& msg)
|
|||
//case Proto::GameServerChannelEvent:
|
||||
//case Proto::GameServerObjectInfo:
|
||||
//case Proto::GameServerPlayerInventory:
|
||||
case Proto::GameServerExtendedOpcode: // additional opcode used by otclient
|
||||
parseExtendedOpcode(msg);
|
||||
break;
|
||||
default:
|
||||
Fw::throwException("unknown opt byte ", (int)opt);
|
||||
Fw::throwException("unknown opcode ", opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1079,6 +1082,14 @@ void ProtocolGame::parseQuestLine(InputMessage& msg)
|
|||
g_game.processQuestLine(questId, questMissions);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseExtendedOpcode(InputMessage& msg)
|
||||
{
|
||||
int opcode = msg.getU8();
|
||||
std::string buffer = msg.getString();
|
||||
|
||||
callLuaField("onExtendedOpcode", opcode, buffer);
|
||||
}
|
||||
|
||||
void ProtocolGame::setMapDescription(InputMessage& msg, int32 x, int32 y, int32 z, int32 width, int32 height)
|
||||
{
|
||||
int startz, endz, zstep, skip = 0;
|
||||
|
|
|
@ -649,6 +649,15 @@ void ProtocolGame::sendRequestQuestLine(int questId)
|
|||
send(msg);
|
||||
}
|
||||
|
||||
void ProtocolGame::sendExtendedOpcode(uint8 opcode, const std::string& buffer)
|
||||
{
|
||||
OutputMessage msg;
|
||||
msg.addU8(Proto::ClientExtendedOpcode);
|
||||
msg.addU8(opcode);
|
||||
msg.addString(buffer);
|
||||
send(msg);
|
||||
}
|
||||
|
||||
void ProtocolGame::addPosition(OutputMessage& msg, const Position& position)
|
||||
{
|
||||
msg.addU16(position.x);
|
||||
|
|
|
@ -55,8 +55,8 @@ void ProtocolLogin::onRecv(InputMessage& inputMessage)
|
|||
{
|
||||
try {
|
||||
while(!inputMessage.eof()) {
|
||||
int opt = inputMessage.getU8();
|
||||
switch(opt) {
|
||||
int opcode = inputMessage.getU8();
|
||||
switch(opcode) {
|
||||
case Proto::LoginServerError:
|
||||
parseError(inputMessage);
|
||||
break;
|
||||
|
@ -70,7 +70,7 @@ void ProtocolLogin::onRecv(InputMessage& inputMessage)
|
|||
parseCharacterList(inputMessage);
|
||||
break;
|
||||
default:
|
||||
Fw::throwException("unknown opt byte ", opt);
|
||||
Fw::throwException("unknown opt byte ", opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue