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
4
Merge Requests
4
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
9d5ff8ec
Commit
9d5ff8ec
authored
Nov 06, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d51ac1c0
Pipeline
#17780
passed with stages
in 3 minutes and 10 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
0 deletions
+33
-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/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+19
-0
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+6
-0
No files found.
src/api/ocgcore/ocgAdapter/adapter.ts
View file @
9d5ff8ec
...
@@ -12,6 +12,7 @@ import {
...
@@ -12,6 +12,7 @@ import {
STOC_HAND_RESULT
,
STOC_HAND_RESULT
,
STOC_DECK_COUNT
,
STOC_DECK_COUNT
,
STOC_DUEL_START
,
STOC_DUEL_START
,
STOC_GAME_MSG
,
}
from
"
./protoDecl
"
;
}
from
"
./protoDecl
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocJoinGame
from
"
./stoc/stocJoinGame
"
;
import
StocJoinGame
from
"
./stoc/stocJoinGame
"
;
...
@@ -22,6 +23,7 @@ import StocTypeChange from "./stoc/stocTypeChange";
...
@@ -22,6 +23,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
StocGameMsg
from
"
./stoc/stocGameMsg/mod
"
;
/*
/*
* 将[`ygoProPacket`]对象转换成[`ygopro.YgoStocMsg`]对象
* 将[`ygoProPacket`]对象转换成[`ygopro.YgoStocMsg`]对象
...
@@ -87,6 +89,11 @@ export function adaptStoc(packet: YgoProPacket): ygopro.YgoStocMsg {
...
@@ -87,6 +89,11 @@ export function adaptStoc(packet: YgoProPacket): ygopro.YgoStocMsg {
break
;
break
;
}
}
case
STOC_GAME_MSG
:
{
pb
=
new
StocGameMsg
(
packet
).
upcast
();
break
;
}
default
:
{
default
:
{
break
;
break
;
}
}
...
...
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
9d5ff8ec
...
@@ -21,5 +21,6 @@ export const STOC_SELECT_TP = 4;
...
@@ -21,5 +21,6 @@ export const STOC_SELECT_TP = 4;
export
const
STOC_HAND_RESULT
=
5
;
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
MSG_START
=
4
;
export
const
MSG_START
=
4
;
src/service/duel/gameMsg.ts
0 → 100644
View file @
9d5ff8ec
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
msg
=
pb
.
stoc_game_msg
;
switch
(
msg
.
gameMsg
)
{
case
"
start
"
:
{
// TODO
console
.
log
(
msg
.
start
);
break
;
}
default
:
{
console
.
log
(
"
Unhandled GameMsg=
"
+
msg
.
gameMsg
);
break
;
}
}
}
src/service/onSocketMessage.ts
View file @
9d5ff8ec
...
@@ -13,6 +13,7 @@ import { adaptStoc } from "../api/ocgcore/ocgAdapter/adapter";
...
@@ -13,6 +13,7 @@ import { adaptStoc } from "../api/ocgcore/ocgAdapter/adapter";
import
handleSelectHand
from
"
./mora/selectHand
"
;
import
handleSelectHand
from
"
./mora/selectHand
"
;
import
handleSelectTp
from
"
./mora/selectTp
"
;
import
handleSelectTp
from
"
./mora/selectTp
"
;
import
handleDeckCount
from
"
./mora/deckCount
"
;
import
handleDeckCount
from
"
./mora/deckCount
"
;
import
handleGameMsg
from
"
./duel/gameMsg
"
;
/*
/*
* 先将从长连接中读取到的二进制数据通过Adapter转成protobuf结构体,
* 先将从长连接中读取到的二进制数据通过Adapter转成protobuf结构体,
...
@@ -81,6 +82,11 @@ export default function handleSocketMessage(e: MessageEvent) {
...
@@ -81,6 +82,11 @@ export default function handleSocketMessage(e: MessageEvent) {
break
;
break
;
}
}
case
"
stoc_game_msg
"
:
{
handleGameMsg
(
pb
);
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