Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
srvpro
Commits
c7e68ffa
Commit
c7e68ffa
authored
Jun 23, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4c6f0a0a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
YGOProMessages.js
YGOProMessages.js
+9
-3
YGOProMessages.ts
YGOProMessages.ts
+9
-3
No files found.
YGOProMessages.js
View file @
c7e68ffa
...
@@ -28,7 +28,7 @@ class Handler {
...
@@ -28,7 +28,7 @@ class Handler {
}
}
}
}
class
YGOProMessagesHelper
{
class
YGOProMessagesHelper
{
constructor
()
{
constructor
(
singleHandleLimit
)
{
this
.
handlers
=
{
this
.
handlers
=
{
STOC
:
[
new
Map
(),
STOC
:
[
new
Map
(),
new
Map
(),
new
Map
(),
...
@@ -45,6 +45,12 @@ class YGOProMessagesHelper {
...
@@ -45,6 +45,12 @@ class YGOProMessagesHelper {
};
};
this
.
initDatas
();
this
.
initDatas
();
this
.
initStructs
();
this
.
initStructs
();
if
(
singleHandleLimit
)
{
this
.
singleHandleLimit
=
singleHandleLimit
;
}
else
{
this
.
singleHandleLimit
=
1000
;
}
}
}
initDatas
()
{
initDatas
()
{
this
.
structs_declaration
=
structs_json_1
.
default
;
this
.
structs_declaration
=
structs_json_1
.
default
;
...
@@ -159,7 +165,7 @@ class YGOProMessagesHelper {
...
@@ -159,7 +165,7 @@ class YGOProMessagesHelper {
let
messageLength
=
0
;
let
messageLength
=
0
;
let
bufferProto
=
0
;
let
bufferProto
=
0
;
let
datas
=
[];
let
datas
=
[];
for
(
let
l
=
0
;
l
<
1000
;
++
l
)
{
for
(
let
l
=
0
;
l
<
this
.
singleHandleLimit
;
++
l
)
{
if
(
messageLength
===
0
)
{
if
(
messageLength
===
0
)
{
if
(
messageBuffer
.
length
>=
2
)
{
if
(
messageBuffer
.
length
>=
2
)
{
messageLength
=
messageBuffer
.
readUInt16LE
(
0
);
messageLength
=
messageBuffer
.
readUInt16LE
(
0
);
...
@@ -229,7 +235,7 @@ class YGOProMessagesHelper {
...
@@ -229,7 +235,7 @@ class YGOProMessagesHelper {
break
;
break
;
}
}
}
}
if
(
l
===
999
)
{
if
(
l
===
this
.
singleHandleLimit
-
1
)
{
feedback
=
{
feedback
=
{
type
:
"
OVERSIZE
"
,
type
:
"
OVERSIZE
"
,
message
:
`Oversized
${
direction
}
`
message
:
`Oversized
${
direction
}
`
...
...
YGOProMessages.ts
View file @
c7e68ffa
...
@@ -54,8 +54,9 @@ export class YGOProMessagesHelper {
...
@@ -54,8 +54,9 @@ export class YGOProMessagesHelper {
typedefs
:
any
;
typedefs
:
any
;
proto_structs
:
any
;
proto_structs
:
any
;
constants
:
any
;
constants
:
any
;
singleHandleLimit
:
number
;
constructor
()
{
constructor
(
singleHandleLimit
?:
number
)
{
this
.
handlers
=
{
this
.
handlers
=
{
STOC
:
[
new
Map
(),
STOC
:
[
new
Map
(),
new
Map
(),
new
Map
(),
...
@@ -72,6 +73,11 @@ export class YGOProMessagesHelper {
...
@@ -72,6 +73,11 @@ export class YGOProMessagesHelper {
}
}
this
.
initDatas
();
this
.
initDatas
();
this
.
initStructs
();
this
.
initStructs
();
if
(
singleHandleLimit
)
{
this
.
singleHandleLimit
=
singleHandleLimit
;
}
else
{
this
.
singleHandleLimit
=
1000
;
}
}
}
initDatas
()
{
initDatas
()
{
...
@@ -195,7 +201,7 @@ export class YGOProMessagesHelper {
...
@@ -195,7 +201,7 @@ export class YGOProMessagesHelper {
let
messageLength
=
0
;
let
messageLength
=
0
;
let
bufferProto
=
0
;
let
bufferProto
=
0
;
let
datas
:
Buffer
[]
=
[];
let
datas
:
Buffer
[]
=
[];
for
(
let
l
=
0
;
l
<
1000
;
++
l
)
{
for
(
let
l
=
0
;
l
<
this
.
singleHandleLimit
;
++
l
)
{
if
(
messageLength
===
0
)
{
if
(
messageLength
===
0
)
{
if
(
messageBuffer
.
length
>=
2
)
{
if
(
messageBuffer
.
length
>=
2
)
{
messageLength
=
messageBuffer
.
readUInt16LE
(
0
);
messageLength
=
messageBuffer
.
readUInt16LE
(
0
);
...
@@ -260,7 +266,7 @@ export class YGOProMessagesHelper {
...
@@ -260,7 +266,7 @@ export class YGOProMessagesHelper {
break
;
break
;
}
}
}
}
if
(
l
===
999
)
{
if
(
l
===
this
.
singleHandleLimit
-
1
)
{
feedback
=
{
feedback
=
{
type
:
"
OVERSIZE
"
,
type
:
"
OVERSIZE
"
,
message
:
`Oversized
${
direction
}
`
message
:
`Oversized
${
direction
}
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment