Commit 8adc5ee3 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 386ddaeb b1269665
......@@ -1744,7 +1744,8 @@ net.createServer (client) ->
cancel = true
b = ctos_buffer.slice(3, ctos_message_length - 1 + 3)
info = null
if struct = ygopro.structs[ygopro.proto_structs.CTOS[ygopro.constants.CTOS[ctos_proto]]]
struct = ygopro.structs[ygopro.proto_structs.CTOS[ygopro.constants.CTOS[ctos_proto]]]
if struct and !cancel
struct._setBuff(b)
info = _.clone(struct.fields)
if ygopro.ctos_follows_before[ctos_proto] and !cancel
......@@ -1752,10 +1753,16 @@ net.createServer (client) ->
result = ctos_event.callback b, info, client, client.server, datas
if result and ctos_event.synchronous
cancel = true
if struct and !cancel
struct._setBuff(b)
info = _.clone(struct.fields)
if ygopro.ctos_follows[ctos_proto] and !cancel
result = ygopro.ctos_follows[ctos_proto].callback b, info, client, client.server, datas
if result and ygopro.ctos_follows[ctos_proto].synchronous
cancel = true
if struct and !cancel
struct._setBuff(b)
info = _.clone(struct.fields)
if ygopro.ctos_follows_after[ctos_proto] and !cancel
for ctos_event in ygopro.ctos_follows_after[ctos_proto]
result = ctos_event.callback b, info, client, client.server, datas
......@@ -1821,7 +1828,8 @@ net.createServer (client) ->
cancel = false
b = stoc_buffer.slice(3, stoc_message_length - 1 + 3)
info = null
if struct = ygopro.structs[ygopro.proto_structs.STOC[ygopro.constants.STOC[stoc_proto]]]
struct = ygopro.structs[ygopro.proto_structs.STOC[ygopro.constants.STOC[stoc_proto]]]
if struct and !cancel
struct._setBuff(b)
info = _.clone(struct.fields)
if ygopro.stoc_follows_before[stoc_proto] and !cancel
......@@ -1829,10 +1837,16 @@ net.createServer (client) ->
result = stoc_event.callback b, info, server.client, server, datas
if result and stoc_event.synchronous
cancel = true
if struct and !cancel
struct._setBuff(b)
info = _.clone(struct.fields)
if ygopro.stoc_follows[stoc_proto] and !cancel
result = ygopro.stoc_follows[stoc_proto].callback b, info, server.client, server, datas
if result and ygopro.stoc_follows[stoc_proto].synchronous
cancel = true
if struct and !cancel
struct._setBuff(b)
info = _.clone(struct.fields)
if ygopro.stoc_follows_after[stoc_proto] and !cancel
for stoc_event in ygopro.stoc_follows_after[stoc_proto]
result = stoc_event.callback b, info, server.client, server, datas
......
......@@ -2255,7 +2255,8 @@
}
b = ctos_buffer.slice(3, ctos_message_length - 1 + 3);
info = null;
if (struct = ygopro.structs[ygopro.proto_structs.CTOS[ygopro.constants.CTOS[ctos_proto]]]) {
struct = ygopro.structs[ygopro.proto_structs.CTOS[ygopro.constants.CTOS[ctos_proto]]];
if (struct && !cancel) {
struct._setBuff(b);
info = _.clone(struct.fields);
}
......@@ -2269,12 +2270,20 @@
}
}
}
if (struct && !cancel) {
struct._setBuff(b);
info = _.clone(struct.fields);
}
if (ygopro.ctos_follows[ctos_proto] && !cancel) {
result = ygopro.ctos_follows[ctos_proto].callback(b, info, client, client.server, datas);
if (result && ygopro.ctos_follows[ctos_proto].synchronous) {
cancel = true;
}
}
if (struct && !cancel) {
struct._setBuff(b);
info = _.clone(struct.fields);
}
if (ygopro.ctos_follows_after[ctos_proto] && !cancel) {
ref4 = ygopro.ctos_follows_after[ctos_proto];
for (n = 0, len3 = ref4.length; n < len3; n++) {
......@@ -2355,7 +2364,8 @@
cancel = false;
b = stoc_buffer.slice(3, stoc_message_length - 1 + 3);
info = null;
if (struct = ygopro.structs[ygopro.proto_structs.STOC[ygopro.constants.STOC[stoc_proto]]]) {
struct = ygopro.structs[ygopro.proto_structs.STOC[ygopro.constants.STOC[stoc_proto]]];
if (struct && !cancel) {
struct._setBuff(b);
info = _.clone(struct.fields);
}
......@@ -2369,12 +2379,20 @@
}
}
}
if (struct && !cancel) {
struct._setBuff(b);
info = _.clone(struct.fields);
}
if (ygopro.stoc_follows[stoc_proto] && !cancel) {
result = ygopro.stoc_follows[stoc_proto].callback(b, info, server.client, server, datas);
if (result && ygopro.stoc_follows[stoc_proto].synchronous) {
cancel = true;
}
}
if (struct && !cancel) {
struct._setBuff(b);
info = _.clone(struct.fields);
}
if (ygopro.stoc_follows_after[stoc_proto] && !cancel) {
ref4 = ygopro.stoc_follows_after[stoc_proto];
for (n = 0, len3 = ref4.length; n < len3; n++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment