noita_entangled_worlds/quant.ew/files/src/system/proxy_info.lua

30 lines
819 B
Lua
Raw Normal View History

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()
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)
2024-07-15 21:27:15 +03:00
if x ~= nil and y ~= nil then
net.proxy_send("peer_pos", peer_id.." "..x.." "..y)
end
2024-06-21 19:06:40 +03:00
end
end
2024-07-23 14:43:56 +03:00
return module