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
074a7764
Commit
074a7764
authored
Oct 30, 2022
by
Chunchi Che
Committed by
WANG HE
Dec 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add selectHand adapter
parent
e89215a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
0 deletions
+40
-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/stocSelectHand.ts
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
+21
-0
src/service/mora/selectHand.ts
src/service/mora/selectHand.ts
+5
-0
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+6
-0
No files found.
src/api/ocgcore/ocgAdapter/adapter.ts
View file @
074a7764
...
...
@@ -7,6 +7,7 @@ import {
STOC_HS_WATCH_CHANGE
,
STOC_JOIN_GAME
,
STOC_TYPE_CHANGE
,
STOC_SELECT_HAND
,
}
from
"
./protoDecl
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocJoinGame
from
"
./stoc/stocJoinGame
"
;
...
...
@@ -14,6 +15,7 @@ import StocHsPlayerEnter from "./stoc/stocHsPlayerEnter";
import
StocHsPlayerChange
from
"
./stoc/stocHsPlayerChange
"
;
import
StocHsWatchChange
from
"
./stoc/stocHsWatchChange
"
;
import
StocTypeChange
from
"
./stoc/stocTypeChange
"
;
import
StocSelectHand
from
"
./stoc/stocSelectHand
"
;
/*
* 将[`ygoProPacket`]对象转换成[`ygopro.YgoStocMsg`]对象
...
...
@@ -55,6 +57,11 @@ export function adaptStoc(packet: ygoProPacket): ygopro.YgoStocMsg {
break
;
}
case
STOC_SELECT_HAND
:
{
pb
=
new
StocSelectHand
(
packet
).
upcast
();
break
;
}
default
:
{
break
;
}
...
...
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
074a7764
...
...
@@ -14,3 +14,4 @@ export const STOC_HS_PLAYER_ENTER = 32;
export
const
STOC_HS_PLAYER_CHANGE
=
33
;
export
const
STOC_HS_WATCH_CHANGE
=
34
;
export
const
STOC_TYPE_CHANGE
=
19
;
export
const
STOC_SELECT_HAND
=
3
;
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
0 → 100644
View file @
074a7764
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygoProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
* STOC SelectHand
*
* @usage - 通知客户端/前端提醒用户进行猜拳选择
* */
export
default
class
selectHand
implements
StocAdapter
{
packet
:
ygoProPacket
;
constructor
(
packet
:
ygoProPacket
)
{
this
.
packet
=
packet
;
}
upcast
():
ygopro
.
YgoStocMsg
{
return
new
ygopro
.
YgoStocMsg
({
stoc_select_hand
:
new
ygopro
.
StocSelectHand
({}),
});
}
}
src/service/mora/selectHand.ts
0 → 100644
View file @
074a7764
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
export
default
function
handleSelectHand
(
_
:
ygopro
.
YgoStocMsg
)
{
console
.
log
(
"
in handleSelectHand!
"
);
}
src/service/onSocketMessage.ts
View file @
074a7764
...
...
@@ -10,6 +10,7 @@ import handleChat from "./room/chat";
import
handleHsWatchChange
from
"
./room/hsWatchChange
"
;
import
{
ygoProPacket
}
from
"
../api/ocgcore/ocgAdapter/packet
"
;
import
{
adaptStoc
}
from
"
../api/ocgcore/ocgAdapter/adapter
"
;
import
handleSelectHand
from
"
./mora/selectHand
"
;
/*
* 先将从长连接中读取到的二进制数据通过Adapter转成protobuf结构体,
...
...
@@ -51,6 +52,11 @@ export default function handleSocketMessage(e: MessageEvent) {
break
;
}
case
"
stoc_select_hand
"
:
{
handleSelectHand
(
pb
);
break
;
}
default
:
{
break
;
}
...
...
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