Added SourceGameContext& to IDemoWriter::WriteNetPacket

This commit is contained in:
Jordan Cristiano 2015-05-27 22:54:07 -04:00
parent d9df1117f5
commit 803db77e49
5 changed files with 9 additions and 8 deletions

View File

@ -15,7 +15,7 @@ public:
virtual void StartCommandPacket(CommandPacket& packet) override final; virtual void StartCommandPacket(CommandPacket& packet) override final;
virtual void EndCommandPacket() override final; virtual void EndCommandPacket() override final;
virtual void WriteNetPacket(NetPacket& packet) override final; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final;
private: private:
FILE* m_outputFp; FILE* m_outputFp;
@ -54,7 +54,7 @@ void ConLogWriter::EndCommandPacket()
{ {
} }
void ConLogWriter::WriteNetPacket(NetPacket& packet) void ConLogWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context)
{ {
std::ostringstream ss; std::ostringstream ss;
NetHandlers::NetMsg_ToString(packet.type, ss, packet.data); NetHandlers::NetMsg_ToString(packet.type, ss, packet.data);

View File

@ -13,7 +13,7 @@ public:
virtual void StartCommandPacket(CommandPacket& packet) override final; virtual void StartCommandPacket(CommandPacket& packet) override final;
virtual void EndCommandPacket() override final; virtual void EndCommandPacket() override final;
virtual void WriteNetPacket(NetPacket& packet) override final; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final;
}; };
IDemoWriter* IDemoWriter::CreateDemoWriter(void* outputFp) IDemoWriter* IDemoWriter::CreateDemoWriter(void* outputFp)
@ -41,6 +41,6 @@ void DemoWriter::EndCommandPacket()
{ {
} }
void DemoWriter::WriteNetPacket(NetPacket& packet) void DemoWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context)
{ {
} }

View File

@ -94,7 +94,7 @@ void ParsePacket(uint8_t* packet, size_t length, SourceGameContext& context, IDe
netPacket.type = bitbuf.ReadUBitLong(NETMSG_TYPE_BITS); netPacket.type = bitbuf.ReadUBitLong(NETMSG_TYPE_BITS);
netPacket.data = netDataStructs[netPacket.type]; netPacket.data = netDataStructs[netPacket.type];
NetHandlers::NetMsg_BitRead(netPacket.type, bitbuf, context, netPacket.data); NetHandlers::NetMsg_BitRead(netPacket.type, bitbuf, context, netPacket.data);
writer->WriteNetPacket(netPacket); writer->WriteNetPacket(netPacket, context);
} }
} }

View File

@ -7,6 +7,7 @@ struct democmdinfo_t;
struct demoheader_t; struct demoheader_t;
struct CommandPacket; struct CommandPacket;
struct NetPacket; struct NetPacket;
struct SourceGameContext;
struct CommandPacket struct CommandPacket
{ {
@ -35,7 +36,7 @@ public:
virtual void StartCommandPacket(CommandPacket& packet) = 0; virtual void StartCommandPacket(CommandPacket& packet) = 0;
virtual void EndCommandPacket() = 0; virtual void EndCommandPacket() = 0;
virtual void WriteNetPacket(NetPacket& packet) = 0; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) = 0;
public: public:
static IDemoWriter* CreateJsonWriter(void* outputFp); static IDemoWriter* CreateJsonWriter(void* outputFp);

View File

@ -13,7 +13,7 @@ public:
virtual void StartCommandPacket(CommandPacket& packet) override final; virtual void StartCommandPacket(CommandPacket& packet) override final;
virtual void EndCommandPacket() override final; virtual void EndCommandPacket() override final;
virtual void WriteNetPacket(NetPacket& packet) override final; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final;
}; };
IDemoWriter* IDemoWriter::CreateJsonWriter(void* outputFp) IDemoWriter* IDemoWriter::CreateJsonWriter(void* outputFp)
@ -41,6 +41,6 @@ void JsonWriter::EndCommandPacket()
{ {
} }
void JsonWriter::WriteNetPacket(NetPacket& packet) void JsonWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context)
{ {
} }