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
BBeretta
Neos
Commits
117b2184
Commit
117b2184
authored
Mar 05, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle duelstart message
parent
346699eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
src/api/ocgcore/ocgAdapter/adapter.ts
src/api/ocgcore/ocgAdapter/adapter.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocDuelStart.ts
src/api/ocgcore/ocgAdapter/stoc/stocDuelStart.ts
+21
-0
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+2
-2
src/service/room/duelStart.ts
src/service/room/duelStart.ts
+9
-0
No files found.
src/api/ocgcore/ocgAdapter/adapter.ts
View file @
117b2184
...
...
@@ -26,6 +26,7 @@ import StocSelectTp from "./stoc/stocSelectTp";
import
StocDeckCount
from
"
./stoc/stocDeckCount
"
;
import
StocTimeLimit
from
"
./stoc/stocTimeLimit
"
;
import
StocGameMsg
from
"
./stoc/stocGameMsg/mod
"
;
import
StocDuelStart
from
"
./stoc/stocDuelStart
"
;
/*
* 将[`ygoProPacket`]对象转换成[`ygopro.YgoStocMsg`]对象
...
...
@@ -87,7 +88,7 @@ export function adaptStoc(packet: YgoProPacket): ygopro.YgoStocMsg {
break
;
}
case
STOC_DUEL_START
:
{
// TODO
pb
=
new
StocDuelStart
(
packet
).
upcast
();
break
;
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocDuelStart.ts
0 → 100644
View file @
117b2184
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
* STOC DuelStart
*
* @usage - 通知客户端决斗开始
* */
export
default
class
DuelStart
implements
StocAdapter
{
packet
:
YgoProPacket
;
constructor
(
packet
:
YgoProPacket
)
{
this
.
packet
=
packet
;
}
upcast
():
ygopro
.
YgoStocMsg
{
return
new
ygopro
.
YgoStocMsg
({
stoc_duel_start
:
new
ygopro
.
StocDuelStart
({}),
});
}
}
src/service/onSocketMessage.ts
View file @
117b2184
...
...
@@ -15,6 +15,7 @@ import handleSelectTp from "./mora/selectTp";
import
handleDeckCount
from
"
./mora/deckCount
"
;
import
handleGameMsg
from
"
./duel/gameMsg
"
;
import
handleTimeLimit
from
"
./duel/timeLimit
"
;
import
handleDuelStart
from
"
./room/duelStart
"
;
/*
* 先将从长连接中读取到的二进制数据通过Adapter转成protobuf结构体,
...
...
@@ -78,8 +79,7 @@ export default function handleSocketMessage(e: MessageEvent) {
break
;
}
case
"
stoc_duel_start
"
:
{
// TODO
console
.
log
(
"
TODO: handle STOC DuleStart.
"
);
handleDuelStart
(
pb
);
break
;
}
...
...
src/service/room/duelStart.ts
0 → 100644
View file @
117b2184
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
duelStart
}
from
"
../../reducers/moraSlice
"
;
import
{
store
}
from
"
../../store
"
;
export
default
function
handleDuelStart
(
_pb
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
dispatch
(
duelStart
());
}
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