mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
fix(minimap): use existing player_position channel for join start event
Replace unsupported minimap:player_session_start IPC with existing minimap:player_position channel to emit immediate session start on join.
This commit is contained in:
1 parent
e28b4121e3
commit
9375c462af
1 file changed
+5
-2
@@ -127,14 +127,17 @@ local function on_player_joined_game(event)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Emit session start immediately when player joins
|
-- Emit session start immediately when player joins using existing player_position channel
|
||||||
local surface = player.physical_surface or player.surface
|
local surface = player.physical_surface or player.surface
|
||||||
|
local position = player.physical_position or player.position
|
||||||
local player_data = {
|
local player_data = {
|
||||||
player_name = player.name,
|
player_name = player.name,
|
||||||
surface = surface.name,
|
surface = surface.name,
|
||||||
|
x = position.x,
|
||||||
|
y = position.y,
|
||||||
sec = math_floor(game.tick / 60),
|
sec = math_floor(game.tick / 60),
|
||||||
}
|
}
|
||||||
clusterio_api.send_json("minimap:player_session_start", player_data)
|
send_player_position_data(player_data)
|
||||||
|
|
||||||
-- Clear any existing position data for this player to ensure fresh tracking
|
-- Clear any existing position data for this player to ensure fresh tracking
|
||||||
if storage.minimap.player_positions then
|
if storage.minimap.player_positions then
|
||||||
|
|||||||
Reference in new issue
Block a user