dango_generator 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -48,6 +48,8 @@ package org.rubyforge.dango {
|
|
48
48
|
private var recv_timer:Timer; // 受信用タイマーの追加
|
49
49
|
private var recv_last_date:Date = new Date(); // 受信用処理落ちチェック用
|
50
50
|
|
51
|
+
public var server_time:String = ""; // サーバーの時計
|
52
|
+
|
51
53
|
// private var server_host:String = "172.31.1.74";
|
52
54
|
// private var server_host:String = "localhost";
|
53
55
|
// private var server_port:int = 15000;
|
@@ -260,7 +262,7 @@ package org.rubyforge.dango {
|
|
260
262
|
public function recv_callback(evt:TimerEvent):void {
|
261
263
|
// if(is_debug){ trace("DangoClientFramework:recv_callback:" + DangoUtil.now2str()); }
|
262
264
|
|
263
|
-
//
|
265
|
+
// 前回から時間がかかりすぎている(処理落ちしかけている場合は)スキップ
|
264
266
|
var start_date:Date = new Date();
|
265
267
|
// if(is_debug){ trace("DangoClientFramework:recv_last_date.time=" + recv_last_date.time + " start_date.time=" + start_date.time); }
|
266
268
|
if(recv_last_date.time > start_date.time - (recv_timer_msec * 1.5)){
|
@@ -273,20 +275,18 @@ package org.rubyforge.dango {
|
|
273
275
|
if(is_debug){ trace("DangoClientFramework:recv_c=" + recv_c); }
|
274
276
|
var receive_data:Array = this.receive_notice(byte_array);
|
275
277
|
|
276
|
-
if(recv_not_yet_size == 0){ //
|
277
|
-
if(receive_data != []){ //
|
278
|
+
if(recv_not_yet_size == 0){ // 未受信データが無ければ、ひとつのデータ受信が完了とみなす
|
279
|
+
if(receive_data != []){ // データが空じゃなければ処理開始
|
278
280
|
for(var i:uint = 0; i < receive_data.length; i++){
|
279
281
|
var notice_name:String = receive_data[i]["notice"];
|
282
|
+
server_time = receive_data[i]["server_time"];
|
280
283
|
|
281
284
|
if(notice_name == "_notice_sid"){ // 接続直後のsid通知なら
|
282
285
|
this.sid = receive_data[i]["_sid"];
|
283
|
-
if(is_debug){ trace("DangoClientFramework:this.sid=" + this.sid + " recv_c:" + recv_c); }
|
284
|
-
|
285
|
-
} else if(notice_name == "_heart_beat"){ // heart beat通知なら
|
286
|
-
if(is_debug){ trace("DangoClientFramework:_heart_beat: recv_c:" + recv_c); }
|
286
|
+
if(is_debug){ trace("DangoClientFramework:this.sid=" + this.sid + " recv_c:" + recv_c + " server_time:" + server_time); }
|
287
287
|
|
288
288
|
} else { // 通常のデータならイベント発生
|
289
|
-
if(is_debug){ trace("DangoClientFramework:dispatchEvent:dango_" + notice_name + ": recv_c:" + recv_c + ":" + i); }
|
289
|
+
if(is_debug){ trace("DangoClientFramework:dispatchEvent:dango_" + notice_name + ": recv_c:" + recv_c + ":" + i + " server_time:" + server_time); }
|
290
290
|
this.dispatchEvent(new DangoReceiveEvent("dango_" + notice_name, receive_data[i]));
|
291
291
|
}
|
292
292
|
}
|
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.2.
|
4
|
+
version: 0.2.5
|
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-05-
|
12
|
+
date: 2008-05-26 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|