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
7b99c0d5
Commit
7b99c0d5
authored
Jun 25, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize
parent
997698ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
msg-polyfill/index.js
msg-polyfill/index.js
+15
-5
msg-polyfill/index.ts
msg-polyfill/index.ts
+13
-5
No files found.
msg-polyfill/index.js
View file @
7b99c0d5
...
...
@@ -15,15 +15,25 @@ const getPolyfillers = (version) => {
};
async
function
polyfillGameMsg
(
version
,
msgTitle
,
buffer
)
{
const
polyfillers
=
getPolyfillers
(
version
);
let
mutated
=
false
;
let
pbuf
=
buffer
;
for
(
const
polyfiller
of
polyfillers
)
{
const
newBuf
=
await
polyfiller
.
polyfillGameMsg
(
msgTitle
,
buffer
);
const
newBuf
=
await
polyfiller
.
polyfillGameMsg
(
msgTitle
,
pbuf
);
if
(
newBuf
)
{
mutated
=
true
;
buffer
=
newBuf
;
pbuf
=
newBuf
;
}
}
return
mutated
?
buffer
:
undefined
;
if
(
pbuf
===
buffer
)
{
return
undefined
;
}
else
if
(
pbuf
.
length
<=
buffer
.
length
)
{
pbuf
.
copy
(
buffer
,
0
,
0
,
pbuf
.
length
);
return
pbuf
.
length
===
buffer
.
length
?
undefined
:
buffer
.
slice
(
0
,
pbuf
.
length
);
}
else
{
return
pbuf
;
}
}
async
function
polyfillResponse
(
version
,
msgTitle
,
buffer
)
{
const
polyfillers
=
getPolyfillers
(
version
);
...
...
msg-polyfill/index.ts
View file @
7b99c0d5
...
...
@@ -15,15 +15,23 @@ const getPolyfillers = (version: number) => {
export
async
function
polyfillGameMsg
(
version
:
number
,
msgTitle
:
string
,
buffer
:
Buffer
)
{
const
polyfillers
=
getPolyfillers
(
version
);
let
mutated
=
false
;
let
pbuf
=
buffer
;
for
(
const
polyfiller
of
polyfillers
)
{
const
newBuf
=
await
polyfiller
.
polyfillGameMsg
(
msgTitle
,
buffer
);
const
newBuf
=
await
polyfiller
.
polyfillGameMsg
(
msgTitle
,
pbuf
);
if
(
newBuf
)
{
mutated
=
true
;
buffer
=
newBuf
;
pbuf
=
newBuf
;
}
}
return
mutated
?
buffer
:
undefined
;
if
(
pbuf
===
buffer
)
{
return
undefined
;
}
else
if
(
pbuf
.
length
<=
buffer
.
length
)
{
pbuf
.
copy
(
buffer
,
0
,
0
,
pbuf
.
length
);
return
pbuf
.
length
===
buffer
.
length
?
undefined
:
buffer
.
slice
(
0
,
pbuf
.
length
);
}
else
{
return
pbuf
;
}
}
export
async
function
polyfillResponse
(
version
:
number
,
msgTitle
:
string
,
buffer
:
Buffer
)
{
...
...
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