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
477dacf5
Commit
477dacf5
authored
Aug 29, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save deck
parent
dc38dcb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
ygopro-server.coffee
ygopro-server.coffee
+9
-2
ygopro-server.js
ygopro-server.js
+13
-1
No files found.
ygopro-server.coffee
View file @
477dacf5
...
...
@@ -1336,6 +1336,13 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
room
.
player_datas
.
push
ip
:
player
.
ip
,
name
:
player
.
name
if
settings
.
modules
.
tips
ygopro
.
stoc_send_random_tip
(
client
)
if
client
.
main
and
client
.
main
.
length
and
not
client
.
deck_saved
deck_text
=
'#ygosrv233 deck log
\r\n
#main
\r\n
'
+
client
.
main
.
join
(
'
\r\n
'
)
+
'
\r\n
!side
\r\n
'
+
client
.
side
.
join
(
'
\r\n
'
)
+
'
\r\n
'
deck_name
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
+
' '
+
room
.
port
+
' '
+
client
.
pos
+
' '
+
client
.
name
.
replace
(
/\//g
,
'_'
)
fs
.
writeFile
'decks_save
\/
'
+
deck_name
+
'.ydk'
,
deck_text
,
'utf-8'
,
(
err
)
->
if
err
log
.
warn
'DECK SAVE ERROR'
,
err
client
.
deck_saved
=
true
return
ygopro
.
ctos_follow
'CHAT'
,
true
,
(
buffer
,
info
,
client
,
server
)
->
...
...
@@ -1434,8 +1441,8 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
#log.info info
buff_main
=
(
info
.
deckbuf
[
i
]
for
i
in
[
0
...
info
.
mainc
])
buff_side
=
(
info
.
deckbuf
[
i
]
for
i
in
[
info
.
mainc
...
info
.
mainc
+
info
.
sidec
])
##client.main =
main
##client.side =
side
client
.
main
=
buff_
main
client
.
side
=
buff_
side
if
room
.
random_type
if
client
.
is_host
room
.
waiting_for_player
=
room
.
waiting_for_player2
...
...
ygopro-server.js
View file @
477dacf5
...
...
@@ -1616,7 +1616,7 @@
}
ygopro
.
stoc_follow
(
'
DUEL_START
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
var
k
,
len
,
player
,
ref
,
room
;
var
deck_name
,
deck_text
,
k
,
len
,
player
,
ref
,
room
;
room
=
ROOM_all
[
client
.
rid
];
if
(
!
room
)
{
return
;
...
...
@@ -1643,6 +1643,16 @@
if
(
settings
.
modules
.
tips
)
{
ygopro
.
stoc_send_random_tip
(
client
);
}
if
(
client
.
main
&&
client
.
main
.
length
&&
!
client
.
deck_saved
)
{
deck_text
=
'
#ygosrv233 deck log
\r\n
#main
\r\n
'
+
client
.
main
.
join
(
'
\r\n
'
)
+
'
\r\n
!side
\r\n
'
+
client
.
side
.
join
(
'
\r\n
'
)
+
'
\r\n
'
;
deck_name
=
moment
().
format
(
'
YYYY-MM-DD HH-mm-ss
'
)
+
'
'
+
room
.
port
+
'
'
+
client
.
pos
+
'
'
+
client
.
name
.
replace
(
/
\/
/g
,
'
_
'
);
fs
.
writeFile
(
'
decks_save
\
/
'
+
deck_name
+
'
.ydk
'
,
deck_text
,
'
utf-8
'
,
function
(
err
)
{
if
(
err
)
{
return
log
.
warn
(
'
DECK SAVE ERROR
'
,
err
);
}
});
client
.
deck_saved
=
true
;
}
});
ygopro
.
ctos_follow
(
'
CHAT
'
,
true
,
function
(
buffer
,
info
,
client
,
server
)
{
...
...
@@ -1781,6 +1791,8 @@
}
return
results
;
})();
client
.
main
=
buff_main
;
client
.
side
=
buff_side
;
if
(
room
.
random_type
)
{
if
(
client
.
is_host
)
{
room
.
waiting_for_player
=
room
.
waiting_for_player2
;
...
...
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