Run IBRU island tick from network loop
This commit is contained in:
1 parent
5804acfcec
commit
89f0da185b
1 file changed
+7
-13
@@ -226,6 +226,12 @@ if defined?(WebSocket)
|
|||||||
ibru_parse_without(message)
|
ibru_parse_without(message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias ibru_disconnect_without disconnect unless method_defined?(:ibru_disconnect_without)
|
||||||
|
def disconnect(*args, &block)
|
||||||
|
MPIslandVoyage.set_active(false)
|
||||||
|
ibru_disconnect_without(*args, &block)
|
||||||
|
end
|
||||||
|
|
||||||
alias ibru_noclip_without admin_noclip_enabled? unless method_defined?(:ibru_noclip_without)
|
alias ibru_noclip_without admin_noclip_enabled? unless method_defined?(:ibru_noclip_without)
|
||||||
def admin_noclip_enabled?
|
def admin_noclip_enabled?
|
||||||
MPIslandVoyage.noclip? || ibru_noclip_without
|
MPIslandVoyage.noclip? || ibru_noclip_without
|
||||||
@@ -263,6 +269,7 @@ if defined?(MPGodMode)
|
|||||||
alias ibru_tick_without tick unless method_defined?(:ibru_tick_without)
|
alias ibru_tick_without tick unless method_defined?(:ibru_tick_without)
|
||||||
def tick
|
def tick
|
||||||
ibru_tick_without
|
ibru_tick_without
|
||||||
|
MPIslandVoyage.tick
|
||||||
if MPIslandVoyage.active? && WebSocket.bootstrap_sync_unlocked? && (!@ibru_hello_at || Time.now.to_f - @ibru_hello_at > 10)
|
if MPIslandVoyage.active? && WebSocket.bootstrap_sync_unlocked? && (!@ibru_hello_at || Time.now.to_f - @ibru_hello_at > 10)
|
||||||
@ibru_hello_at = Time.now.to_f
|
@ibru_hello_at = Time.now.to_f
|
||||||
WebSocket.send_line('god_hello:1')
|
WebSocket.send_line('god_hello:1')
|
||||||
@@ -272,19 +279,6 @@ if defined?(MPGodMode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if defined?(Scene_Map)
|
|
||||||
class Scene_Map
|
|
||||||
# A script reload must not alias our own wrapper: that would recurse until
|
|
||||||
# SystemStackError on this frame's call to ibru_update_without.
|
|
||||||
alias ibru_update_without update unless method_defined?(:ibru_update_without)
|
|
||||||
def update(*args, &block)
|
|
||||||
result = ibru_update_without(*args, &block)
|
|
||||||
MPIslandVoyage.tick
|
|
||||||
result
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Keep the island tools in the existing VIP overlay, without granting OWNER.
|
# Keep the island tools in the existing VIP overlay, without granting OWNER.
|
||||||
if defined?(Scene_Map) && Scene_Map.method_defined?(:mp_admin_open_root)
|
if defined?(Scene_Map) && Scene_Map.method_defined?(:mp_admin_open_root)
|
||||||
class Scene_Map
|
class Scene_Map
|
||||||
|
|||||||
Reference in new issue
Block a user