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
a51672cb
Commit
a51672cb
authored
Oct 12, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update config
parent
882a6b04
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
19 deletions
+57
-19
.gitignore
.gitignore
+3
-3
config.json
config.json
+20
-0
config.pre.json
config.pre.json
+11
-0
room.coffee
room.coffee
+2
-2
room.js
room.js
+2
-2
ygopro-pre.js
ygopro-pre.js
+1
-1
ygopro-server.coffee
ygopro-server.coffee
+9
-9
ygopro-server.js
ygopro-server.js
+9
-2
No files found.
.gitignore
View file @
a51672cb
# 23333333
config.json
/config.json
# ignore
test*
/ygocore/
/ygocore
/ygopro/
/ygopro
node_modules/.bin/
node_modules/bunyan/
...
...
config.
sample.
json
→
config.json
View file @
a51672cb
{
"ip"
:
"123.45.67.89"
,
"port"
:
233
,
"version"
:
4918
,
"ygopro_path"
:
"ygocore"
,
"modules"
:
{
"welcome"
:
"YGOPRO Server"
,
"update"
:
"请更新游戏版本"
,
"stop"
:
false
,
"tips"
:
"http://mercury233.me/ygosrv233/tips.json"
,
"dialogues"
:
"http://mercury233.me/ygosrv233/dialogues.json"
,
"enable_random_duel"
:
false
,
"post_start_watching"
:
true
,
"TCG_banlist_id"
:
7
,
"TCG_banlist_id"
:
8
,
"enable_TCG_as_default"
:
false
,
"http"
:
{
"port"
:
7922
,
"password"
:
"123456"
},
"pre"
:
{
"port"
:
7911
,
"password"
:
"123456"
,
"git_html_path"
:
"../mercury233.github.io/"
,
"html_path"
:
"../mercury233.github.io/ygosrv233/"
,
"html_filename"
:
"pre.html"
,
"git_db_path"
:
"../ygopro-cards/"
,
"db_path"
:
"../ygopro-cards/unofficial/"
,
"html_img_rel_path"
:
"pre/pics/"
,
"ygopro_path"
:
"../ygopro-pre/"
}
}
}
\ No newline at end of file
config.pre.json
0 → 100644
View file @
a51672cb
{
"port"
:
2333
,
"password"
:
"123456"
,
"git_html_path"
:
"../mercury233.github.io/"
,
"html_path"
:
"../mercury233.github.io/ygosrv233/"
,
"html_filename"
:
"pre.html"
,
"git_db_path"
:
"../ygopro-cards/"
,
"db_path"
:
"../ygopro-cards/unofficial/"
,
"html_img_rel_path"
:
"pre/pics/"
,
"ygopro_path"
:
"../ygopro-pre/"
}
\ No newline at end of file
room.coffee
View file @
a51672cb
...
...
@@ -37,7 +37,7 @@ class Room
@
players_oppentlist
=
{}
@
find_or_create_by_name
:
(
name
,
player_name
)
->
if
name
==
''
or
name
.
toUpperCase
()
==
'S'
or
name
.
toUpperCase
()
==
'M'
if
settings
.
modules
.
enable_random_duel
and
(
name
==
''
or
name
.
toUpperCase
()
==
'S'
or
name
.
toUpperCase
()
==
'M'
)
return
@
find_or_create_random
(
name
.
toUpperCase
(),
player_name
)
if
room
=
@
find_by_name
(
name
)
return
room
...
...
@@ -243,7 +243,7 @@ class Room
param
=
[
0
,
@
hostinfo
.
lflist
,
@
hostinfo
.
rule
,
@
hostinfo
.
mode
,
(
if
@
hostinfo
.
enable_priority
then
'T'
else
'F'
),
(
if
@
hostinfo
.
no_check_deck
then
'T'
else
'F'
),
(
if
@
hostinfo
.
no_shuffle_deck
then
'T'
else
'F'
),
@
hostinfo
.
start_lp
,
@
hostinfo
.
start_hand
,
@
hostinfo
.
draw_count
,
@
hostinfo
.
time_limit
]
try
@
process
=
spawn
'./ygopro'
,
param
,
cwd
:
'ygocore'
@
process
=
spawn
'./ygopro'
,
param
,
cwd
:
settings
.
ygopro_path
@
process
.
on
'exit'
,
(
code
)
=>
@
disconnector
=
'server'
unless
@
disconnector
this
.
delete
()
...
...
room.js
View file @
a51672cb
...
...
@@ -47,7 +47,7 @@
Room
.
find_or_create_by_name
=
function
(
name
,
player_name
)
{
var
room
;
if
(
name
===
''
||
name
.
toUpperCase
()
===
'
S
'
||
name
.
toUpperCase
()
===
'
M
'
)
{
if
(
settings
.
modules
.
enable_random_duel
&&
(
name
===
''
||
name
.
toUpperCase
()
===
'
S
'
||
name
.
toUpperCase
()
===
'
M
'
)
)
{
return
this
.
find_or_create_random
(
name
.
toUpperCase
(),
player_name
);
}
if
(
room
=
this
.
find_by_name
(
name
))
{
...
...
@@ -293,7 +293,7 @@
param
=
[
0
,
this
.
hostinfo
.
lflist
,
this
.
hostinfo
.
rule
,
this
.
hostinfo
.
mode
,
(
this
.
hostinfo
.
enable_priority
?
'
T
'
:
'
F
'
),
(
this
.
hostinfo
.
no_check_deck
?
'
T
'
:
'
F
'
),
(
this
.
hostinfo
.
no_shuffle_deck
?
'
T
'
:
'
F
'
),
this
.
hostinfo
.
start_lp
,
this
.
hostinfo
.
start_hand
,
this
.
hostinfo
.
draw_count
,
this
.
hostinfo
.
time_limit
];
try
{
this
.
process
=
spawn
(
'
./ygopro
'
,
param
,
{
cwd
:
'
ygocore
'
cwd
:
settings
.
ygopro_path
});
this
.
process
.
on
(
'
exit
'
,
(
function
(
_this
)
{
return
function
(
code
)
{
...
...
ygopro-pre.js
View file @
a51672cb
...
...
@@ -15,7 +15,7 @@ var spawn = require('child_process').spawn;
var
url
=
require
(
'
url
'
);
var
constants
=
require
(
'
./constants.json
'
);
var
config
=
require
(
'
./config.
json
'
).
modules
.
pre
;
var
config
=
require
(
'
./config.
pre.json
'
)
;
//全卡HTML列表
var
cardHTMLs
=
[];
...
...
ygopro-server.coffee
View file @
a51672cb
...
...
@@ -216,7 +216,7 @@ net.createServer (client) ->
return
return
.
listen
settings
.
port
,
->
log
.
info
"server started"
,
settings
.
ip
,
settings
.
port
log
.
info
"server started"
,
settings
.
port
return
#功能模块
...
...
@@ -241,20 +241,20 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
client
.
end
()
else
if
info
.
version
!=
settings
.
version
ygopro
.
stoc_send_chat
(
client
,
"电脑用户请更新游戏到最新版本,手机用户可以尝试使用2333端口,有问题请加群275986039"
)
ygopro
.
stoc_send_chat
(
client
,
settings
.
modules
.
update
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,{
msg
:
4
code
:
settings
.
version
}
client
.
end
()
#else if !info.pass.length
#
ygopro.stoc_send_chat(client,"房间为空,请修改房间名")
#
ygopro.stoc_send client, 'ERROR_MSG',{
#
msg: 1
#
code: 2
#
}
#
client.end()
else
if
!
info
.
pass
.
length
and
!
settings
.
modules
.
enable_random_duel
ygopro
.
stoc_send_chat
(
client
,
"房间为空,请修改房间名"
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,{
msg
:
1
code
:
2
}
client
.
end
()
else
if
!
Room
.
validate
(
info
.
pass
)
#ygopro.stoc_send client, 'ERROR_MSG',{
...
...
ygopro-server.js
View file @
a51672cb
...
...
@@ -241,7 +241,7 @@
}
});
}).
listen
(
settings
.
port
,
function
()
{
log
.
info
(
"
server started
"
,
settings
.
ip
,
settings
.
port
);
log
.
info
(
"
server started
"
,
settings
.
port
);
});
ygopro
.
ctos_follow
(
'
PLAYER_INFO
'
,
true
,
function
(
buffer
,
info
,
client
,
server
)
{
...
...
@@ -265,12 +265,19 @@
});
client
.
end
();
}
else
if
(
info
.
version
!==
settings
.
version
)
{
ygopro
.
stoc_send_chat
(
client
,
"
电脑用户请更新游戏到最新版本,手机用户可以尝试使用2333端口,有问题请加群275986039
"
);
ygopro
.
stoc_send_chat
(
client
,
settings
.
modules
.
update
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
4
,
code
:
settings
.
version
});
client
.
end
();
}
else
if
(
!
info
.
pass
.
length
&&
!
settings
.
modules
.
enable_random_duel
)
{
ygopro
.
stoc_send_chat
(
client
,
"
房间为空,请修改房间名
"
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
1
,
code
:
2
});
client
.
end
();
}
else
if
(
!
Room
.
validate
(
info
.
pass
))
{
ygopro
.
stoc_send_chat
(
client
,
"
房间密码不正确
"
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
...
...
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