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
1c8310b7
Commit
1c8310b7
authored
Jul 26, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update config
parent
b42b8997
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
16 deletions
+26
-16
data/default_config.json
data/default_config.json
+1
-1
data/default_data.json
data/default_data.json
+1
-0
ygopro-server.coffee
ygopro-server.coffee
+6
-3
ygopro-server.js
ygopro-server.js
+18
-12
No files found.
data/default_config.json
View file @
1c8310b7
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
},
},
"vip"
:
{
"vip"
:
{
"enabled"
:
false
,
"enabled"
:
false
,
"generate_count"
:
5
0
"generate_count"
:
100
0
},
},
"random_duel"
:
{
"random_duel"
:
{
"enabled"
:
false
,
"enabled"
:
false
,
...
...
data/default_data.json
View file @
1c8310b7
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
"180"
:
[],
"180"
:
[],
"90"
:
[],
"90"
:
[],
"30"
:
[],
"30"
:
[],
"15"
:
[],
"7"
:
[],
"7"
:
[],
"3"
:
[],
"3"
:
[],
"1"
:
[]
"1"
:
[]
...
...
ygopro-server.coffee
View file @
1c8310b7
...
@@ -155,10 +155,11 @@ setting_change = (settings, path, val) ->
...
@@ -155,10 +155,11 @@ setting_change = (settings, path, val) ->
VIP_generate_cdkeys
=
(
key_type
,
count
)
->
VIP_generate_cdkeys
=
(
key_type
,
count
)
->
return
false
unless
settings
.
modules
.
vip
.
enabled
and
vip_info
.
cdkeys
[
key_type
]
return
false
unless
settings
.
modules
.
vip
.
enabled
and
vip_info
.
cdkeys
[
key_type
]
for
i
in
[
1
...
count
]
for
i
in
[
0
...
count
]
key
=
Math
.
floor
(
Math
.
random
()
*
10000000000000000
).
toString
()
key
=
Math
.
floor
(
Math
.
random
()
*
10000000000000000
).
toString
()
vip_info
.
cdkeys
[
key_type
].
push
(
key
)
vip_info
.
cdkeys
[
key_type
].
push
(
key
)
setting_save
(
vip_info
)
setting_save
(
vip_info
)
log
.
info
(
"keys generated"
,
key_type
,
count
,
vip_info
.
cdkeys
[
key_type
].
length
)
return
true
return
true
CLIENT_use_cdkey
=
(
client
,
pkey
)
->
CLIENT_use_cdkey
=
(
client
,
pkey
)
->
...
@@ -280,8 +281,6 @@ try
...
@@ -280,8 +281,6 @@ try
vip_info
=
loadJSON
(
'./config/vip_info.json'
)
vip_info
=
loadJSON
(
'./config/vip_info.json'
)
catch
catch
vip_info
=
default_data
.
vip_info
vip_info
=
default_data
.
vip_info
for
k
,
v
of
vip_info
.
cdkeys
VIP_generate_cdkeys
(
k
,
settings
.
modules
.
vip
.
generate_count
)
setting_save
(
vip_info
)
setting_save
(
vip_info
)
try
try
...
@@ -358,6 +357,10 @@ if settings.modules.challonge.enabled
...
@@ -358,6 +357,10 @@ if settings.modules.challonge.enabled
apiKey
:
settings
.
modules
.
challonge
.
api_key
apiKey
:
settings
.
modules
.
challonge
.
api_key
})
})
if
settings
.
modules
.
vip
.
enabled
for
k
,
v
of
vip_info
.
cdkeys
when
v
.
length
==
0
VIP_generate_cdkeys
(
k
,
settings
.
modules
.
vip
.
generate_count
)
# 获取可用内存
# 获取可用内存
memory_usage
=
0
memory_usage
=
0
get_memory_usage
=
()
->
get_memory_usage
=
()
->
...
...
ygopro-server.js
View file @
1c8310b7
...
@@ -165,11 +165,12 @@
...
@@ -165,11 +165,12 @@
if
(
!
(
settings
.
modules
.
vip
.
enabled
&&
vip_info
.
cdkeys
[
key_type
]))
{
if
(
!
(
settings
.
modules
.
vip
.
enabled
&&
vip_info
.
cdkeys
[
key_type
]))
{
return
false
;
return
false
;
}
}
for
(
i
=
j
=
1
,
ref
=
count
;
1
<=
ref
?
j
<
ref
:
j
>
ref
;
i
=
1
<=
ref
?
++
j
:
--
j
)
{
for
(
i
=
j
=
0
,
ref
=
count
;
0
<=
ref
?
j
<
ref
:
j
>
ref
;
i
=
0
<=
ref
?
++
j
:
--
j
)
{
key
=
Math
.
floor
(
Math
.
random
()
*
10000000000000000
).
toString
();
key
=
Math
.
floor
(
Math
.
random
()
*
10000000000000000
).
toString
();
vip_info
.
cdkeys
[
key_type
].
push
(
key
);
vip_info
.
cdkeys
[
key_type
].
push
(
key
);
}
}
setting_save
(
vip_info
);
setting_save
(
vip_info
);
log
.
info
(
"
keys generated
"
,
key_type
,
count
,
vip_info
.
cdkeys
[
key_type
].
length
);
return
true
;
return
true
;
};
};
...
@@ -343,11 +344,6 @@
...
@@ -343,11 +344,6 @@
vip_info
=
loadJSON
(
'
./config/vip_info.json
'
);
vip_info
=
loadJSON
(
'
./config/vip_info.json
'
);
}
catch
(
error1
)
{
}
catch
(
error1
)
{
vip_info
=
default_data
.
vip_info
;
vip_info
=
default_data
.
vip_info
;
ref
=
vip_info
.
cdkeys
;
for
(
k
in
ref
)
{
v
=
ref
[
k
];
VIP_generate_cdkeys
(
k
,
settings
.
modules
.
vip
.
generate_count
);
}
setting_save
(
vip_info
);
setting_save
(
vip_info
);
}
}
...
@@ -362,9 +358,9 @@
...
@@ -362,9 +358,9 @@
lflists
=
[];
lflists
=
[];
try
{
try
{
ref
1
=
fs
.
readFileSync
(
'
ygopro/expansions/lflist.conf
'
,
'
utf8
'
).
match
(
/!.*/g
);
ref
=
fs
.
readFileSync
(
'
ygopro/expansions/lflist.conf
'
,
'
utf8
'
).
match
(
/!.*/g
);
for
(
j
=
0
,
len
=
ref
1
.
length
;
j
<
len
;
j
++
)
{
for
(
j
=
0
,
len
=
ref
.
length
;
j
<
len
;
j
++
)
{
list
=
ref
1
[
j
];
list
=
ref
[
j
];
date
=
list
.
match
(
/!
([\d\.]
+
)
/
);
date
=
list
.
match
(
/!
([\d\.]
+
)
/
);
if
(
!
date
)
{
if
(
!
date
)
{
continue
;
continue
;
...
@@ -379,9 +375,9 @@
...
@@ -379,9 +375,9 @@
}
}
try
{
try
{
ref
2
=
fs
.
readFileSync
(
'
ygopro/lflist.conf
'
,
'
utf8
'
).
match
(
/!.*/g
);
ref
1
=
fs
.
readFileSync
(
'
ygopro/lflist.conf
'
,
'
utf8
'
).
match
(
/!.*/g
);
for
(
l
=
0
,
len1
=
ref
2
.
length
;
l
<
len1
;
l
++
)
{
for
(
l
=
0
,
len1
=
ref
1
.
length
;
l
<
len1
;
l
++
)
{
list
=
ref
2
[
l
];
list
=
ref
1
[
l
];
date
=
list
.
match
(
/!
([\d\.]
+
)
/
);
date
=
list
.
match
(
/!
([\d\.]
+
)
/
);
if
(
!
date
)
{
if
(
!
date
)
{
continue
;
continue
;
...
@@ -454,6 +450,16 @@
...
@@ -454,6 +450,16 @@
});
});
}
}
if
(
settings
.
modules
.
vip
.
enabled
)
{
ref2
=
vip_info
.
cdkeys
;
for
(
k
in
ref2
)
{
v
=
ref2
[
k
];
if
(
v
.
length
===
0
)
{
VIP_generate_cdkeys
(
k
,
settings
.
modules
.
vip
.
generate_count
);
}
}
}
memory_usage
=
0
;
memory_usage
=
0
;
get_memory_usage
=
function
()
{
get_memory_usage
=
function
()
{
...
...
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