From 803db77e497e7a9f373b93afe7e33ce4f67df218 Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Wed, 27 May 2015 22:54:07 -0400 Subject: [PATCH] Added SourceGameContext& to IDemoWriter::WriteNetPacket --- demboyz/conlogwriter.cpp | 4 ++-- demboyz/demowriter.cpp | 4 ++-- demboyz/demreader.cpp | 2 +- demboyz/idemowriter.h | 3 ++- demboyz/jsonwriter.cpp | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/demboyz/conlogwriter.cpp b/demboyz/conlogwriter.cpp index 0a5eccb..30b4f5b 100644 --- a/demboyz/conlogwriter.cpp +++ b/demboyz/conlogwriter.cpp @@ -15,7 +15,7 @@ public: virtual void StartCommandPacket(CommandPacket& packet) override final; virtual void EndCommandPacket() override final; - virtual void WriteNetPacket(NetPacket& packet) override final; + virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; private: 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; NetHandlers::NetMsg_ToString(packet.type, ss, packet.data); diff --git a/demboyz/demowriter.cpp b/demboyz/demowriter.cpp index 696c801..d4f00dd 100644 --- a/demboyz/demowriter.cpp +++ b/demboyz/demowriter.cpp @@ -13,7 +13,7 @@ public: virtual void StartCommandPacket(CommandPacket& packet) 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) @@ -41,6 +41,6 @@ void DemoWriter::EndCommandPacket() { } -void DemoWriter::WriteNetPacket(NetPacket& packet) +void DemoWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context) { } diff --git a/demboyz/demreader.cpp b/demboyz/demreader.cpp index c2b73ae..ef28342 100644 --- a/demboyz/demreader.cpp +++ b/demboyz/demreader.cpp @@ -94,7 +94,7 @@ void ParsePacket(uint8_t* packet, size_t length, SourceGameContext& context, IDe netPacket.type = bitbuf.ReadUBitLong(NETMSG_TYPE_BITS); netPacket.data = netDataStructs[netPacket.type]; NetHandlers::NetMsg_BitRead(netPacket.type, bitbuf, context, netPacket.data); - writer->WriteNetPacket(netPacket); + writer->WriteNetPacket(netPacket, context); } } diff --git a/demboyz/idemowriter.h b/demboyz/idemowriter.h index 1df85d6..9a397b8 100644 --- a/demboyz/idemowriter.h +++ b/demboyz/idemowriter.h @@ -7,6 +7,7 @@ struct democmdinfo_t; struct demoheader_t; struct CommandPacket; struct NetPacket; +struct SourceGameContext; struct CommandPacket { @@ -35,7 +36,7 @@ public: virtual void StartCommandPacket(CommandPacket& packet) = 0; virtual void EndCommandPacket() = 0; - virtual void WriteNetPacket(NetPacket& packet) = 0; + virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) = 0; public: static IDemoWriter* CreateJsonWriter(void* outputFp); diff --git a/demboyz/jsonwriter.cpp b/demboyz/jsonwriter.cpp index 4aac537..1b491a3 100644 --- a/demboyz/jsonwriter.cpp +++ b/demboyz/jsonwriter.cpp @@ -13,7 +13,7 @@ public: virtual void StartCommandPacket(CommandPacket& packet) 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) @@ -41,6 +41,6 @@ void JsonWriter::EndCommandPacket() { } -void JsonWriter::WriteNetPacket(NetPacket& packet) +void JsonWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context) { }