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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
love_飞影
Neos
Commits
df8c68bf
Commit
df8c68bf
authored
Dec 17, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add StocTimeLimit Adapter
parent
0a4ffd25
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
src/api/ocgcore/ocgAdapter/adapter.ts
src/api/ocgcore/ocgAdapter/adapter.ts
+7
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+1
-0
src/api/ocgcore/ocgAdapter/stoc/stocTimeLimit.ts
src/api/ocgcore/ocgAdapter/stoc/stocTimeLimit.ts
+31
-0
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+5
-0
No files found.
src/api/ocgcore/ocgAdapter/adapter.ts
View file @
df8c68bf
...
@@ -13,6 +13,7 @@ import {
...
@@ -13,6 +13,7 @@ import {
STOC_DECK_COUNT
,
STOC_DECK_COUNT
,
STOC_DUEL_START
,
STOC_DUEL_START
,
STOC_GAME_MSG
,
STOC_GAME_MSG
,
STOC_TIME_LIMIT
,
}
from
"
./protoDecl
"
;
}
from
"
./protoDecl
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocJoinGame
from
"
./stoc/stocJoinGame
"
;
import
StocJoinGame
from
"
./stoc/stocJoinGame
"
;
...
@@ -23,6 +24,7 @@ import StocTypeChange from "./stoc/stocTypeChange";
...
@@ -23,6 +24,7 @@ import StocTypeChange from "./stoc/stocTypeChange";
import
StocSelectHand
from
"
./stoc/stocSelectHand
"
;
import
StocSelectHand
from
"
./stoc/stocSelectHand
"
;
import
StocSelectTp
from
"
./stoc/stocSelectTp
"
;
import
StocSelectTp
from
"
./stoc/stocSelectTp
"
;
import
StocDeckCount
from
"
./stoc/stocDeckCount
"
;
import
StocDeckCount
from
"
./stoc/stocDeckCount
"
;
import
StocTimeLimit
from
"
./stoc/stocTimeLimit
"
;
import
StocGameMsg
from
"
./stoc/stocGameMsg/mod
"
;
import
StocGameMsg
from
"
./stoc/stocGameMsg/mod
"
;
/*
/*
...
@@ -94,6 +96,11 @@ export function adaptStoc(packet: YgoProPacket): ygopro.YgoStocMsg {
...
@@ -94,6 +96,11 @@ export function adaptStoc(packet: YgoProPacket): ygopro.YgoStocMsg {
break
;
break
;
}
}
case
STOC_TIME_LIMIT
:
{
pb
=
new
StocTimeLimit
(
packet
).
upcast
();
break
;
}
default
:
{
default
:
{
break
;
break
;
}
}
...
...
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
df8c68bf
...
@@ -22,6 +22,7 @@ export const STOC_HAND_RESULT = 5;
...
@@ -22,6 +22,7 @@ export const STOC_HAND_RESULT = 5;
export
const
STOC_DECK_COUNT
=
9
;
export
const
STOC_DECK_COUNT
=
9
;
export
const
STOC_DUEL_START
=
21
;
export
const
STOC_DUEL_START
=
21
;
export
const
STOC_GAME_MSG
=
1
;
export
const
STOC_GAME_MSG
=
1
;
export
const
STOC_TIME_LIMIT
=
24
;
export
const
MSG_START
=
4
;
export
const
MSG_START
=
4
;
export
const
MSG_DRAW
=
90
;
export
const
MSG_DRAW
=
90
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocTimeLimit.ts
0 → 100644
View file @
df8c68bf
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
BufferReader
}
from
"
../bufferIO
"
;
/*
* STOC TimeLimit
*
* @usage - 同时客户端/前端时间限制
* */
export
default
class
TimeLimit
implements
StocAdapter
{
packet
:
YgoProPacket
;
constructor
(
packet
:
YgoProPacket
)
{
this
.
packet
=
packet
;
}
upcast
():
ygopro
.
YgoStocMsg
{
const
reader
=
new
BufferReader
(
this
.
packet
.
exData
,
true
);
const
player
=
reader
.
readInt8
();
const
leftTime
=
reader
.
readUint16
();
return
new
ygopro
.
YgoStocMsg
({
stoc_time_limit
:
new
ygopro
.
StocTimeLimit
({
player
,
left_time
:
leftTime
,
}),
});
}
}
src/service/onSocketMessage.ts
View file @
df8c68bf
...
@@ -87,6 +87,11 @@ export default function handleSocketMessage(e: MessageEvent) {
...
@@ -87,6 +87,11 @@ export default function handleSocketMessage(e: MessageEvent) {
break
;
break
;
}
}
case
"
stoc_time_limit
"
:
{
// TODO
break
;
}
default
:
{
default
:
{
console
.
log
(
packet
);
console
.
log
(
packet
);
...
...
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