brotorift 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/unity_client_generator.cs.erb +18 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a111ff5740049fc8eb2e90a956403cd30414b165fdacf7bfa2f40122bc590f8c
|
4
|
+
data.tar.gz: 0fa5f1f760b42cd543591c1ceb8d2abfc0af150bb6f65df09650d756f45dc520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 042f897d06e7f6fa17d5d505d6777821615aff782a52c39b99c04fe7a254643c130e786215f83f8369fd5e2431fa0793848ffb7dec4f4590cb9ee01ac462c3c5
|
7
|
+
data.tar.gz: f08ccae306239eeb286e63f7daf53034e9ee7fe53fe6744a04dd92070e11d8ac37d0c3b95a78f0241f85dea594056944a8d3dde2afc8df8ef82a0b09a1e38201
|
@@ -68,7 +68,11 @@ namespace <%= node.namespace %>
|
|
68
68
|
|
69
69
|
public PacketProcessPolicy policy { get; set; }
|
70
70
|
|
71
|
-
public
|
71
|
+
public event Action<InMessage> beforeReceiveMessage;
|
72
|
+
|
73
|
+
public event Action<InMessage> afterReceiveMessage;
|
74
|
+
|
75
|
+
public <%= node_direction.connector_name %>( <%= node_direction.handler_name %> handler, int dataHead )
|
72
76
|
{
|
73
77
|
this.Version = ClientVersion;
|
74
78
|
this.handler = handler;
|
@@ -76,12 +80,12 @@ namespace <%= node.namespace %>
|
|
76
80
|
this.policy = PacketProcessPolicy.Discard;
|
77
81
|
}
|
78
82
|
|
79
|
-
|
83
|
+
public enum InMessage
|
80
84
|
{<% for m in node_direction.in_direction.messages.values %>
|
81
85
|
<%= m.name %> = <%= m.id %>,<% end %>
|
82
86
|
}
|
83
87
|
|
84
|
-
|
88
|
+
public enum OutMessage
|
85
89
|
{<% for m in node_direction.out_direction.messages.values %>
|
86
90
|
<%= m.name %> = <%= m.id %>,<% end %>
|
87
91
|
}
|
@@ -104,6 +108,11 @@ namespace <%= node.namespace %>
|
|
104
108
|
return this.policy == PacketProcessPolicy.Discard;
|
105
109
|
}
|
106
110
|
|
111
|
+
if( this.beforeReceiveMessage != null )
|
112
|
+
{
|
113
|
+
this.beforeReceiveMessage( (InMessage)packet.Header );
|
114
|
+
}
|
115
|
+
|
107
116
|
switch( (InMessage)packet.Header )
|
108
117
|
{<% for m in node_direction.in_direction.messages.values %>
|
109
118
|
case InMessage.<%= m.name %>:
|
@@ -115,6 +124,12 @@ namespace <%= node.namespace %>
|
|
115
124
|
default:
|
116
125
|
break;
|
117
126
|
}
|
127
|
+
|
128
|
+
if( this.afterReceiveMessage != null )
|
129
|
+
{
|
130
|
+
this.afterReceiveMessage( (InMessage)packet.Header );
|
131
|
+
}
|
132
|
+
|
118
133
|
return true;
|
119
134
|
}
|
120
135
|
}
|