mrpin-sdk 1.0.21 → 1.0.22
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e09c24d32055547d440c4b4ec2e19a40d67345f0
|
4
|
+
data.tar.gz: 54e847d487239fc82b8ef9546dc02e893211033d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45a6186afcc11d07386c8477f42338b711fc7b5105d4c9176aa13169a6050bf5f48c486313a0a47cd754bdedd1ce87d1b7997de5a9290bd7d7f42da02ada383e
|
7
|
+
data.tar.gz: 45e8f2f06631cc594da73a9c375706cd4c4010762c42f05b7d47eb4473af8971c0e99466942ef006681b9ff131d7046b17f7a9d4aa8c8a9f618c6c367c890dc6
|
@@ -25,6 +25,8 @@ class SocketClientBase < EM::Connection
|
|
25
25
|
|
26
26
|
attr_accessor :player
|
27
27
|
|
28
|
+
attr_accessor :callback_on_disconnect
|
29
|
+
|
28
30
|
public
|
29
31
|
def is_online?
|
30
32
|
@is_online
|
@@ -39,6 +41,17 @@ class SocketClientBase < EM::Connection
|
|
39
41
|
AppInfo.instance.on_server_error("Error on get_requests #{e}", e)
|
40
42
|
end
|
41
43
|
|
44
|
+
protected
|
45
|
+
def on_connection_closed
|
46
|
+
@is_online = false
|
47
|
+
|
48
|
+
@logger.info "connection closed. ip: #{@ip}"
|
49
|
+
|
50
|
+
@manager_remote.on_client_disconnected(self) if @should_disconnect_session
|
51
|
+
|
52
|
+
nil
|
53
|
+
end
|
54
|
+
|
42
55
|
#
|
43
56
|
# Methods
|
44
57
|
#
|
@@ -61,7 +74,8 @@ class SocketClientBase < EM::Connection
|
|
61
74
|
|
62
75
|
@data_buffer = ''
|
63
76
|
|
64
|
-
@player
|
77
|
+
@player = nil
|
78
|
+
@callback_on_disconnect = nil
|
65
79
|
|
66
80
|
init_ip
|
67
81
|
|
@@ -171,11 +185,7 @@ class SocketClientBase < EM::Connection
|
|
171
185
|
|
172
186
|
public
|
173
187
|
def unbind
|
174
|
-
|
175
|
-
|
176
|
-
@logger.info "connection closed. ip: #{@ip}"
|
177
|
-
|
178
|
-
@manager_remote.on_client_disconnected(self) if @should_disconnect_session
|
188
|
+
on_connection_closed
|
179
189
|
|
180
190
|
nil
|
181
191
|
end
|
@@ -11,17 +11,6 @@ class SocketClientWebSockets < SocketClientBase
|
|
11
11
|
def on_connection_open(handshake)
|
12
12
|
end
|
13
13
|
|
14
|
-
protected
|
15
|
-
def on_connection_closed
|
16
|
-
@is_online = false
|
17
|
-
|
18
|
-
unless @player.nil?
|
19
|
-
AppInfo.instance.manager_players.on_player_disconnected(@player)
|
20
|
-
end
|
21
|
-
|
22
|
-
@manager_remote.on_client_disconnected(self) unless @manager_remote.nil?
|
23
|
-
end
|
24
|
-
|
25
14
|
protected
|
26
15
|
def on_error(e)
|
27
16
|
AppInfo.instance.on_server_error(e.to_s, e)
|
@@ -31,9 +20,6 @@ class SocketClientWebSockets < SocketClientBase
|
|
31
20
|
# properties
|
32
21
|
#
|
33
22
|
|
34
|
-
public
|
35
|
-
attr_accessor :player
|
36
|
-
|
37
23
|
public
|
38
24
|
def websocket=(value)
|
39
25
|
@websocket = value
|
data/lib/mrpin/version.rb
CHANGED