Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
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
Neos
Commits
705e91de
Commit
705e91de
authored
Sep 28, 2025
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove rust-src and wasm
parent
98850a94
Pipeline
#40761
failed with stages
in 26 minutes and 23 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
192 additions
and
1 deletion
+192
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/sortCard.ts
...i/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/sortCard.ts
+1
-1
src/infra/buffer.ts
src/infra/buffer.ts
+190
-0
src/infra/index.ts
src/infra/index.ts
+1
-0
No files found.
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/sortCard.ts
View file @
705e91de
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
BufferWriter
}
from
"
@/infra
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
...
...
src/infra/buffer.ts
0 → 100644
View file @
705e91de
export
class
BufferReader
{
private
dataView
:
DataView
;
private
_offset
:
number
;
/**
* Constructor that takes a Uint8Array as the data source
* @param array The binary array to read from
*/
constructor
(
array
:
Uint8Array
)
{
this
.
dataView
=
new
DataView
(
array
.
buffer
,
array
.
byteOffset
,
array
.
byteLength
);
this
.
_offset
=
0
;
}
/**
* Reads an unsigned 8-bit integer
* @returns The read value
*/
readUint8
():
number
{
const
value
=
this
.
dataView
.
getUint8
(
this
.
_offset
);
this
.
_offset
+=
1
;
return
value
;
}
/**
* Reads a signed 8-bit integer
* @returns The read value
*/
readInt8
():
number
{
const
value
=
this
.
dataView
.
getInt8
(
this
.
_offset
);
this
.
_offset
+=
1
;
return
value
;
}
/**
* Reads an unsigned 16-bit integer (little-endian)
* @returns The read value
*/
readUint16
():
number
{
const
value
=
this
.
dataView
.
getUint16
(
this
.
_offset
,
true
);
this
.
_offset
+=
2
;
return
value
;
}
/**
* Reads an unsigned 32-bit integer (little-endian)
* @returns The read value
*/
readUint32
():
number
{
const
value
=
this
.
dataView
.
getUint32
(
this
.
_offset
,
true
);
this
.
_offset
+=
4
;
return
value
;
}
/**
* Reads a signed 32-bit integer (little-endian)
* @returns The read value
*/
readInt32
():
number
{
const
value
=
this
.
dataView
.
getInt32
(
this
.
_offset
,
true
);
this
.
_offset
+=
4
;
return
value
;
}
/**
* Gets the current offset position
* @returns The current offset
*/
offset
():
number
{
return
this
.
_offset
;
}
/**
* Sets the offset position
* @param offset The new offset value
*/
setOffset
(
offset
:
number
):
void
{
// Ensure offset is within valid range
if
(
offset
<
0
||
offset
>
this
.
dataView
.
byteLength
)
{
throw
new
Error
(
`Invalid offset:
${
offset
}
`
);
}
this
.
_offset
=
offset
;
}
}
export
class
BufferWriter
{
private
buffer
:
ArrayBuffer
;
private
dataView
:
DataView
;
private
length
:
number
;
private
capacity
:
number
;
/**
* Constructor that creates a new BufferWriter instance
*/
constructor
()
{
// Initial capacity set to 1024 bytes, will auto-expand
this
.
capacity
=
1024
;
this
.
buffer
=
new
ArrayBuffer
(
this
.
capacity
);
this
.
dataView
=
new
DataView
(
this
.
buffer
);
this
.
length
=
0
;
}
/**
* Ensures the buffer has enough capacity
* @param additional Number of additional bytes needed
*/
private
ensureCapacity
(
additional
:
number
):
void
{
while
(
this
.
length
+
additional
>
this
.
capacity
)
{
this
.
capacity
*=
2
;
const
newBuffer
=
new
ArrayBuffer
(
this
.
capacity
);
const
newDataView
=
new
DataView
(
newBuffer
);
// Copy existing data
for
(
let
i
=
0
;
i
<
this
.
length
;
i
++
)
{
newDataView
.
setUint8
(
i
,
this
.
dataView
.
getUint8
(
i
));
}
this
.
buffer
=
newBuffer
;
this
.
dataView
=
newDataView
;
}
}
/**
* Writes an unsigned 8-bit integer
* @param value The value to write
*/
writeUint8
(
value
:
number
):
void
{
this
.
ensureCapacity
(
1
);
this
.
dataView
.
setUint8
(
this
.
length
,
value
);
this
.
length
+=
1
;
}
/**
* Writes a signed 8-bit integer
* @param value The value to write
*/
writeInt8
(
value
:
number
):
void
{
this
.
ensureCapacity
(
1
);
this
.
dataView
.
setInt8
(
this
.
length
,
value
);
this
.
length
+=
1
;
}
/**
* Writes an unsigned 16-bit integer (little-endian)
* @param value The value to write
*/
writeUint16
(
value
:
number
):
void
{
this
.
ensureCapacity
(
2
);
this
.
dataView
.
setUint16
(
this
.
length
,
value
,
true
);
this
.
length
+=
2
;
}
/**
* Writes a signed 16-bit integer (little-endian)
* @param value The value to write
*/
writeInt16
(
value
:
number
):
void
{
this
.
ensureCapacity
(
2
);
this
.
dataView
.
setInt16
(
this
.
length
,
value
,
true
);
this
.
length
+=
2
;
}
/**
* Writes an unsigned 32-bit integer (little-endian)
* @param value The value to write
*/
writeUint32
(
value
:
number
):
void
{
this
.
ensureCapacity
(
4
);
this
.
dataView
.
setUint32
(
this
.
length
,
value
,
true
);
this
.
length
+=
4
;
}
/**
* Writes a signed 32-bit integer (little-endian)
* @param value The value to write
*/
writeInt32
(
value
:
number
):
void
{
this
.
ensureCapacity
(
4
);
this
.
dataView
.
setInt32
(
this
.
length
,
value
,
true
);
this
.
length
+=
4
;
}
/**
* Converts the written data to a Uint8Array
* @returns Uint8Array containing the written data
*/
toArray
():
Uint8Array
{
return
new
Uint8Array
(
this
.
buffer
,
0
,
this
.
length
);
}
}
src/infra/index.ts
View file @
705e91de
...
@@ -5,3 +5,4 @@ export * from "./eventbus";
...
@@ -5,3 +5,4 @@ export * from "./eventbus";
export
*
from
"
./pfetch
"
;
export
*
from
"
./pfetch
"
;
export
*
from
"
./sleep
"
;
export
*
from
"
./sleep
"
;
export
*
from
"
./stream
"
;
export
*
from
"
./stream
"
;
export
*
from
"
./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