LibNRG  0.0.1
Networking for Real-time Games library
 All Classes Files Functions Variables Friends
nrg_replay.h
Go to the documentation of this file.
1 /*
2  LibNRG - Networking for Real-time Games
3 
4  Copyright (C) 2012-2014 Alex Baines <alex@abaines.me.uk>
5 
6  This software is provided 'as-is', without any express or implied
7  warranty. In no event will the authors be held liable for any damages
8  arising from the use of this software.
9 
10  Permission is granted to anyone to use this software for any purpose,
11  including commercial applications, and to alter it and redistribute it
12  freely, subject to the following restrictions:
13 
14  1. The origin of this software must not be misrepresented; you must not
15  claim that you wrote the original software. If you use this software
16  in a product, an acknowledgment in the product documentation would be
17  appreciated but is not required.
18  2. Altered source versions must be plainly marked as such, and must not be
19  misrepresented as being the original software.
20  3. This notice may not be removed or altered from any source distribution.
21 */
25 #ifndef NRG_REPLAY_H
26 #define NRG_REPLAY_H
27 #include "nrg_core.h"
28 #include "nrg_entity.h"
29 
30 #ifdef NRG_ENABLE_ZLIB_COMPRESSION
31 #include <zlib.h>
32 #else
33 typedef void* gzFile;
34 #endif
35 
36 namespace nrg {
37 
40 public:
43 
45  bool startRecording(const char* filename, int sid, const std::vector<Entity*>& initial_entities);
46 
48  bool isRecording() const;
49 
51  void stopRecording();
52 
54  void addPacket(Packet& p);
55 private:
56  gzFile file;
57  int status;
58 };
59 
60 }
61 
62 #endif
Class for storing data to be sent / received across the network.
Definition: nrg_packet.h:58
bool isRecording() const
Returns true if a replay is being recorded.
void stopRecording()
Stops recording a replay.
Contains classes related to nrg's Entity data-replication abstraction.
ReplayRecorder()
Default constructor.
void addPacket(Packet &p)
Adds a packet that will be serialised into the replay file.
Class that writes a replay to a file.
Definition: nrg_replay.h:39
bool startRecording(const char *filename, int sid, const std::vector< Entity * > &initial_entities)
Starts recording a replay !CURRENTLY BROKEN!
Common defines and includes used by all the other nrg header files.