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
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
nanahira
srvpro
Commits
657ef72a
Commit
657ef72a
authored
Jul 23, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tcg_random'
parents
cc917435
64e8e1c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
160 additions
and
6 deletions
+160
-6
data/default_config.json
data/default_config.json
+9
-1
ygopro-server.coffee
ygopro-server.coffee
+72
-2
ygopro-server.js
ygopro-server.js
+79
-3
No files found.
data/default_config.json
View file @
657ef72a
...
@@ -89,7 +89,15 @@
...
@@ -89,7 +89,15 @@
"blank_pass_modes"
:
{
"blank_pass_modes"
:
{
"S"
:
true
,
"S"
:
true
,
"M"
:
true
,
"M"
:
true
,
"T"
:
false
"T"
:
false
,
"OOR"
:
true
,
"TOR"
:
true
,
"OR"
:
true
,
"TR"
:
true
,
"OOMR"
:
true
,
"TOMR"
:
true
,
"OMR"
:
true
,
"TMR"
:
true
},
},
"ready_time"
:
20
,
"ready_time"
:
20
,
"hang_timeout"
:
90
"hang_timeout"
:
90
...
...
ygopro-server.coffee
View file @
657ef72a
...
@@ -352,8 +352,37 @@ init = () ->
...
@@ -352,8 +352,37 @@ init = () ->
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"S"
:
true
,
"M"
:
true
,
"T"
:
false
}
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"S"
:
true
,
"M"
:
true
,
"T"
:
false
}
delete
settings
.
modules
.
random_duel
.
blank_pass_match
delete
settings
.
modules
.
random_duel
.
blank_pass_match
imported
=
true
imported
=
true
#import the old random_duel.blank_pass_match option
if
settings
.
modules
.
random_duel
.
blank_pass_match
==
true
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"S"
:
true
,
"M"
:
true
,
"T"
:
false
,
"OOR"
:
true
,
"TOR"
:
true
,
"OR"
:
true
,
"TR"
:
true
,
"OOMR"
:
true
,
"TOMR"
:
true
,
"OMR"
:
true
,
"TMR"
:
true
}
delete
settings
.
modules
.
random_duel
.
blank_pass_match
imported
=
true
if
settings
.
modules
.
random_duel
.
blank_pass_match
==
false
if
settings
.
modules
.
random_duel
.
blank_pass_match
==
false
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"S"
:
true
,
"M"
:
false
,
"T"
:
false
}
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"S"
:
true
,
"M"
:
true
,
"T"
:
false
,
"OOR"
:
true
,
"TOR"
:
true
,
"OR"
:
true
,
"TR"
:
true
,
"OOMR"
:
false
,
"TOMR"
:
false
,
"OMR"
:
false
,
"TMR"
:
false
}
delete
settings
.
modules
.
random_duel
.
blank_pass_match
delete
settings
.
modules
.
random_duel
.
blank_pass_match
imported
=
true
imported
=
true
#finish
#finish
...
@@ -775,7 +804,7 @@ ROOM_find_or_create_by_name = global.ROOM_find_or_create_by_name = (name, player
...
@@ -775,7 +804,7 @@ ROOM_find_or_create_by_name = global.ROOM_find_or_create_by_name = (name, player
uname
=
name
.
toUpperCase
()
uname
=
name
.
toUpperCase
()
if
settings
.
modules
.
windbot
.
enabled
and
(
uname
[
0
...
2
]
==
'AI'
or
(
!
settings
.
modules
.
random_duel
.
enabled
and
uname
==
''
))
if
settings
.
modules
.
windbot
.
enabled
and
(
uname
[
0
...
2
]
==
'AI'
or
(
!
settings
.
modules
.
random_duel
.
enabled
and
uname
==
''
))
return
ROOM_find_or_create_ai
(
name
)
return
ROOM_find_or_create_ai
(
name
)
if
settings
.
modules
.
random_duel
.
enabled
and
(
uname
==
''
or
uname
==
'S'
or
uname
==
'M'
or
uname
==
'T'
)
if
settings
.
modules
.
random_duel
.
enabled
and
(
uname
==
''
or
uname
==
'S'
or
uname
==
'M'
or
uname
==
'T'
or
uname
==
'TOR'
or
uname
==
'TR'
or
uname
==
'OOR'
or
uname
==
'OR'
or
uname
==
'TOMR'
or
uname
==
'TMR'
or
uname
==
'OOMR'
or
uname
==
'OMR'
)
return
await
ROOM_find_or_create_random
(
uname
,
player_ip
)
return
await
ROOM_find_or_create_random
(
uname
,
player_ip
)
if
room
=
ROOM_find_by_name
(
name
)
if
room
=
ROOM_find_by_name
(
name
)
return
room
return
room
...
@@ -1328,6 +1357,42 @@ class Room
...
@@ -1328,6 +1357,42 @@ class Room
@
hostinfo
.
mode
=
2
@
hostinfo
.
mode
=
2
@
hostinfo
.
start_lp
=
16000
@
hostinfo
.
start_lp
=
16000
if
(
rule
.
match
/(^|,|,)(OOR|OCGONLYRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
0
@
hostinfo
.
lflist
=
0
if
(
rule
.
match
/(^|,|,)(OR|OCGRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
2
@
hostinfo
.
lflist
=
0
if
(
rule
.
match
/(^|,|,)(TOR|TCGONLYRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
1
@
hostinfo
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
list
.
tcg
if
(
rule
.
match
/(^|,|,)(TR|TCGRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
2
@
hostinfo
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
list
.
tcg
if
(
rule
.
match
/(^|,|,)(OOMR|OCGONLYMATCHRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
0
@
hostinfo
.
lflist
=
0
@
hostinfo
.
mode
=
1
if
(
rule
.
match
/(^|,|,)(OMR|OCGMATCHRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
2
@
hostinfo
.
lflist
=
0
@
hostinfo
.
mode
=
1
if
(
rule
.
match
/(^|,|,)(TOMR|TCGONLYMATCHRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
1
@
hostinfo
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
list
.
tcg
@
hostinfo
.
mode
=
1
if
(
rule
.
match
/(^|,|,)(TMR|TCGMATCHRANDOM)(,|,|$)/
)
@
hostinfo
.
rule
=
2
@
hostinfo
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
list
.
tcg
@
hostinfo
.
mode
=
1
if
(
rule
.
match
/(^|,|,)(TCGONLY|TO)(,|,|$)/
)
if
(
rule
.
match
/(^|,|,)(TCGONLY|TO)(,|,|$)/
)
@
hostinfo
.
rule
=
1
@
hostinfo
.
rule
=
1
@
hostinfo
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
list
.
tcg
@
hostinfo
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
list
.
tcg
...
@@ -3154,6 +3219,11 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server, datas)->
...
@@ -3154,6 +3219,11 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server, datas)->
deck_arena
=
deck_arena
+
room
.
arena
deck_arena
=
deck_arena
+
room
.
arena
else
if
room
.
hostinfo
.
mode
==
2
else
if
room
.
hostinfo
.
mode
==
2
deck_arena
=
deck_arena
+
'tag'
deck_arena
=
deck_arena
+
'tag'
else
if
room
.
random_type
and
_
.
endsWith
(
room
.
random_type
,
'R'
)
if
_
.
endsWith
(
room
.
random_type
,
'MR'
)
deck_arena
=
deck_arena
+
'athletic'
else
deck_arena
=
deck_arena
+
'entertain'
else
if
room
.
random_type
==
'S'
else
if
room
.
random_type
==
'S'
deck_arena
=
deck_arena
+
'entertain'
deck_arena
=
deck_arena
+
'entertain'
else
if
room
.
random_type
==
'M'
else
if
room
.
random_type
==
'M'
...
...
ygopro-server.js
View file @
657ef72a
...
@@ -462,11 +462,37 @@
...
@@ -462,11 +462,37 @@
delete
settings
.
modules
.
random_duel
.
blank_pass_match
;
delete
settings
.
modules
.
random_duel
.
blank_pass_match
;
imported
=
true
;
imported
=
true
;
}
}
//import the old random_duel.blank_pass_match option
if
(
settings
.
modules
.
random_duel
.
blank_pass_match
===
true
)
{
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"
S
"
:
true
,
"
M
"
:
true
,
"
T
"
:
false
,
"
OOR
"
:
true
,
"
TOR
"
:
true
,
"
OR
"
:
true
,
"
TR
"
:
true
,
"
OOMR
"
:
true
,
"
TOMR
"
:
true
,
"
OMR
"
:
true
,
"
TMR
"
:
true
};
delete
settings
.
modules
.
random_duel
.
blank_pass_match
;
imported
=
true
;
}
if
(
settings
.
modules
.
random_duel
.
blank_pass_match
===
false
)
{
if
(
settings
.
modules
.
random_duel
.
blank_pass_match
===
false
)
{
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
settings
.
modules
.
random_duel
.
blank_pass_modes
=
{
"
S
"
:
true
,
"
S
"
:
true
,
"
M
"
:
false
,
"
M
"
:
true
,
"
T
"
:
false
"
T
"
:
false
,
"
OOR
"
:
true
,
"
TOR
"
:
true
,
"
OR
"
:
true
,
"
TR
"
:
true
,
"
OOMR
"
:
false
,
"
TOMR
"
:
false
,
"
OMR
"
:
false
,
"
TMR
"
:
false
};
};
delete
settings
.
modules
.
random_duel
.
blank_pass_match
;
delete
settings
.
modules
.
random_duel
.
blank_pass_match
;
imported
=
true
;
imported
=
true
;
...
@@ -1005,7 +1031,7 @@
...
@@ -1005,7 +1031,7 @@
if
(
settings
.
modules
.
windbot
.
enabled
&&
(
uname
.
slice
(
0
,
2
)
===
'
AI
'
||
(
!
settings
.
modules
.
random_duel
.
enabled
&&
uname
===
''
)))
{
if
(
settings
.
modules
.
windbot
.
enabled
&&
(
uname
.
slice
(
0
,
2
)
===
'
AI
'
||
(
!
settings
.
modules
.
random_duel
.
enabled
&&
uname
===
''
)))
{
return
ROOM_find_or_create_ai
(
name
);
return
ROOM_find_or_create_ai
(
name
);
}
}
if
(
settings
.
modules
.
random_duel
.
enabled
&&
(
uname
===
''
||
uname
===
'
S
'
||
uname
===
'
M
'
||
uname
===
'
T
'
))
{
if
(
settings
.
modules
.
random_duel
.
enabled
&&
(
uname
===
''
||
uname
===
'
S
'
||
uname
===
'
M
'
||
uname
===
'
T
'
||
uname
===
'
TOR
'
||
uname
===
'
TR
'
||
uname
===
'
OOR
'
||
uname
===
'
OR
'
||
uname
===
'
TOMR
'
||
uname
===
'
TMR
'
||
uname
===
'
OOMR
'
||
uname
===
'
OMR
'
))
{
return
(
await
ROOM_find_or_create_random
(
uname
,
player_ip
));
return
(
await
ROOM_find_or_create_random
(
uname
,
player_ip
));
}
}
if
(
room
=
ROOM_find_by_name
(
name
))
{
if
(
room
=
ROOM_find_by_name
(
name
))
{
...
@@ -1739,6 +1765,50 @@
...
@@ -1739,6 +1765,50 @@
this
.
hostinfo
.
mode
=
2
;
this
.
hostinfo
.
mode
=
2
;
this
.
hostinfo
.
start_lp
=
16000
;
this
.
hostinfo
.
start_lp
=
16000
;
}
}
if
(
rule
.
match
(
/
(
^|,|,
)(
OOR|OCGONLYRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
0
;
this
.
hostinfo
.
lflist
=
0
;
}
if
(
rule
.
match
(
/
(
^|,|,
)(
OR|OCGRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
2
;
this
.
hostinfo
.
lflist
=
0
;
}
if
(
rule
.
match
(
/
(
^|,|,
)(
TOR|TCGONLYRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
1
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
return
list
.
tcg
;
});
}
if
(
rule
.
match
(
/
(
^|,|,
)(
TR|TCGRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
2
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
return
list
.
tcg
;
});
}
if
(
rule
.
match
(
/
(
^|,|,
)(
OOMR|OCGONLYMATCHRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
0
;
this
.
hostinfo
.
lflist
=
0
;
this
.
hostinfo
.
mode
=
1
;
}
if
(
rule
.
match
(
/
(
^|,|,
)(
OMR|OCGMATCHRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
2
;
this
.
hostinfo
.
lflist
=
0
;
this
.
hostinfo
.
mode
=
1
;
}
if
(
rule
.
match
(
/
(
^|,|,
)(
TOMR|TCGONLYMATCHRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
1
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
return
list
.
tcg
;
});
this
.
hostinfo
.
mode
=
1
;
}
if
(
rule
.
match
(
/
(
^|,|,
)(
TMR|TCGMATCHRANDOM
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
2
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
return
list
.
tcg
;
});
this
.
hostinfo
.
mode
=
1
;
}
if
(
rule
.
match
(
/
(
^|,|,
)(
TCGONLY|TO
)(
,|,|$
)
/
))
{
if
(
rule
.
match
(
/
(
^|,|,
)(
TCGONLY|TO
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
1
;
this
.
hostinfo
.
rule
=
1
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
...
@@ -4218,6 +4288,12 @@
...
@@ -4218,6 +4288,12 @@
deck_arena
=
deck_arena
+
room
.
arena
;
deck_arena
=
deck_arena
+
room
.
arena
;
}
else
if
(
room
.
hostinfo
.
mode
===
2
)
{
}
else
if
(
room
.
hostinfo
.
mode
===
2
)
{
deck_arena
=
deck_arena
+
'
tag
'
;
deck_arena
=
deck_arena
+
'
tag
'
;
}
else
if
(
room
.
random_type
&&
_
.
endsWith
(
room
.
random_type
,
'
R
'
))
{
if
(
_
.
endsWith
(
room
.
random_type
,
'
MR
'
))
{
deck_arena
=
deck_arena
+
'
athletic
'
;
}
else
{
deck_arena
=
deck_arena
+
'
entertain
'
;
}
}
else
if
(
room
.
random_type
===
'
S
'
)
{
}
else
if
(
room
.
random_type
===
'
S
'
)
{
deck_arena
=
deck_arena
+
'
entertain
'
;
deck_arena
=
deck_arena
+
'
entertain
'
;
}
else
if
(
room
.
random_type
===
'
M
'
)
{
}
else
if
(
room
.
random_type
===
'
M
'
)
{
...
...
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