2 (c) 2010 Perttu Ahola <celeron55@gmail.com>
5 #ifndef SERIALIZATION_HEADER
6 #define SERIALIZATION_HEADER
8 #include "common_irrlicht.h"
9 #include "exceptions.h"
14 NOTE: The goal is to increment this so that saved maps will be
15 loadable by any version. Other compatibility is not
17 Serialization format versions:
18 0: original networked test with 1-byte nodes
19 1: update with 2-byte nodes
20 2: lighting is transmitted in param
21 3: optional fetching of far blocks
23 5: sector objects NOTE: block compression was left accidentally out
24 6: failed attempt at switching block compression on again
25 7: block compression switched on again
26 8: (dev) server-initiated block transfers and all kinds of stuff
27 9: (dev) block objects
29 // This represents an uninitialized or invalid format
30 #define SER_FMT_VER_INVALID 255
31 // Highest supported serialization version
32 #define SER_FMT_VER_HIGHEST 9
33 // Lowest supported serialization version
34 #define SER_FMT_VER_LOWEST 0
36 #define ser_ver_supported(v) (v >= SER_FMT_VER_LOWEST && v <= SER_FMT_VER_HIGHEST)
38 void compress(SharedBuffer<u8> data, std::ostream &os, u8 version);
39 void decompress(std::istream &is, std::ostream &os, u8 version);
44 void serialize(std::ostream &os, u8 version) = 0;
45 void deSerialize(std::istream &istr);