moved more peer connection notifications to rsEvents

This commit is contained in:
csoler 2019-12-07 21:43:28 +01:00
parent 9790b98605
commit f118b4656e
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
5 changed files with 57 additions and 35 deletions

View file

@ -222,22 +222,26 @@ struct RsConnectionEvent : RsEvent
{
RsConnectionEvent()
: RsEvent(RsEventType::PEER_CONNECTION),
mConnectionType(UNKNOWN) {}
mConnectionInfoCode(UNKNOWN) {}
enum ConnectionType: uint8_t {
UNKNOWN = 0x00,
PEER_CONNECTED = 0x01,
PEER_DISCONNECTED = 0x02,
PEER_TIME_SHIFT = 0x03, // mStrInfo1 = time shift in seconds
PEER_REPORTS_WRONG_IP = 0x04, // mStrInfo1 = address reported, mStrInfo2 = own address
};
ConnectionType mConnectionType;
ConnectionType mConnectionInfoCode;
RsPeerId mSslId;
std::string mStrInfo1;
std::string mStrInfo2;
///* @see RsEvent @see RsSerializable
void serial_process( RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) override
{
RsEvent::serial_process(j, ctx);
RS_SERIAL_PROCESS(mConnectionType);
RS_SERIAL_PROCESS(mConnectionInfoCode);
RS_SERIAL_PROCESS(mSslId);
}
};