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
bb0b665d
Commit
bb0b665d
authored
Jun 24, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle MsgHandResult and MsgRockPaperScissors and format some code
parent
70465eab
Pipeline
#22390
failed with stages
in 26 minutes and 21 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
65 additions
and
9 deletions
+65
-9
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/handResult.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/handResult.ts
+22
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
+8
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
+1
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+12
-1
src/service/duel/handResult.ts
src/service/duel/handResult.ts
+7
-0
src/service/duel/rockPaperScissors.ts
src/service/duel/rockPaperScissors.ts
+6
-0
src/ui/Duel/Message/HintNotification/index.tsx
src/ui/Duel/Message/HintNotification/index.tsx
+2
-1
src/ui/Duel/Message/SelectActionsModal/index.tsx
src/ui/Duel/Message/SelectActionsModal/index.tsx
+2
-2
src/ui/Duel/Message/SelectCardsModal/index.tsx
src/ui/Duel/Message/SelectCardsModal/index.tsx
+1
-1
src/ui/Duel/Message/SimpleSelectCardsModal/index.tsx
src/ui/Duel/Message/SimpleSelectCardsModal/index.tsx
+2
-2
src/ui/Duel/PlayMat/Card/index.tsx
src/ui/Duel/PlayMat/Card/index.tsx
+2
-2
No files found.
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/handResult.ts
0 → 100644
View file @
bb0b665d
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../../../../../rust-src/pkg/rust_src
"
;
/*
* Msg Hand Result
* @param - TODO
*
* @usage - 后端告诉前端玩家选择的猜拳结果
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
);
const
x
=
reader
.
readUint8
();
const
result1
=
x
&
0x3
;
const
result2
=
(
x
>>
2
)
&
0x3
;
return
new
ygopro
.
StocGameMessage
.
MsgHandResult
({
result1
,
result2
,
});
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
View file @
bb0b665d
...
...
@@ -244,5 +244,13 @@
"fieldType"
:
"uint8"
}
]
},
"132"
:{
"protoType"
:
"rock_paper_scissors"
,
"fields"
:[
{
"fieldName"
:
"player"
,
"fieldType"
:
"uint8"
}
}
}
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
View file @
bb0b665d
...
...
@@ -36,6 +36,7 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
[
"
confirm_cards
"
,
ygopro
.
StocGameMessage
.
MsgConfirmCards
],
[
"
become_target
"
,
ygopro
.
StocGameMessage
.
MsgBecomeTarget
],
[
"
shuffle_deck
"
,
ygopro
.
StocGameMessage
.
MsgShuffleDeck
],
[
"
rock_paper_scissors
"
,
ygopro
.
StocGameMessage
.
MsgRockPaperScissors
],
]);
export
interface
penetrateType
{
...
...
src/service/duel/gameMsg.ts
View file @
bb0b665d
import
{
ygopro
}
from
"
@/api
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
{
showWaiting
}
from
"
@/ui/Duel/Message
"
;
import
onAnnounce
from
"
./announce
"
;
...
...
@@ -15,6 +14,7 @@ import onMsgDraw from "./draw";
import
onMsgFieldDisabled
from
"
./fieldDisabled
"
;
import
onMsgFilpSummoned
from
"
./flipSummoned
"
;
import
onMsgFlipSummoning
from
"
./flipSummoning
"
;
import
onMsgHandResult
from
"
./handResult
"
;
import
onMsgHint
from
"
./hint
"
;
import
onLpUpdate
from
"
./lpUpdate
"
;
import
onMsgMove
from
"
./move
"
;
...
...
@@ -22,6 +22,7 @@ import onMsgNewPhase from "./newPhase";
import
onMsgNewTurn
from
"
./newTurn
"
;
import
onMsgPosChange
from
"
./posChange
"
;
import
onMsgReloadField
from
"
./reloadField
"
;
import
onMsgRockPaperScissors
from
"
./rockPaperScissors
"
;
import
onMsgSelectBattleCmd
from
"
./selectBattleCmd
"
;
import
onMsgSelectCard
from
"
./selectCard
"
;
import
onMsgSelectChain
from
"
./selectChain
"
;
...
...
@@ -328,6 +329,16 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
rock_paper_scissors
"
:
{
onMsgRockPaperScissors
(
msg
.
rock_paper_scissors
);
break
;
}
case
"
hand_res
"
:
{
onMsgHandResult
(
msg
.
hand_res
);
break
;
}
case
"
unimplemented
"
:
{
onUnimplemented
(
msg
.
unimplemented
);
...
...
src/service/duel/handResult.ts
0 → 100644
View file @
bb0b665d
import
{
ygopro
}
from
"
@/api
"
;
import
MsgHandResult
=
ygopro
.
StocGameMessage
.
MsgHandResult
;
export
default
(
res
:
MsgHandResult
)
=>
{
console
.
log
(
res
);
// TODO
};
src/service/duel/rockPaperScissors.ts
0 → 100644
View file @
bb0b665d
import
{
ygopro
}
from
"
@/api
"
;
export
default
(
mora
:
ygopro
.
StocGameMessage
.
MsgRockPaperScissors
)
=>
{
console
.
log
(
mora
);
// TODO
};
src/ui/Duel/Message/HintNotification/index.tsx
View file @
bb0b665d
import
"
./index.scss
"
;
import
{
message
,
notification
}
from
"
antd
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
...
...
@@ -6,7 +8,6 @@ import { fetchStrings } from "@/api";
import
{
Phase2StringCodeMap
}
from
"
@/common
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
"
./index.scss
"
;
const
style
=
{
borderStyle
:
"
groove
"
,
...
...
src/ui/Duel/Message/SelectActionsModal/index.tsx
View file @
bb0b665d
import
"
./index.scss
"
;
import
{
type
FC
}
from
"
react
"
;
import
{
proxy
,
useSnapshot
,
INTERNAL_Snapshot
as
Snapshot
}
from
"
valtio
"
;
import
{
INTERNAL_Snapshot
as
Snapshot
,
proxy
,
use
Snapshot
}
from
"
valtio
"
;
import
{
sendSelectMultiResponse
,
sendSelectSingleResponse
}
from
"
@/api
"
;
import
{
SelectCardsModal
,
type
Option
}
from
"
../SelectCardsModal
"
;
import
{
type
Option
,
SelectCardsModal
}
from
"
../SelectCardsModal
"
;
const
CANCEL_RESPONSE
=
-
1
;
const
FINISH_RESPONSE
=
-
1
;
...
...
src/ui/Duel/Message/SelectCardsModal/index.tsx
View file @
bb0b665d
...
...
@@ -3,7 +3,7 @@ import "./index.scss";
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Segmented
,
Space
,
Tooltip
}
from
"
antd
"
;
import
{
type
FC
,
useEffect
,
useState
}
from
"
react
"
;
import
{
useSnapshot
,
INTERNAL_Snapshot
as
Snapshot
}
from
"
valtio
"
;
import
{
INTERNAL_Snapshot
as
Snapshot
,
use
Snapshot
}
from
"
valtio
"
;
import
type
{
CardMeta
,
ygopro
}
from
"
@/api
"
;
import
{
fetchStrings
}
from
"
@/api
"
;
...
...
src/ui/Duel/Message/SimpleSelectCardsModal/index.tsx
View file @
bb0b665d
// import "./index.scss";
import
{
type
FC
}
from
"
react
"
;
import
{
proxy
,
useSnapshot
,
INTERNAL_Snapshot
as
Snapshot
}
from
"
valtio
"
;
import
{
INTERNAL_Snapshot
as
Snapshot
,
proxy
,
use
Snapshot
}
from
"
valtio
"
;
import
{
SelectCardsModal
,
type
Option
}
from
"
../SelectCardsModal
"
;
import
{
type
Option
,
SelectCardsModal
}
from
"
../SelectCardsModal
"
;
const
defaultProps
=
{
isOpen
:
false
,
...
...
src/ui/Duel/PlayMat/Card/index.tsx
View file @
bb0b665d
...
...
@@ -235,11 +235,11 @@ const onFieldClick = (card: CardType) => {
};
// >>> 下拉菜单:点击动作 >>>
type
Interactivy
=
{
interface
Interactivy
{
desc
:
string
;
response
:
number
;
effectCode
:
number
|
undefined
;
}
;
}
type
DropdownItem
=
NonNullable
<
MenuProps
[
"
items
"
]
>
[
number
]
&
{
onClick
:
()
=>
void
;
...
...
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