summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/main.lua6
-rw-r--r--common/map.lua3
2 files changed, 3 insertions, 6 deletions
diff --git a/client/main.lua b/client/main.lua
index d6f9e60..43705fe 100644
--- a/client/main.lua
+++ b/client/main.lua
@@ -1,8 +1,9 @@
local enet = require"enet"
local json = require"common.dkjson"
--- local SERVER_HOSTNAME = "ubq323.website"
-local SERVER_HOSTNAME = "localhost"
+
+local SERVER_HOSTNAME = "ubq323.website"
+if os.getenv"HEXEMU_LOCAL" then SERVER_HOSTNAME = "localhost" end
local PLAYER_SIZE = 0.7
local local_player = nil
@@ -109,7 +110,6 @@ function love.update(dt)
-- load chunks near to player (within 3x3 square)
for _,cp in ipairs(player_cp:neighborhood()) do
if map:chunk(cp) == nil then
- print("sending chunk request",cp)
map:mark_chunk_loading(cp)
peer:send(json.encode{t="reqchunk",u=cp.u,v=cp.v})
end
diff --git a/common/map.lua b/common/map.lua
index 64d353c..1028982 100644
--- a/common/map.lua
+++ b/common/map.lua
@@ -23,15 +23,12 @@ function Map._set_chunk(self,cp,value)
end
function Map.add_chunk(self,the_chunk)
local cp = the_chunk.cp
- print("adding chunk",cp)
self:_set_chunk(cp,the_chunk)
end
function Map.mark_chunk_loading(self,cp)
- print("marking chunk as loading",cp)
self:_set_chunk(cp,false)
end
function Map.remove_chunk(self,cp)
- print("removing chunk",cp)
if not self.chunks[cp.u] then return end
self.chunks[cp.u][cp.v] = nil
-- remove list if empty