aboutsummaryrefslogtreecommitdiff
path: root/src/network/networkpacket.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2017-01-14 16:48:49 +0100
committersfan5 <sfan5@live.de>2017-01-18 23:21:01 +0100
commit7279f0b37335396c85f6bdd7dc67ff56e53df0f9 (patch)
treebe0ee716cf8bc6e5379415a663db91b8a358c8ab /src/network/networkpacket.h
parentc5967f75f0a9827d1b65b384edd6ba07c73ffd2f (diff)
downloadminetest-7279f0b37335396c85f6bdd7dc67ff56e53df0f9.tar.gz
minetest-7279f0b37335396c85f6bdd7dc67ff56e53df0f9.tar.bz2
minetest-7279f0b37335396c85f6bdd7dc67ff56e53df0f9.zip
Add particle animation, glow
This is implemented by reusing and extending the TileAnimation code for the methods used by particles.
Diffstat (limited to 'src/network/networkpacket.h')
-rw-r--r--src/network/networkpacket.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/networkpacket.h b/src/network/networkpacket.h
index 524470999..3e436aba9 100644
--- a/src/network/networkpacket.h
+++ b/src/network/networkpacket.h
@@ -41,12 +41,15 @@ public:
u16 getPeerId() { return m_peer_id; }
u16 getCommand() { return m_command; }
const u32 getRemainingBytes() const { return m_datasize - m_read_offset; }
+ const char* getRemainingString() { return getString(m_read_offset); }
// Returns a c-string without copying.
// A better name for this would be getRawString()
- char* getString(u32 from_offset);
+ const char* getString(u32 from_offset);
// major difference to putCString(): doesn't write len into the buffer
void putRawString(const char* src, u32 len);
+ void putRawString(const std::string &src)
+ { putRawString(src.c_str(), src.size()); }
NetworkPacket& operator>>(std::string& dst);
NetworkPacket& operator<<(std::string src);