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
love_飞影
Neos
Commits
5d46d097
Commit
5d46d097
authored
Jun 05, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add delay on start
parent
6ef9a17f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
9 deletions
+10
-9
neos.config.json
neos.config.json
+1
-0
neos.config.prod.json
neos.config.prod.json
+1
-0
src/service/duel/draw.ts
src/service/duel/draw.ts
+0
-7
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+1
-1
src/service/duel/start.ts
src/service/duel/start.ts
+7
-1
No files found.
neos.config.json
View file @
5d46d097
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"chainALL"
:
false
,
"chainALL"
:
false
,
"streamInterval"
:
20
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
"ui"
:{
"ui"
:{
"hint"
:{
"hint"
:{
"waitingDuration"
:
1.5
,
"waitingDuration"
:
1.5
,
...
...
neos.config.prod.json
View file @
5d46d097
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"stringsUrl"
:
"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf"
,
"chainALL"
:
false
,
"chainALL"
:
false
,
"streamInterval"
:
20
,
"streamInterval"
:
20
,
"startDelay"
:
1000
,
"ui"
:{
"ui"
:{
"hint"
:{
"hint"
:{
"waitingDuration"
:
1.5
,
"waitingDuration"
:
1.5
,
...
...
src/service/duel/draw.ts
View file @
5d46d097
...
@@ -2,8 +2,6 @@ import { fetchCard, ygopro } from "@/api";
...
@@ -2,8 +2,6 @@ import { fetchCard, ygopro } from "@/api";
import
{
eventbus
,
Task
}
from
"
@/infra
"
;
import
{
eventbus
,
Task
}
from
"
@/infra
"
;
import
{
cardStore
,
fetchEsHintMeta
}
from
"
@/stores
"
;
import
{
cardStore
,
fetchEsHintMeta
}
from
"
@/stores
"
;
let
cnt
=
0
;
export
default
async
(
draw
:
ygopro
.
StocGameMessage
.
MsgDraw
)
=>
{
export
default
async
(
draw
:
ygopro
.
StocGameMessage
.
MsgDraw
)
=>
{
fetchEsHintMeta
({
originMsg
:
"
玩家抽卡时
"
});
fetchEsHintMeta
({
originMsg
:
"
玩家抽卡时
"
});
...
@@ -25,11 +23,6 @@ export default async (draw: ygopro.StocGameMessage.MsgDraw) => {
...
@@ -25,11 +23,6 @@ export default async (draw: ygopro.StocGameMessage.MsgDraw) => {
card
.
location
.
sequence
=
Number
(
idx
)
+
handsLength
;
card
.
location
.
sequence
=
Number
(
idx
)
+
handsLength
;
}
}
if
(
cnt
++
<
2
)
{
// FIXME 暂时性的解决方案,头两回抽卡(双方各自初始手卡)先屏蔽掉
// 不然会出现一些问题...
return
;
}
// 抽卡动画
// 抽卡动画
await
Promise
.
all
(
await
Promise
.
all
(
cardStore
cardStore
...
...
src/service/duel/gameMsg.ts
View file @
5d46d097
...
@@ -76,7 +76,7 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -76,7 +76,7 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
switch
(
msg
.
gameMsg
)
{
switch
(
msg
.
gameMsg
)
{
case
"
start
"
:
{
case
"
start
"
:
{
onMsgStart
(
msg
.
start
);
await
onMsgStart
(
msg
.
start
);
break
;
break
;
}
}
...
...
src/service/duel/start.ts
View file @
5d46d097
...
@@ -4,11 +4,13 @@ import { proxy } from "valtio";
...
@@ -4,11 +4,13 @@ import { proxy } from "valtio";
import
{
subscribeKey
}
from
"
valtio/utils
"
;
import
{
subscribeKey
}
from
"
valtio/utils
"
;
import
{
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
cardStore
,
CardType
,
store
}
from
"
@/stores
"
;
import
{
cardStore
,
CardType
,
store
}
from
"
@/stores
"
;
const
{
matStore
}
=
store
;
const
{
matStore
}
=
store
;
const
TOKEN_SIZE
=
13
;
// 每人场上最多就只可能有13个token
const
TOKEN_SIZE
=
13
;
// 每人场上最多就只可能有13个token
export
default
(
start
:
ygopro
.
StocGameMessage
.
MsgStart
)
=>
{
export
default
async
(
start
:
ygopro
.
StocGameMessage
.
MsgStart
)
=>
{
// 先初始化`matStore`
// 先初始化`matStore`
matStore
.
selfType
=
start
.
playerType
;
matStore
.
selfType
=
start
.
playerType
;
const
opponent
=
const
opponent
=
...
@@ -73,6 +75,10 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -73,6 +75,10 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
cardStore
cardStore
.
at
(
ygopro
.
CardZone
.
EXTRA
,
1
-
opponent
)
.
at
(
ygopro
.
CardZone
.
EXTRA
,
1
-
opponent
)
.
forEach
((
card
)
=>
(
card
.
code
=
myExtraDeckCodes
.
pop
()
!
));
.
forEach
((
card
)
=>
(
card
.
code
=
myExtraDeckCodes
.
pop
()
!
));
// 初始化完后,sleep 1s,让UI初始化完成,
// 否则在和AI对战时,由于后端给传给前端的`MSG`频率太高,会导致一些问题。
await
sleep
(
useConfig
().
startDelay
);
};
};
// 自动从code推断出occupant
// 自动从code推断出occupant
...
...
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