Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
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
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
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
srvpro
Commits
1d28038f
Commit
1d28038f
authored
Sep 09, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide score name
parent
17b16309
Pipeline
#29623
passed with stages
in 9 minutes and 50 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
24 deletions
+25
-24
data-manager/DataManager.js
data-manager/DataManager.js
+3
-3
data-manager/DataManager.ts
data-manager/DataManager.ts
+3
-3
data-manager/entities/RandomDuelScore.js
data-manager/entities/RandomDuelScore.js
+1
-2
data-manager/entities/RandomDuelScore.ts
data-manager/entities/RandomDuelScore.ts
+2
-3
ygopro-server.coffee
ygopro-server.coffee
+6
-5
ygopro-server.js
ygopro-server.js
+10
-8
No files found.
data-manager/DataManager.js
View file @
1d28038f
...
...
@@ -528,12 +528,12 @@ class DataManager {
newScore
.
name
=
name
;
return
await
this
.
saveRandomDuelScore
(
newScore
);
}
async
getRandomDuelScoreDisplay
(
name
)
{
async
getRandomDuelScoreDisplay
(
name
,
displayName
=
name
.
split
(
"
$
"
)[
0
]
)
{
const
score
=
await
this
.
getRandomDuelScore
(
name
);
if
(
!
score
)
{
return
`
${
name
.
split
(
"
$
"
)[
0
]
}
\${random_score_blank}`
;
return
`
${
displayName
}
\${random_score_blank}`
;
}
return
score
.
getScoreText
();
return
score
.
getScoreText
(
displayName
);
}
async
randomDuelPlayerWin
(
name
)
{
const
score
=
await
this
.
getOrCreateRandomDuelScore
(
name
);
...
...
data-manager/DataManager.ts
View file @
1d28038f
...
...
@@ -528,12 +528,12 @@ export class DataManager {
newScore
.
name
=
name
;
return
await
this
.
saveRandomDuelScore
(
newScore
);
}
async
getRandomDuelScoreDisplay
(
name
:
string
)
{
async
getRandomDuelScoreDisplay
(
name
:
string
,
displayName
=
name
.
split
(
"
$
"
)[
0
]
)
{
const
score
=
await
this
.
getRandomDuelScore
(
name
);
if
(
!
score
)
{
return
`
${
name
.
split
(
"
$
"
)[
0
]
}
\${random_score_blank}`
;
return
`
${
displayName
}
\${random_score_blank}`
;
}
return
score
.
getScoreText
();
return
score
.
getScoreText
(
displayName
);
}
async
randomDuelPlayerWin
(
name
:
string
)
{
const
score
=
await
this
.
getOrCreateRandomDuelScore
(
name
);
...
...
data-manager/entities/RandomDuelScore.js
View file @
1d28038f
...
...
@@ -33,8 +33,7 @@ let RandomDuelScore = class RandomDuelScore extends CreateAndUpdateTimeBase_1.Cr
++
this
.
fleeCount
;
this
.
lose
();
}
getScoreText
()
{
const
displayName
=
this
.
getDisplayName
();
getScoreText
(
displayName
=
this
.
getDisplayName
())
{
const
total
=
this
.
winCount
+
this
.
loseCount
;
if
(
this
.
winCount
<
2
&&
total
<
3
)
{
return
`
${
displayName
}
\${random_score_not_enough}`
;
...
...
data-manager/entities/RandomDuelScore.ts
View file @
1d28038f
...
...
@@ -40,8 +40,7 @@ export class RandomDuelScore extends CreateAndUpdateTimeBase {
this
.
lose
();
}
getScoreText
()
{
const
displayName
=
this
.
getDisplayName
();
getScoreText
(
displayName
=
this
.
getDisplayName
())
{
const
total
=
this
.
winCount
+
this
.
loseCount
;
if
(
this
.
winCount
<
2
&&
total
<
3
)
{
return
`
${
displayName
}
\${random_score_not_enough}`
;
...
...
@@ -53,4 +52,4 @@ export class RandomDuelScore extends CreateAndUpdateTimeBase {
return
`\${random_score_part1}
${
displayName
}
\${random_score_part2}
${
Math
.
ceil
(
this
.
winCount
/
total
*
100
)}
\${random_score_part3}
${
Math
.
ceil
(
this
.
fleeCount
/
total
*
100
)}
\${random_score_part4}`
;
}
}
}
\ No newline at end of file
}
ygopro-server.coffee
View file @
1d28038f
...
...
@@ -709,10 +709,10 @@ ROOM_player_flee = global.ROOM_player_flee = (name)->
await
dataManager
.
randomDuelPlayerFlee
(
name
)
return
ROOM_player_get_score
=
global
.
ROOM_player_get_score
=
(
player
)
->
ROOM_player_get_score
=
global
.
ROOM_player_get_score
=
(
player
,
display_name
)
->
if
!
settings
.
modules
.
mysql
.
enabled
return
""
return
await
dataManager
.
getRandomDuelScoreDisplay
(
player
.
name_vpass
)
return
await
dataManager
.
getRandomDuelScoreDisplay
(
player
.
name_vpass
,
display_name
)
ROOM_find_or_create_by_name
=
global
.
ROOM_find_or_create_by_name
=
(
name
,
player_ip
)
->
uname
=
name
.
toUpperCase
()
...
...
@@ -2446,9 +2446,10 @@ ygopro.stoc_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
#client.score_shown = true
return
if
settings
.
modules
.
random_duel
.
record_match_scores
and
room
.
random_type
==
'M'
ygopro
.
stoc_send_chat_to_room
(
room
,
await
ROOM_player_get_score
(
client
),
ygopro
.
constants
.
COLORS
.
GREEN
)
for
player
in
room
.
players
when
player
.
pos
!=
7
and
player
!=
client
ygopro
.
stoc_send_chat
(
client
,
await
ROOM_player_get_score
(
player
),
ygopro
.
constants
.
COLORS
.
GREEN
)
ygopro
.
stoc_send_chat_to_room
(
room
,
await
ROOM_player_get_score
(
client
,
client
.
name
),
ygopro
.
constants
.
COLORS
.
GREEN
)
if
not
settings
.
modules
.
hide_name
for
player
in
room
.
players
when
player
.
pos
!=
7
and
player
!=
client
ygopro
.
stoc_send_chat
(
client
,
await
ROOM_player_get_score
(
player
,
room
.
getMaskedPlayerName
(
player
,
client
)),
ygopro
.
constants
.
COLORS
.
GREEN
)
if
!
room
.
recorder
room
.
recorder
=
recorder
=
net
.
connect
room
.
port
,
->
ygopro
.
ctos_send
recorder
,
'PLAYER_INFO'
,
{
...
...
ygopro-server.js
View file @
1d28038f
...
...
@@ -916,11 +916,11 @@
await
dataManager
.
randomDuelPlayerFlee
(
name
);
};
ROOM_player_get_score
=
global
.
ROOM_player_get_score
=
async
function
(
player
)
{
ROOM_player_get_score
=
global
.
ROOM_player_get_score
=
async
function
(
player
,
display_name
)
{
if
(
!
settings
.
modules
.
mysql
.
enabled
)
{
return
""
;
}
return
(
await
dataManager
.
getRandomDuelScoreDisplay
(
player
.
name_vpass
));
return
(
await
dataManager
.
getRandomDuelScoreDisplay
(
player
.
name_vpass
,
display_name
));
};
ROOM_find_or_create_by_name
=
global
.
ROOM_find_or_create_by_name
=
async
function
(
name
,
player_ip
)
{
...
...
@@ -3215,12 +3215,14 @@
}
//client.score_shown = true
if
(
settings
.
modules
.
random_duel
.
record_match_scores
&&
room
.
random_type
===
'
M
'
)
{
ygopro
.
stoc_send_chat_to_room
(
room
,
(
await
ROOM_player_get_score
(
client
)),
ygopro
.
constants
.
COLORS
.
GREEN
);
ref
=
room
.
players
;
for
(
j
=
0
,
len
=
ref
.
length
;
j
<
len
;
j
++
)
{
player
=
ref
[
j
];
if
(
player
.
pos
!==
7
&&
player
!==
client
)
{
ygopro
.
stoc_send_chat
(
client
,
(
await
ROOM_player_get_score
(
player
)),
ygopro
.
constants
.
COLORS
.
GREEN
);
ygopro
.
stoc_send_chat_to_room
(
room
,
(
await
ROOM_player_get_score
(
client
,
client
.
name
)),
ygopro
.
constants
.
COLORS
.
GREEN
);
if
(
!
settings
.
modules
.
hide_name
)
{
ref
=
room
.
players
;
for
(
j
=
0
,
len
=
ref
.
length
;
j
<
len
;
j
++
)
{
player
=
ref
[
j
];
if
(
player
.
pos
!==
7
&&
player
!==
client
)
{
ygopro
.
stoc_send_chat
(
client
,
(
await
ROOM_player_get_score
(
player
,
room
.
getMaskedPlayerName
(
player
,
client
))),
ygopro
.
constants
.
COLORS
.
GREEN
);
}
}
}
}
...
...
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