mirror of
https://github.com/nostar/urfd.git
synced 2026-11-08 12:26:46 +00:00
Add handler for YSFO too
This commit is contained in:
1 parent
699fd6c30d
commit
f3008f402a
2 files changed
+13
-1
No files matched your search
@@ -192,7 +192,11 @@ void CYsfProtocol::Task(void)
|
||||
}
|
||||
else if ( IsValidAckPacket(Buffer) )
|
||||
{
|
||||
std::cout << "YSF valid/ack packet received from " << Ip << std::endl;
|
||||
// Do nothing
|
||||
}
|
||||
else if ( IsValidOptionsPacket(Buffer) )
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -908,6 +912,13 @@ bool CYsfProtocol::IsValidAckPacket(const CBuffer &Buffer) const
|
||||
return ( (Buffer.size() >= 4) && (Buffer.Compare(tag, sizeof(tag)) == 0) );
|
||||
}
|
||||
|
||||
bool CYsfProtocol::IsValidOptionsPacket(const CBuffer &Buffer) const
|
||||
{
|
||||
uint8_t tag[] = { 'Y','S','F','O' };
|
||||
|
||||
return ( (Buffer.size() >= 4) && (Buffer.Compare(tag, sizeof(tag)) == 0) );
|
||||
}
|
||||
|
||||
// server status packet encoding helpers
|
||||
|
||||
bool CYsfProtocol::EncodeServerStatusPacket(CBuffer *Buffer) const
|
||||
|
||||
@@ -103,6 +103,7 @@ protected:
|
||||
bool IsValidServerStatusPacket(const CBuffer &) const;
|
||||
bool IsValidInfoPacket(const CBuffer &) const;
|
||||
bool IsValidAckPacket(const CBuffer &) const;
|
||||
bool IsValidOptionsPacket(const CBuffer &) const;
|
||||
uint32_t CalcHash(const uint8_t *, int) const;
|
||||
|
||||
// server status packet encoding helpers
|
||||
|
||||
Reference in new issue
Block a user