teien 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -4
- data/bin/teien +5 -1
- data/lib/teien/animation/animation_manager.rb +2 -2
- data/lib/teien/animation/animation_manager_proxy.rb +2 -2
- data/lib/teien/application/local_application.rb +12 -0
- data/lib/teien/application/proxy_application.rb +28 -0
- data/lib/teien/application/server_application.rb +28 -0
- data/lib/teien/base_object/base_object_manager.rb +2 -4
- data/lib/teien/base_object/base_object_manager_base.rb +3 -3
- data/lib/teien/base_object/base_object_manager_proxy.rb +2 -4
- data/lib/teien/base_object/physics.rb +8 -9
- data/lib/teien/core/component_manager.rb +3 -1
- data/lib/teien/core/event_router.rb +33 -7
- data/lib/teien/core/network.rb +4 -0
- data/lib/teien/ui/user_interface.rb +3 -5
- data/lib/teien/ui/view.rb +7 -4
- data/lib/teien/version.rb +1 -1
- data/samples/actor/client +2 -0
- data/{mods/actor/configs → samples/actor/config}/plugins.cfg +0 -0
- data/{mods/actor/configs → samples/actor/config}/resources.cfg +0 -0
- data/samples/actor/lib/client.rb +38 -0
- data/{mods/actor/apps/common/browser_event.rb → samples/actor/lib/event.rb} +3 -2
- data/samples/actor/lib/local.rb +63 -0
- data/{mods/actor/apps/server/server_application.rb → samples/actor/lib/model.rb} +15 -16
- data/samples/actor/lib/server.rb +37 -0
- data/{mods/actor/addons/sinbad → samples/actor}/lib/sinbad/sinbad_info.rb +1 -0
- data/{mods/actor/addons/sinbad → samples/actor}/lib/sinbad/sinbad_state.rb +0 -0
- data/{mods/actor/addons/sinbad → samples/actor}/lib/sinbad.rb +1 -0
- data/{mods/actor/apps/browser/browser_application.rb → samples/actor/lib/ui.rb} +13 -27
- data/samples/actor/local +2 -0
- data/samples/actor/server +2 -0
- data/samples/hello_garden/client +2 -0
- data/{mods/hello_garden/configs → samples/hello_garden/config}/plugins.cfg +0 -0
- data/{mods/hello_garden/configs → samples/hello_garden/config}/resources.cfg +0 -0
- data/samples/hello_garden/lib/client.rb +41 -0
- data/{mods/hello_garden/apps/common/browser_event.rb → samples/hello_garden/lib/event.rb} +3 -2
- data/samples/hello_garden/lib/local.rb +56 -0
- data/{mods/hello_garden/apps/server/server_application.rb → samples/hello_garden/lib/model.rb} +22 -22
- data/samples/hello_garden/lib/server.rb +34 -0
- data/{mods/hello_garden/apps/browser/browser_application.rb → samples/hello_garden/lib/ui.rb} +14 -26
- data/samples/hello_garden/local +2 -0
- data/samples/hello_garden/server +2 -0
- metadata +42 -37
- data/lib/teien/addon/addon.rb +0 -25
- data/lib/teien/application/application.rb +0 -43
- data/lib/teien/commands/browser_command.rb +0 -46
- data/lib/teien/commands/local_command.rb +0 -21
- data/lib/teien/commands/server_command.rb +0 -39
- data/lib/teien/commands/std_command.rb +0 -71
- data/lib/teien/core/launcher.rb +0 -31
- data/mods/actor/commands/ai/actor_ai.rb +0 -117
- data/mods/actor/commands/ai_command.rb +0 -20
- data/mods/hello_garden/run +0 -6
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
$ gem install ruby-procedural
|
21
21
|
$ gem install ruby-bullet
|
22
22
|
$ gem install teienlib
|
23
|
-
$ gem build
|
23
|
+
$ gem build teien.gemspec
|
24
24
|
$ gem install teien-<version>.gem
|
25
25
|
|
26
26
|
## Usage
|
@@ -28,9 +28,9 @@ Or install it yourself as:
|
|
28
28
|
Run a sample application.
|
29
29
|
|
30
30
|
$ mkdir mywork/
|
31
|
-
$ cp -r <gems>/teien-<version>/
|
32
|
-
$ cd mywork/
|
33
|
-
$
|
31
|
+
$ cp -r <gems>/teien-<version>/samples/ mywork/
|
32
|
+
$ cd mywork/samples/hello_garden/
|
33
|
+
$ ./local
|
34
34
|
|
35
35
|
## Contributing
|
36
36
|
|
data/bin/teien
CHANGED
@@ -46,12 +46,16 @@ end
|
|
46
46
|
|
47
47
|
$LOAD_PATH.push(lib_path)
|
48
48
|
|
49
|
+
load ARGV[0]
|
50
|
+
|
51
|
+
=begin
|
49
52
|
require "teien/core/launcher.rb"
|
50
53
|
|
51
54
|
# include standard commands.
|
52
55
|
require "teien/commands/browser_command"
|
53
56
|
require "teien/commands/server_command"
|
54
57
|
require "teien/commands/local_command"
|
58
|
+
require "teien/commands/new_command"
|
55
59
|
|
56
60
|
# include user commands.
|
57
61
|
Dir.glob("#{Dir.getwd}/commands/*.rb") {|file|
|
@@ -59,4 +63,4 @@ Dir.glob("#{Dir.getwd}/commands/*.rb") {|file|
|
|
59
63
|
}
|
60
64
|
|
61
65
|
Teien::Launcher::launch(ARGV)
|
62
|
-
|
66
|
+
=end
|
@@ -6,9 +6,9 @@ module Teien
|
|
6
6
|
class AnimationManager
|
7
7
|
attr_accessor :animations
|
8
8
|
|
9
|
-
def initialize(
|
9
|
+
def initialize()
|
10
10
|
@animations = Hash.new
|
11
|
-
@event_router = event_router
|
11
|
+
@event_router = Teien::get_component("event_router")
|
12
12
|
@event_router.register_receiver(self)
|
13
13
|
end
|
14
14
|
|
@@ -6,9 +6,9 @@ module Teien
|
|
6
6
|
class AnimationManagerProxy
|
7
7
|
attr_accessor :animations
|
8
8
|
|
9
|
-
def initialize(
|
9
|
+
def initialize()
|
10
10
|
@animations = Hash.new
|
11
|
-
@event_router = event_router
|
11
|
+
@event_router = Teien::get_component("event_router")
|
12
12
|
@event_router.register_receiver(self)
|
13
13
|
end
|
14
14
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Teien
|
2
|
+
|
3
|
+
class ProxyApplication
|
4
|
+
def initialize()
|
5
|
+
require 'teien'
|
6
|
+
|
7
|
+
@event_router = Teien::EventRouter.new()
|
8
|
+
Teien::register_component("event_router", @event_router)
|
9
|
+
|
10
|
+
require "teien/base_object/base_object_manager_proxy"
|
11
|
+
@base_object_manager = Teien::BaseObjectManagerProxy.new()
|
12
|
+
Teien::register_component("base_object_manager", @base_object_manager)
|
13
|
+
|
14
|
+
require 'teien/animation/animation_manager_proxy'
|
15
|
+
@animation_manager = Teien::AnimationManagerProxy.new()
|
16
|
+
Teien::register_component("animation_manager", @animation_manager)
|
17
|
+
|
18
|
+
require 'teien/actor/actor_manager_proxy'
|
19
|
+
@actor_manager = Teien::ActorManagerProxy.new()
|
20
|
+
Teien::register_component("actor_manager", @actor_manager)
|
21
|
+
end
|
22
|
+
|
23
|
+
def connect_to_server(ip, port)
|
24
|
+
@event_router.connect_to_server(ip, port)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Teien
|
2
|
+
|
3
|
+
class ServerApplication
|
4
|
+
def initialize(sync_period = 0.3)
|
5
|
+
require 'teien'
|
6
|
+
|
7
|
+
@event_router = Teien::EventRouter.new()
|
8
|
+
Teien::register_component("event_router", @event_router)
|
9
|
+
|
10
|
+
require "teien/base_object/base_object_manager"
|
11
|
+
@base_object_manager = Teien::BaseObjectManager.new(sync_period)
|
12
|
+
Teien::register_component("base_object_manager", @base_object_manager)
|
13
|
+
|
14
|
+
require 'teien/animation/animation_manager'
|
15
|
+
@animation_manager = Teien::AnimationManager.new()
|
16
|
+
Teien::register_component("animation_manager", @animation_manager)
|
17
|
+
|
18
|
+
require 'teien/actor/actor_manager'
|
19
|
+
@actor_manager = Teien::ActorManager.new()
|
20
|
+
Teien::register_component("actor_manager", @actor_manager)
|
21
|
+
end
|
22
|
+
|
23
|
+
def start_server(ip, port)
|
24
|
+
@event_router.start_server(ip, port)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -5,16 +5,14 @@ require "teien/base_object/base_object_event.rb"
|
|
5
5
|
module Teien
|
6
6
|
|
7
7
|
class BaseObjectManager < BaseObjectManagerBase
|
8
|
-
def initialize(
|
9
|
-
super(
|
8
|
+
def initialize(sync_period)
|
9
|
+
super()
|
10
10
|
@sync_period = sync_period
|
11
11
|
@sync_timer = sync_period
|
12
12
|
end
|
13
13
|
|
14
14
|
# EventRouter handler
|
15
15
|
def setup()
|
16
|
-
|
17
|
-
@physics.setup(self)
|
18
16
|
end
|
19
17
|
|
20
18
|
# EventRouter handler
|
@@ -23,15 +23,15 @@ class BaseObjectManagerBase
|
|
23
23
|
#
|
24
24
|
# _script_klass_:: : set a user define class.
|
25
25
|
#
|
26
|
-
def initialize(
|
26
|
+
def initialize()
|
27
27
|
super()
|
28
28
|
|
29
29
|
puts "initialize base_object_manager_base"
|
30
30
|
|
31
|
-
@event_router = event_router
|
31
|
+
@event_router = Teien::get_component("event_router")
|
32
32
|
@event_router.register_receiver(self)
|
33
33
|
|
34
|
-
@physics = Physics.new()
|
34
|
+
@physics = Physics.new(self)
|
35
35
|
|
36
36
|
@objects = {}
|
37
37
|
@object_num = 0
|
@@ -5,15 +5,13 @@ require "teien/base_object/base_object_event.rb"
|
|
5
5
|
module Teien
|
6
6
|
|
7
7
|
class BaseObjectManagerProxy < BaseObjectManagerBase
|
8
|
-
def initialize(
|
9
|
-
super(
|
8
|
+
def initialize()
|
9
|
+
super()
|
10
10
|
@quit = false
|
11
11
|
end
|
12
12
|
|
13
13
|
# EventRouter handler
|
14
14
|
def setup()
|
15
|
-
@physics.setup(self)
|
16
|
-
return true
|
17
15
|
end
|
18
16
|
|
19
17
|
# EventRouter handler
|
@@ -30,21 +30,15 @@ class Physics < Bullet::TickListener
|
|
30
30
|
attr_accessor :fixed_time_step
|
31
31
|
# attr_accessor :softBodyWorldInfo
|
32
32
|
|
33
|
-
def initialize()
|
33
|
+
def initialize(object_manager)
|
34
34
|
super()
|
35
35
|
|
36
36
|
@rigid_bodies = []
|
37
37
|
|
38
38
|
@max_sub_steps = 1
|
39
39
|
@fixed_time_step = 1.0 / 60.0
|
40
|
-
end
|
41
|
-
|
42
|
-
def set_gravity(vec)
|
43
|
-
@dynamics_world.set_gravity(vec)
|
44
|
-
end
|
45
40
|
|
46
|
-
|
47
|
-
@garden = garden
|
41
|
+
@object_manager = object_manager
|
48
42
|
@collision_config = Bullet::BtDefaultCollisionConfiguration.new()
|
49
43
|
@collision_dispatcher = Bullet::BtCollisionDispatcher.new(@collision_config)
|
50
44
|
|
@@ -72,6 +66,11 @@ class Physics < Bullet::TickListener
|
|
72
66
|
softBodyWorldInfo.m_gravity.setValue(0, -9.8, 0)
|
73
67
|
# softBodyWorldInfo.m_sparsesdf.Initialize();
|
74
68
|
=end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
def set_gravity(vec)
|
73
|
+
@dynamics_world.set_gravity(vec)
|
75
74
|
end
|
76
75
|
|
77
76
|
def finalize
|
@@ -140,7 +139,7 @@ class Physics < Bullet::TickListener
|
|
140
139
|
# print "pre_tick_callback: ", timeStep * 1000, "ms\n"
|
141
140
|
delta = Bullet::BtVector3.new(timeStep, timeStep, timeStep)
|
142
141
|
|
143
|
-
@
|
142
|
+
@object_manager.objects.each {|name, obj|
|
144
143
|
if (obj.get_mass() > 0)
|
145
144
|
newVel = obj.get_linear_velocity() + Vector3D.to_bullet(obj.get_acceleration()) * delta
|
146
145
|
obj.set_linear_velocity(obj.limit_velocity(newVel))
|
@@ -50,12 +50,6 @@ class EventRouter
|
|
50
50
|
EM.add_periodic_timer(tick_period) do
|
51
51
|
if @last_time == 0
|
52
52
|
@last_time = Time.now.to_f
|
53
|
-
if ip == nil
|
54
|
-
# dummy connection for alone
|
55
|
-
Network::connections[nil] = RemoteInfo.new(nil)
|
56
|
-
notify(:connection_binded, nil)
|
57
|
-
notify(:connection_completed, nil)
|
58
|
-
end
|
59
53
|
else
|
60
54
|
now = Time.now.to_f
|
61
55
|
delta = now - @last_time
|
@@ -111,6 +105,38 @@ class EventRouter
|
|
111
105
|
end
|
112
106
|
end
|
113
107
|
end
|
114
|
-
end
|
115
108
|
|
109
|
+
def start_application(tick_period = 0.001)
|
110
|
+
notify(:setup)
|
111
|
+
|
112
|
+
@last_time = 0
|
113
|
+
EM.run do
|
114
|
+
EM.add_periodic_timer(tick_period) do
|
115
|
+
if @last_time == 0
|
116
|
+
@last_time = Time.now.to_f
|
117
|
+
|
118
|
+
# dummy connection for local
|
119
|
+
Network::add_dummy_connection(nil)
|
120
|
+
notify(:connection_binded, nil)
|
121
|
+
notify(:connection_completed, nil)
|
122
|
+
else
|
123
|
+
now = Time.now.to_f
|
124
|
+
delta = now - @last_time
|
125
|
+
@last_time = now
|
126
|
+
|
127
|
+
notify(:update, delta)
|
128
|
+
|
129
|
+
if @quit
|
130
|
+
EM.stop
|
131
|
+
Teien::get_component("base_object_manager").finalize()
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
Signal.trap("INT") { EM.stop; Teien::get_component("base_object_manager").finalize() }
|
137
|
+
Signal.trap("TERM") { EM.stop; Teien::get_component("base_object_manager").finalize() }
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
116
142
|
end
|
data/lib/teien/core/network.rb
CHANGED
@@ -4,17 +4,15 @@ require 'teien/ui/view'
|
|
4
4
|
module Teien
|
5
5
|
|
6
6
|
class UserInterface
|
7
|
-
# include Dispatcher
|
8
|
-
|
9
7
|
attr_accessor :base_object_manager
|
10
8
|
attr_accessor :debug_draw
|
11
9
|
|
12
|
-
def initialize(
|
10
|
+
def initialize()
|
13
11
|
super()
|
14
12
|
|
15
|
-
@event_router = event_router
|
13
|
+
@event_router = Teien::get_component("event_router")
|
16
14
|
@event_router.register_receiver(self)
|
17
|
-
@base_object_manager = base_object_manager
|
15
|
+
@base_object_manager = Teien::get_component("base_object_manager")
|
18
16
|
@base_object_manager.register_receiver(self)
|
19
17
|
|
20
18
|
@view = View.new()
|
data/lib/teien/ui/view.rb
CHANGED
@@ -46,14 +46,17 @@ class View < Ogre::FrameListener
|
|
46
46
|
def setup(base_object_manager)
|
47
47
|
puts "view setup"
|
48
48
|
@base_object_manager = base_object_manager
|
49
|
-
@plugins_cfg = @base_object_manager.plugins_cfg ? @base_object_manager.plugins_cfg : "
|
50
|
-
@resources_cfg = @base_object_manager.resources_cfg ? @base_object_manager.resources_cfg : "
|
49
|
+
@plugins_cfg = @base_object_manager.plugins_cfg ? @base_object_manager.plugins_cfg : "config/plugins.cfg"
|
50
|
+
@resources_cfg = @base_object_manager.resources_cfg ? @base_object_manager.resources_cfg : "config/resources.cfg"
|
51
51
|
|
52
52
|
@root = Ogre::Root.new("")
|
53
53
|
load_plugins()
|
54
54
|
|
55
|
-
|
56
|
-
|
55
|
+
if File.exist?("ogre.cfg")
|
56
|
+
return false unless (@root.restore_config())
|
57
|
+
else
|
58
|
+
return false unless (@root.show_config_dialog())
|
59
|
+
end
|
57
60
|
|
58
61
|
@window = @root.initialise(true, @window_title)
|
59
62
|
|
data/lib/teien/version.rb
CHANGED
File without changes
|
File without changes
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "teien"
|
2
|
+
require "teien/application/proxy_application"
|
3
|
+
require_relative 'ui'
|
4
|
+
|
5
|
+
include Teien
|
6
|
+
|
7
|
+
class Client < ProxyApplication
|
8
|
+
include Ui
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
super
|
12
|
+
|
13
|
+
require 'teien/ui/user_interface'
|
14
|
+
@ui = Teien::UserInterface.new
|
15
|
+
Teien::register_component("user_interface", @ui )
|
16
|
+
|
17
|
+
@event_router.register_receiver(self)
|
18
|
+
@ui.register_receiver(self)
|
19
|
+
end
|
20
|
+
|
21
|
+
def setup()
|
22
|
+
ui_setup()
|
23
|
+
end
|
24
|
+
|
25
|
+
def connection_completed(from)
|
26
|
+
ui_connection_completed(from)
|
27
|
+
end
|
28
|
+
|
29
|
+
def update(delta)
|
30
|
+
ui_update(delta)
|
31
|
+
end
|
32
|
+
|
33
|
+
def receive_event(event, from)
|
34
|
+
ui_receive_event(event, from)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
Client.new.connect_to_server("0.0.0.0", 11922)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'teien'
|
2
|
+
require "teien/application/local_application"
|
3
|
+
require_relative 'model'
|
4
|
+
require_relative 'ui'
|
5
|
+
|
6
|
+
include Teien
|
7
|
+
|
8
|
+
class Local < LocalApplication
|
9
|
+
include Model
|
10
|
+
include Ui
|
11
|
+
|
12
|
+
def initialize(sync_period = 0)
|
13
|
+
super(sync_period)
|
14
|
+
|
15
|
+
require 'teien/ui/user_interface'
|
16
|
+
@ui = Teien::UserInterface.new()
|
17
|
+
Teien::register_component("user_interface", @ui )
|
18
|
+
|
19
|
+
@event_router.register_receiver(self)
|
20
|
+
@ui.register_receiver(self)
|
21
|
+
|
22
|
+
@first_update = true
|
23
|
+
end
|
24
|
+
|
25
|
+
def setup()
|
26
|
+
model_setup()
|
27
|
+
ui_setup()
|
28
|
+
end
|
29
|
+
|
30
|
+
def connection_binded(from)
|
31
|
+
puts "connection_binded"
|
32
|
+
model_connection_binded(from)
|
33
|
+
end
|
34
|
+
|
35
|
+
def connection_unbinded(from)
|
36
|
+
puts "connection_unbinded"
|
37
|
+
model_connection_unbinded(from)
|
38
|
+
end
|
39
|
+
|
40
|
+
def connection_completed(from)
|
41
|
+
puts "connection_completed"
|
42
|
+
ui_connection_completed(from)
|
43
|
+
end
|
44
|
+
|
45
|
+
##
|
46
|
+
# EventRouter handlers
|
47
|
+
#
|
48
|
+
|
49
|
+
def update(delta)
|
50
|
+
if @first_update
|
51
|
+
@first_update = false
|
52
|
+
end
|
53
|
+
|
54
|
+
ui_update(delta)
|
55
|
+
end
|
56
|
+
|
57
|
+
def receive_event(event, from)
|
58
|
+
model_receive_event(event, from)
|
59
|
+
ui_receive_event(event, from)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
Local.new.start_application
|
@@ -1,15 +1,8 @@
|
|
1
|
-
require_relative "
|
1
|
+
require_relative "event"
|
2
|
+
require_relative "sinbad"
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
class ServerApplication < Teien::Application
|
6
|
-
attr_accessor :remote_to_controllables
|
7
|
-
|
8
|
-
##
|
9
|
-
# handlers of EventRouter
|
10
|
-
#
|
11
|
-
|
12
|
-
def setup()
|
4
|
+
module Model
|
5
|
+
def model_setup()
|
13
6
|
@remote_to_controllables = Hash.new
|
14
7
|
|
15
8
|
@sync_period = 0.5
|
@@ -37,7 +30,10 @@ class ServerApplication < Teien::Application
|
|
37
30
|
floor.set_position(Vector3D.new(0, 0, 0))
|
38
31
|
end
|
39
32
|
|
40
|
-
def
|
33
|
+
def model_connection_binded(from)
|
34
|
+
end
|
35
|
+
|
36
|
+
def model_connection_unbinded(from)
|
41
37
|
actor = @remote_to_controllables[from]
|
42
38
|
if actor
|
43
39
|
@remote_to_controllables.delete(from)
|
@@ -46,9 +42,13 @@ class ServerApplication < Teien::Application
|
|
46
42
|
end
|
47
43
|
end
|
48
44
|
|
49
|
-
|
45
|
+
##
|
46
|
+
# EventRouter handlers
|
47
|
+
#
|
48
|
+
|
49
|
+
def model_receive_event(event, from)
|
50
50
|
case event
|
51
|
-
when Teien::Event::
|
51
|
+
when Teien::Event::ReadyToGo
|
52
52
|
puts "ReadyToGo"
|
53
53
|
|
54
54
|
remote_info = Network.connections[from]
|
@@ -61,7 +61,7 @@ class ServerApplication < Teien::Application
|
|
61
61
|
event = Teien::Event::Actor::SyncActor.new(actor_info)
|
62
62
|
@event_router.send_event(event)
|
63
63
|
|
64
|
-
event = Teien::Event::
|
64
|
+
event = Teien::Event::ControllableActor.new(@sinbad.name)
|
65
65
|
@event_router.send_event(event, from)
|
66
66
|
|
67
67
|
when Teien::Event::Actor::RequestSetForwardDirection
|
@@ -98,4 +98,3 @@ class ServerApplication < Teien::Application
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
101
|
-
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'teien'
|
2
|
+
require "teien/application/server_application"
|
3
|
+
require_relative 'model'
|
4
|
+
|
5
|
+
include Teien
|
6
|
+
|
7
|
+
class Server < ServerApplication
|
8
|
+
include Model
|
9
|
+
|
10
|
+
def initialize()
|
11
|
+
super(0.3)
|
12
|
+
|
13
|
+
@event_router.register_receiver(self)
|
14
|
+
end
|
15
|
+
|
16
|
+
def setup()
|
17
|
+
model_setup()
|
18
|
+
end
|
19
|
+
|
20
|
+
def connection_binded(from)
|
21
|
+
model_connection_binded(from)
|
22
|
+
end
|
23
|
+
|
24
|
+
def connection_unbinded(from)
|
25
|
+
model_connection_unbinded(from)
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# EventRouter handlers
|
30
|
+
#
|
31
|
+
|
32
|
+
def receive_event(event, from)
|
33
|
+
model_receive_event(event, from)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
Server.new.start_server("0.0.0.0", 11922)
|
File without changes
|