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
8a94c84f
Commit
8a94c84f
authored
Jul 27, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix name length
parent
4c6e0050
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
data/i18n.json
data/i18n.json
+2
-0
ygopro-server.coffee
ygopro-server.coffee
+7
-1
ygopro-server.js
ygopro-server.js
+9
-2
No files found.
data/i18n.json
View file @
8a94c84f
...
...
@@ -173,6 +173,7 @@
"vip_cleared_victory"
:
"Your victory word have been deleted."
,
"vip_set_victory"
:
"Your victory word have been set."
,
"vip_password_changed"
:
"Password changed."
,
"vip_player_name_too_long"
:
"Your username or password is too long to log in. Please change your username and try again."
,
"athletic_arena_tip"
:
"During an athletic match, a game quit behavior is regarded as a surrender."
},
"es-es"
:
{
...
...
@@ -486,6 +487,7 @@
"vip_cleared_victory"
:
"已删除胜利台词。"
,
"vip_set_victory"
:
"已设置胜利台词。"
,
"vip_password_changed"
:
"密码修改成功。"
,
"vip_player_name_too_long"
:
"你的用户名或设置的密码太长,使用此用户名可能会无法登陆。请更换用户名重试。"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
},
"ko-kr"
:
{
...
...
ygopro-server.coffee
View file @
8a94c84f
...
...
@@ -180,7 +180,10 @@ CLIENT_use_cdkey = (client, pkey) ->
client
.
vip
=
true
new_vip
=
false
if
vip_info
.
players
[
client
.
name
]
vip_info
.
players
[
client
.
name
].
expire_date
=
moment
().
add
(
found_type
,
'd'
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
current_date
=
moment
()
if
current_date
.
isSameOrBefore
(
vip_info
.
players
[
client
.
name
].
expire_date
)
current_date
=
moment
(
vip_info
.
players
[
client
.
name
].
expire_date
,
'YYYY-MM-DD HH:mm:ss'
)
vip_info
.
players
[
client
.
name
].
expire_date
=
current_date
.
add
(
found_type
,
'd'
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
else
if
!
client
.
vpass
client
.
vpass
=
Math
.
floor
(
Math
.
random
()
*
100000
).
toString
()
...
...
@@ -1417,6 +1420,7 @@ ygopro.ctos_follow 'PLAYER_INFO', true, (buffer, info, client, server)->
buffer
=
struct
.
buffer
client
.
name
=
name
client
.
vpass
=
vpass
console
.
log
client
.
name
,
client
.
vpass
if
settings
.
modules
.
vip
.
enabled
and
CLIENT_check_vip
(
client
)
client
.
vip
=
true
...
...
@@ -2605,6 +2609,8 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
when
'buy'
if
vip_info
.
players
[
client
.
name
]
and
vip_info
.
players
[
client
.
name
].
password
!=
client
.
vpass
ygopro
.
stoc_send_chat
(
client
,
"${vip_account_existed}"
,
ygopro
.
constants
.
COLORS
.
RED
)
else
if
(
!
client
.
vpass
and
client
.
name
.
length
>
13
)
or
(
client
.
vpass
and
(
client
.
name
.
length
+
client
.
vpass
.
length
)
>
18
)
ygopro
.
stoc_send_chat
(
client
,
"${vip_player_name_too_long}"
,
ygopro
.
constants
.
COLORS
.
RED
)
else
key
=
cmd
[
2
]
buy_result
=
CLIENT_use_cdkey
(
client
,
key
)
...
...
ygopro-server.js
View file @
8a94c84f
...
...
@@ -175,7 +175,7 @@
};
CLIENT_use_cdkey
=
function
(
client
,
pkey
)
{
var
found_type
,
index
,
j
,
key
,
keys
,
len
,
new_vip
,
ref
,
type
;
var
current_date
,
found_type
,
index
,
j
,
key
,
keys
,
len
,
new_vip
,
ref
,
type
;
if
(
!
(
settings
.
modules
.
vip
.
enabled
&&
pkey
))
{
return
0
;
}
...
...
@@ -208,7 +208,11 @@
client
.
vip
=
true
;
new_vip
=
false
;
if
(
vip_info
.
players
[
client
.
name
])
{
vip_info
.
players
[
client
.
name
].
expire_date
=
moment
().
add
(
found_type
,
'
d
'
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
);
current_date
=
moment
();
if
(
current_date
.
isSameOrBefore
(
vip_info
.
players
[
client
.
name
].
expire_date
))
{
current_date
=
moment
(
vip_info
.
players
[
client
.
name
].
expire_date
,
'
YYYY-MM-DD HH:mm:ss
'
);
}
vip_info
.
players
[
client
.
name
].
expire_date
=
current_date
.
add
(
found_type
,
'
d
'
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
);
}
else
{
if
(
!
client
.
vpass
)
{
client
.
vpass
=
Math
.
floor
(
Math
.
random
()
*
100000
).
toString
();
...
...
@@ -1799,6 +1803,7 @@
buffer
=
struct
.
buffer
;
client
.
name
=
name
;
client
.
vpass
=
vpass
;
console
.
log
(
client
.
name
,
client
.
vpass
);
if
(
settings
.
modules
.
vip
.
enabled
&&
CLIENT_check_vip
(
client
))
{
client
.
vip
=
true
;
}
...
...
@@ -3290,6 +3295,8 @@
case
'
buy
'
:
if
(
vip_info
.
players
[
client
.
name
]
&&
vip_info
.
players
[
client
.
name
].
password
!==
client
.
vpass
)
{
ygopro
.
stoc_send_chat
(
client
,
"
${vip_account_existed}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
}
else
if
((
!
client
.
vpass
&&
client
.
name
.
length
>
13
)
||
(
client
.
vpass
&&
(
client
.
name
.
length
+
client
.
vpass
.
length
)
>
18
))
{
ygopro
.
stoc_send_chat
(
client
,
"
${vip_player_name_too_long}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
}
else
{
key
=
cmd
[
2
];
buy_result
=
CLIENT_use_cdkey
(
client
,
key
);
...
...
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