aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-01-02 13:31:50 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-01-02 13:31:50 +0200
commit0e1f448b619de6651205692806c6f137f481dc43 (patch)
tree18f3a224dff6f1c2d37c392a2cc7651664d69970 /src/server.h
parentff82b95800b13d156a59d4936970dc3c8797b14e (diff)
downloadminetest-0e1f448b619de6651205692806c6f137f481dc43.tar.gz
minetest-0e1f448b619de6651205692806c6f137f481dc43.tar.bz2
minetest-0e1f448b619de6651205692806c6f137f481dc43.zip
Texture cache on client (mostly made by sapier) (breaks network compatibility)
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/server.h b/src/server.h
index 129b4ac81..5938f915d 100644
--- a/src/server.h
+++ b/src/server.h
@@ -236,6 +236,28 @@ struct PrioritySortedBlockTransfer
u16 peer_id;
};
+struct TextureRequest
+{
+ std::string name;
+
+ TextureRequest(const std::string &name_=""):
+ name(name_)
+ {}
+};
+
+struct TextureInformation
+{
+ std::string path;
+ std::string sha1_digest;
+
+ TextureInformation(const std::string path_="",
+ const std::string sha1_digest_=""):
+ path(path_),
+ sha1_digest(sha1_digest_)
+ {
+ }
+};
+
class RemoteClient
{
public:
@@ -564,7 +586,11 @@ private:
// Sends blocks to clients (locks env and con on its own)
void SendBlocks(float dtime);
- void SendTextures(u16 peer_id);
+ void PrepareTextures();
+
+ void SendTextureAnnouncement(u16 peer_id);
+
+ void SendTexturesRequested(u16 peer_id,core::list<TextureRequest> tosend);
/*
Something random
@@ -744,6 +770,8 @@ private:
friend class EmergeThread;
friend class RemoteClient;
+
+ std::map<std::string,TextureInformation> m_Textures;
};
/*