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
dc38dcb0
Commit
dc38dcb0
authored
Aug 29, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't load lflist date
parent
2786c6f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
ygopro-server.coffee
ygopro-server.coffee
+5
-5
ygopro-server.js
ygopro-server.js
+5
-7
No files found.
ygopro-server.coffee
View file @
dc38dcb0
...
...
@@ -243,7 +243,7 @@ ROOM_find_or_create_ai = (name)->
name
=
name
+
'#'
+
Math
.
floor
(
Math
.
random
()
*
100000
)
if
name
.
replace
(
/[^\x00-\xff]/g
,
"00"
).
length
>
20
log
.
info
"long ai name"
,
name
return
{
"error"
:
"AI房间名过长"
}
return
{
"error"
:
"AI房间名过长
,请在建立房间后输入 /ai 来添加AI
"
}
result
=
new
Room
(
name
)
result
.
windbot
=
windbot
return
result
...
...
@@ -288,7 +288,7 @@ class Room
ROOM_all
.
push
this
@
hostinfo
||=
lflist
:
_
.
findIndex
settings
.
lflist
,
(
list
)
->
!
list
.
tcg
and
list
.
date
.
isBefore
()
lflist
:
if
settings
.
lflist
.
length
then
0
else
-
1
rule
:
if
settings
.
modules
.
enable_TCG_as_default
then
2
else
0
mode
:
0
enable_priority
:
false
...
...
@@ -339,9 +339,9 @@ class Room
switch
rule
.
charAt
(
2
)
when
"1"
,
"T"
@
hostinfo
.
lflist
=
_
.
findIndex
settings
.
lflist
,
(
list
)
->
list
.
tcg
and
list
.
date
.
isBefore
()
@
hostinfo
.
lflist
=
_
.
findIndex
settings
.
lflist
,
(
list
)
->
list
.
tcg
else
@
hostinfo
.
lflist
=
_
.
findIndex
settings
.
lflist
,
(
list
)
->
!
list
.
tcg
and
list
.
date
.
isBefore
()
@
hostinfo
.
lflist
=
_
.
findIndex
settings
.
lflist
,
(
list
)
->
!
list
.
tcg
if
((
param
=
parseInt
(
rule
.
charAt
(
3
).
match
(
/\d/
)))
>=
0
)
@
hostinfo
.
time_limit
=
param
*
60
...
...
@@ -386,7 +386,7 @@ class Room
if
(
rule
.
match
/(^|,|,)(TCGONLY|TO)(,|,|$)/
)
@
hostinfo
.
rule
=
1
@
hostinfo
.
lflist
=
_
.
findIndex
settings
.
lflist
,
(
list
)
->
list
.
tcg
and
list
.
date
.
isBefore
()
@
hostinfo
.
lflist
=
_
.
findIndex
settings
.
lflist
,
(
list
)
->
list
.
tcg
if
(
rule
.
match
/(^|,|,)(OCGONLY|OO)(,|,|$)/
)
@
hostinfo
.
rule
=
0
...
...
ygopro-server.js
View file @
dc38dcb0
...
...
@@ -339,7 +339,7 @@
if
(
name
.
replace
(
/
[^\x
00-
\x
ff
]
/g
,
"
00
"
).
length
>
20
)
{
log
.
info
(
"
long ai name
"
,
name
);
return
{
"
error
"
:
"
AI房间名过长
"
"
error
"
:
"
AI房间名过长
,请在建立房间后输入 /ai 来添加AI
"
};
}
result
=
new
Room
(
name
);
...
...
@@ -400,9 +400,7 @@
this
.
welcome
=
''
;
ROOM_all
.
push
(
this
);
this
.
hostinfo
||
(
this
.
hostinfo
=
{
lflist
:
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
!
list
.
tcg
&&
list
.
date
.
isBefore
();
}),
lflist
:
settings
.
lflist
.
length
?
0
:
-
1
,
rule
:
settings
.
modules
.
enable_TCG_as_default
?
2
:
0
,
mode
:
0
,
enable_priority
:
false
,
...
...
@@ -459,12 +457,12 @@
case
"
1
"
:
case
"
T
"
:
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
list
.
tcg
&&
list
.
date
.
isBefore
()
;
return
list
.
tcg
;
});
break
;
default
:
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
!
list
.
tcg
&&
list
.
date
.
isBefore
()
;
return
!
list
.
tcg
;
});
}
if
((
param
=
parseInt
(
rule
.
charAt
(
3
).
match
(
/
\d
/
)))
>=
0
)
{
...
...
@@ -515,7 +513,7 @@
if
(
rule
.
match
(
/
(
^|,|,
)(
TCGONLY|TO
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
1
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
list
.
tcg
&&
list
.
date
.
isBefore
()
;
return
list
.
tcg
;
});
}
if
(
rule
.
match
(
/
(
^|,|,
)(
OCGONLY|OO
)(
,|,|$
)
/
))
{
...
...
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