mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
Multi-protocol
Lots of chagnes to add multi protocol flexibility, not really completed yet, still have to rework text messages opcodes and other stuff, so this still a working in progress feature * Rework dat reader, the dat reader can now * dinamically detect dat version * Split game into gamelib and game_interface * Lots of other minor changes
This commit is contained in:
@@ -86,7 +86,7 @@ std::string InputMessage::getString()
|
||||
return std::string(v, stringLength);
|
||||
}
|
||||
|
||||
void InputMessage::decryptRSA(int size, const std::string& p, const std::string& q, const std::string& d)
|
||||
void InputMessage::decryptRsa(int size, const std::string& p, const std::string& q, const std::string& d)
|
||||
{
|
||||
checkRead(size);
|
||||
RSA::decrypt((char*)m_buffer + m_readPos, size, p.c_str(), q.c_str(), d.c_str());
|
||||
|
@@ -40,6 +40,7 @@ public:
|
||||
void setBuffer(const std::string& buffer);
|
||||
|
||||
void skipBytes(uint16 bytes) { m_readPos += bytes; }
|
||||
void setReadPos(uint16 readPos) { m_readPos = readPos; }
|
||||
uint8 getU8();
|
||||
uint16 getU16();
|
||||
uint32 getU32();
|
||||
@@ -51,9 +52,10 @@ public:
|
||||
uint32 peekU32() { uint32 v = getU32(); m_readPos-=4; return v; }
|
||||
uint64 peekU64() { uint64 v = getU64(); m_readPos-=8; return v; }
|
||||
|
||||
void decryptRSA(int size, const std::string& p, const std::string& q, const std::string& d);
|
||||
void decryptRsa(int size, const std::string& p, const std::string& q, const std::string& d);
|
||||
|
||||
int getReadSize() { return m_readPos - m_headerPos; }
|
||||
int getReadPos() { return m_readPos; }
|
||||
int getUnreadSize() { return m_messageSize - (m_readPos - m_headerPos); }
|
||||
uint16 getMessageSize() { return m_messageSize; }
|
||||
|
||||
|
@@ -89,7 +89,7 @@ void OutputMessage::addPaddingBytes(int bytes, uint8 byte)
|
||||
m_messageSize += bytes;
|
||||
}
|
||||
|
||||
void OutputMessage::encryptRSA(int size, const std::string& key)
|
||||
void OutputMessage::encryptRsa(int size, const std::string& key)
|
||||
{
|
||||
if(m_messageSize < size)
|
||||
throw stdext::exception("insufficient bytes in buffer to encrypt");
|
||||
|
@@ -49,7 +49,7 @@ public:
|
||||
void addString(const std::string& buffer);
|
||||
void addPaddingBytes(int bytes, uint8 byte = 0);
|
||||
|
||||
void encryptRSA(int size, const std::string& key);
|
||||
void encryptRsa(int size, const std::string& key);
|
||||
|
||||
uint16 getMessageSize() { return m_messageSize; }
|
||||
|
||||
|
Reference in New Issue
Block a user