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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a77a656231455a5e1207884454ac0b352f23baf2c607c48ffad3519265b55074
4
- data.tar.gz: 0c581b540a36618d3ff3889e8213ec54716649865fc4a9c6c4f7998261e3842d
3
+ metadata.gz: a111ff5740049fc8eb2e90a956403cd30414b165fdacf7bfa2f40122bc590f8c
4
+ data.tar.gz: 0fa5f1f760b42cd543591c1ceb8d2abfc0af150bb6f65df09650d756f45dc520
5
5
  SHA512:
6
- metadata.gz: 8cdf5d6c7219d2aead765d2a19b0af3f7a80552317f1a3bb5a5b2fbb117672a189fd0eee86e6c48103fa2bb8ef5ed687e6354cecbbd7bb1289592cff68228909
7
- data.tar.gz: c129b723be318e0b4db2abc23fa6e8dc7263d391fda26fe8dc97efabd3352dec71630c6a67a37183c67a73fbcbb6ca2041464d543e07f4c36c393d5fac013c9a
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 <%= node_direction.connector_name %>( <%= node_direction.handler_name %> handler, long dataHead )
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
- private enum InMessage
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
- private enum OutMessage
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
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brotorift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ren