dango_generator 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/dango_generator.rb +6 -5
- data/templates/as3/org/rubyforge/dango/DangoClientFramework.as +9 -3
- data/templates/config/dango/development.yml +3 -2
- data/templates/dango/client_swf/src/DangoConfig.as +8 -0
- data/templates/dango/server/99_dango_server.rb +12 -16
- metadata +3 -3
- data/templates/dango/client_swf/DangoConfig.as +0 -13
data/dango_generator.rb
CHANGED
@@ -37,7 +37,8 @@ class DangoGenerator < Rails::Generator::NamedBase
|
|
37
37
|
|
38
38
|
# dangoのclient_swf
|
39
39
|
m.directory 'dango/client_swf'
|
40
|
-
m.
|
40
|
+
m.directory 'dango/client_swf/src'
|
41
|
+
m.template "dango/client_swf/src/DangoConfig.as" , "dango/client_swf/src/DangoConfig.as"
|
41
42
|
|
42
43
|
# dangoコンフィグ
|
43
44
|
m.directory 'config/dango'
|
@@ -51,7 +52,7 @@ class DangoGenerator < Rails::Generator::NamedBase
|
|
51
52
|
end
|
52
53
|
|
53
54
|
# dangoのas3ライブラリ
|
54
|
-
m.directory 'dango/client_swf/org/rubyforge/dango'
|
55
|
+
m.directory 'dango/client_swf/src/org/rubyforge/dango'
|
55
56
|
%w(
|
56
57
|
DangoClientFramework.as
|
57
58
|
DangoError.as
|
@@ -62,7 +63,7 @@ class DangoGenerator < Rails::Generator::NamedBase
|
|
62
63
|
DangoURLLoaderEvent.as
|
63
64
|
DangoUtil.as
|
64
65
|
).each do |as3_file|
|
65
|
-
m.template "as3/org/rubyforge/dango/#{as3_file}", "dango/client_swf/org/rubyforge/dango/#{as3_file}"
|
66
|
+
m.template "as3/org/rubyforge/dango/#{as3_file}", "dango/client_swf/src/org/rubyforge/dango/#{as3_file}"
|
66
67
|
end
|
67
68
|
|
68
69
|
# http://code.google.com/p/as3corelib/のインポート
|
@@ -101,8 +102,8 @@ class DangoGenerator < Rails::Generator::NamedBase
|
|
101
102
|
com/adobe/webapis/URLLoaderBase.as
|
102
103
|
com/adobe/webapis/events/ServiceEvent.as
|
103
104
|
).each do |as3corelib_file|
|
104
|
-
m.directory File.dirname("dango/client_swf/#{as3corelib_file}")
|
105
|
-
m.template "as3/#{as3corelib_file}", "dango/client_swf/#{as3corelib_file}"
|
105
|
+
m.directory File.dirname("dango/client_swf/src/#{as3corelib_file}")
|
106
|
+
m.template "as3/#{as3corelib_file}", "dango/client_swf/src/#{as3corelib_file}"
|
106
107
|
end
|
107
108
|
|
108
109
|
# end
|
@@ -60,6 +60,9 @@ package org.rubyforge.dango {
|
|
60
60
|
private var server_port:int;
|
61
61
|
private var is_debug:Boolean = false; // Debugモードかどうかのフラグ
|
62
62
|
private var disp_obj:DisplayObject;
|
63
|
+
private var policy_file_protocol:String;
|
64
|
+
private var policy_file_host:String;
|
65
|
+
private var policy_file_path:String;
|
63
66
|
|
64
67
|
public var sid:int;
|
65
68
|
private var has_sid:Boolean = false; // sidを取得完了しているかどうか
|
@@ -80,6 +83,9 @@ package org.rubyforge.dango {
|
|
80
83
|
if(config.hasOwnProperty("server_port")){ server_port = config.server_port; }
|
81
84
|
if(config.hasOwnProperty("debug" )){ is_debug = config.debug; }
|
82
85
|
if(config.hasOwnProperty("disp_obj" )){ disp_obj = config.disp_obj; }
|
86
|
+
if(config.hasOwnProperty("policy_file_protocol")){ policy_file_protocol = config.policy_file_protocol; }
|
87
|
+
if(config.hasOwnProperty("policy_file_host" )){ policy_file_host = config.policy_file_host; }
|
88
|
+
if(config.hasOwnProperty("policy_file_path" )){ policy_file_path = config.policy_file_path; }
|
83
89
|
// is_debug = true;
|
84
90
|
|
85
91
|
if(disp_obj){
|
@@ -87,9 +93,9 @@ package org.rubyforge.dango {
|
|
87
93
|
frame_rate = disp_obj.stage.frameRate; // フレームレート
|
88
94
|
}
|
89
95
|
|
90
|
-
var policy_file_protocol:String = config.policy_file_protocol;
|
91
|
-
var policy_file_host:String = config.policy_file_host;
|
92
|
-
var policy_file_path:String = config.policy_file_path;
|
96
|
+
// var policy_file_protocol:String = config.policy_file_protocol;
|
97
|
+
// var policy_file_host:String = config.policy_file_host;
|
98
|
+
// var policy_file_path:String = config.policy_file_path;
|
93
99
|
|
94
100
|
// 環境情報を出力
|
95
101
|
if(is_debug){ trace("flash player: " + Capabilities.version); }
|
@@ -1,8 +1,9 @@
|
|
1
1
|
server:
|
2
2
|
max_connections: 100
|
3
|
-
safe_resolver: false # require 'resolv-replace'するかどうか。
|
3
|
+
safe_resolver: false # require 'resolv-replace'するかどうか。
|
4
|
+
# Windowsはtrueにしたほうが安全、Macはfalseにしたほうが安全、
|
5
|
+
# UNIXはfalseの方が速いと思う
|
4
6
|
policy_file_request: true # <policy-file-request/>要求に答える(Flashでクロスドメイン処理を行う)
|
5
|
-
daemon: true # daemonモード
|
6
7
|
|
7
8
|
network:
|
8
9
|
host: localhost
|
@@ -2,21 +2,17 @@
|
|
2
2
|
= dangoサーバー
|
3
3
|
=end
|
4
4
|
|
5
|
-
# メインクラス
|
6
5
|
class DangoServer < DangoServerFramework
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
6
|
+
# サーバー起動時のインスタンス変数などを定義するメソッド
|
7
|
+
# ここで定義されるインスタンス変数はサーバー全体で共有される
|
8
|
+
def dango_server_init()
|
9
|
+
end
|
10
|
+
|
11
|
+
# クライアント接続時に呼び出されるメソッド
|
12
|
+
def dango_connect()
|
13
|
+
end
|
14
|
+
|
15
|
+
# クライアント接続解除時に呼び出されるメソッド
|
16
|
+
def dango_close()
|
17
|
+
end
|
19
18
|
end
|
20
|
-
|
21
|
-
|
22
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dango_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keisuke Minami
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-09-
|
12
|
+
date: 2008-09-25 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -43,7 +43,7 @@ files:
|
|
43
43
|
- templates/tasks/dango.rake
|
44
44
|
- templates/public/crossdomain.xml
|
45
45
|
- templates/dango/server/99_dango_server.rb
|
46
|
-
- templates/dango/client_swf/DangoConfig.as
|
46
|
+
- templates/dango/client_swf/src/DangoConfig.as
|
47
47
|
- templates/config/dango/development.yml
|
48
48
|
- templates/config/dango/test.yml
|
49
49
|
- templates/config/dango/production.yml
|
@@ -1,13 +0,0 @@
|
|
1
|
-
package {
|
2
|
-
public class DangoConfig {
|
3
|
-
public var server_host:String = "localhost";
|
4
|
-
// public var server_host:String = "192.168.1.31";
|
5
|
-
public var server_port:uint = 15000;
|
6
|
-
public var debug:Boolean = true;
|
7
|
-
|
8
|
-
public var policy_file_protocol:String = "http";
|
9
|
-
public var policy_file_port:uint = 80;
|
10
|
-
public var policy_file_path:String = "/crossdomain.xml";
|
11
|
-
}
|
12
|
-
}
|
13
|
-
|