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
14051878
Commit
14051878
authored
Mar 10, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add win adapter and service
parent
8e94b5ed
Pipeline
#20560
passed with stages
in 6 minutes and 21 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
0 deletions
+47
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+1
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+6
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
+28
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+6
-0
src/service/duel/win.ts
src/service/duel/win.ts
+6
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
14051878
...
...
@@ -45,3 +45,4 @@ export const MSG_SELECT_UNSELECT_CARD = 26;
export
const
MSG_DAMAGE
=
91
;
export
const
MSG_RECOVER
=
92
;
export
const
MSG_PAY_LP_COST
=
100
;
export
const
MSG_WIN
=
5
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
14051878
...
...
@@ -22,6 +22,7 @@ import MsgSelectBattleCmdAdapter from "./selectBattleCmd";
import
MsgSelectUnselectCardAdapter
from
"
./selectUnselectCard
"
;
import
MsgDamage
from
"
./damage
"
;
import
MsgRecover
from
"
./recover
"
;
import
MsgWin
from
"
./win
"
;
import
PENETRATE
from
"
./penetrate
"
;
/*
...
...
@@ -130,6 +131,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_WIN
:
{
gameMsg
.
win
=
MsgWin
(
gameData
);
break
;
}
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
0 → 100644
View file @
14051878
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../bufferIO
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
/*
* Msg Win
*
* @param player - 玩家编号
* @param winType - 结果类型
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
,
true
);
const
player
=
reader
.
readUint8
();
const
winType
=
reader
.
readUint8
();
const
type_
=
player
==
0
||
winType
==
4
?
MsgWin
.
ActionType
.
Win
:
player
==
1
?
MsgWin
.
ActionType
.
Defeated
:
MsgWin
.
ActionType
.
UNKNOWN
;
return
new
MsgWin
({
player
,
type_
,
});
};
src/service/duel/gameMsg.ts
View file @
14051878
...
...
@@ -19,6 +19,7 @@ import onMsgPosChange from "./posChange";
import
onMsgSelectUnselectCard
from
"
./selectUnselectCard
"
;
import
onMsgSelectYesNo
from
"
./selectYesNo
"
;
import
onMsgUpdateHp
from
"
./updateHp
"
;
import
onMsgWin
from
"
./win
"
;
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
...
...
@@ -120,6 +121,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
win
"
:
{
onMsgWin
(
msg
.
win
,
dispatch
);
break
;
}
default
:
{
break
;
}
...
...
src/service/duel/win.ts
0 → 100644
View file @
14051878
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
export
default
(
win
:
ygopro
.
StocGameMessage
.
MsgWin
,
dispatch
:
AppDispatch
)
=>
{
console
.
log
(
win
);
};
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