2024-06-21 19:06:40 +03:00
|
|
|
local world_ffi = require("noitapatcher.nsew.world_ffi")
|
|
|
|
local world = require("noitapatcher.nsew.world")
|
|
|
|
local rect = require("noitapatcher.nsew.rect")
|
|
|
|
local ffi = require("ffi")
|
|
|
|
|
|
|
|
local ctx = dofile_once("mods/quant.ew/files/src/ctx.lua")
|
|
|
|
local net = dofile_once("mods/quant.ew/files/src/net.lua")
|
|
|
|
local player_fns = dofile_once("mods/quant.ew/files/src/player_fns.lua")
|
|
|
|
|
|
|
|
local module = {}
|
|
|
|
|
|
|
|
local KEY_WORLD_FRAME = 0
|
|
|
|
local KEY_WORLD_END = 1
|
|
|
|
|
|
|
|
local CHUNK_SIZE = 128
|
|
|
|
|
2024-06-21 20:18:01 +03:00
|
|
|
function module.on_world_update()
|
2024-06-21 19:19:49 +03:00
|
|
|
if GameGetFrameNum() % 30 ~= 6 then
|
2024-06-21 19:06:40 +03:00
|
|
|
return
|
|
|
|
end
|
|
|
|
for peer_id, player_data in pairs(ctx.players) do
|
|
|
|
local x, y = EntityGetTransform(player_data.entity)
|
|
|
|
net.proxy_send("peer_pos", peer_id.." "..x.." "..y)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return module
|