Module: RuneRb::Game::World::Synchronization

Included in:
Instance
Defined in:
app/game/world/helpers/synchronization.rb

Overview

Since:

  • 0.9.3

Instance Method Summary collapse

Instance Method Details

#start_sync_serviceObject

Adds a periodic timer which executes the Synchronization#prepare_sync, Synchronization#sync, and Synchronization#post_sync functions every 600 ms.

Since:

  • 0.9.3


4
5
6
7
8
9
10
11
12
# File 'app/game/world/helpers/synchronization.rb', line 4

def start_sync_service
  EventMachine.add_periodic_timer(0.600) do
    unless @entities[:players].empty? && @entities[:mobs].empty?
      prepare_sync
      sync
      complete_sync
    end
  end
end