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
f19e7d6d
Commit
f19e7d6d
authored
Nov 14, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unfinished: i18n problem
parent
492e22b8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
33 deletions
+26
-33
ygopro-server.coffee
ygopro-server.coffee
+3
-3
ygopro-server.js
ygopro-server.js
+0
-11
ygopro.coffee
ygopro.coffee
+4
-11
ygopro.js
ygopro.js
+19
-8
No files found.
ygopro-server.coffee
View file @
f19e7d6d
...
...
@@ -1825,13 +1825,13 @@ netRequestHandler = (client) ->
if
client
.
isWs
client
.
on
'close'
,
(
code
,
reason
)
->
closeHandler
()
else
client
.
on
'close'
,
(
had_error
)
->
closeHandler
(
had_error
?
'unknown'
:
undefined
)
client
.
on
'timeout'
,
()
->
unless
settings
.
modules
.
reconnect
.
enabled
and
(
disconnect_list
[
CLIENT_get_authorize_key
(
client
)]
or
client
.
had_new_reconnection
)
client
.
destroy
()
return
else
client
.
on
'close'
,
(
had_error
)
->
closeHandler
(
had_error
?
'unknown'
:
undefined
)
client
.
on
'error'
,
closeHandler
...
...
ygopro-server.js
View file @
f19e7d6d
...
...
@@ -4280,19 +4280,8 @@
return
cancel
;
});
ygopro
.
ctos_follow
(
'
HS_READY
'
,
true
,
function
(
buffer
,
info
,
client
,
server
,
datas
)
{
log
.
info
(
"
HS_READY
"
,
client
.
name
);
return
false
;
});
ygopro
.
stoc_follow
(
'
ERROR_MSG
'
,
true
,
function
(
buffer
,
info
,
client
,
server
,
datas
)
{
log
.
info
(
"
ERROR_MSG
"
,
client
.
name
,
JSON
.
stringify
(
info
));
return
false
;
});
ygopro
.
ctos_follow
(
'
UPDATE_DECK
'
,
true
,
async
function
(
buffer
,
info
,
client
,
server
,
datas
)
{
var
athleticCheckResult
,
buff_main
,
buff_side
,
card
,
current_deck
,
deck
,
deck_array
,
deck_main
,
deck_side
,
deck_text
,
deckbuf
,
decks
,
found_deck
,
i
,
j
,
l
,
len
,
len1
,
line
,
oppo_pos
,
recover_player_data
,
recoveredDeck
,
room
,
struct
,
win_pos
;
log
.
info
(
"
UPDATE_DECK
"
,
client
.
name
,
info
.
mainc
,
info
.
sidec
);
if
(
settings
.
modules
.
reconnect
.
enabled
&&
client
.
pre_reconnecting
)
{
if
(
!
CLIENT_is_able_to_reconnect
(
client
)
&&
!
CLIENT_is_able_to_kick_reconnect
(
client
))
{
ygopro
.
stoc_send_chat
(
client
,
"
${reconnect_failed}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
...
...
ygopro.coffee
View file @
f19e7d6d
...
...
@@ -78,17 +78,10 @@ translateHandler = (handler) ->
if
!
room
console
.
log
"err stoc_send_chat_to_room"
return
for
line
in
_
.
lines
(
msg
)
chat_buffer
=
@
helper
.
prepareMessage
(
"STOC_CHAT"
,
{
player
:
player
msg
:
line
})
for
client
in
room
.
players
@
helper
.
send
(
client
,
chat_buffer
)
if
client
for
client
in
room
.
watchers
@
helper
.
send
(
client
,
chat_buffer
)
if
client
if
room
.
duel_stage
!=
@
constants
.
DUEL_STAGE
.
BEGIN
room
.
addRecorderBuffer
(
chat_buffer
,
true
)
for
client
in
room
.
players
@
stoc_send_chat
(
client
,
msg
,
player
)
if
client
for
client
in
room
.
watchers
@
stoc_send_chat
(
client
,
msg
,
player
)
if
client
return
@
stoc_send_hint_card_to_room
=
(
room
,
card
)
->
...
...
ygopro.js
View file @
f19e7d6d
...
...
@@ -94,13 +94,9 @@
return
this
.
helper
.
sendMessage
(
socket
,
`CTOS_
${
proto
}
`
,
info
);
};
//util
this
.
stoc_send_chat
=
async
function
(
client
,
msg
,
player
=
8
)
{
var
i
,
len
,
line
,
o
,
r
,
ref
,
ref1
;
if
(
!
client
)
{
console
.
log
(
"
err stoc_send_chat
"
);
return
;
}
this
.
splitLines
=
function
(
msg
,
player
)
{
var
i
,
len
,
line
,
lines
,
o
,
r
,
ref
,
ref1
;
lines
=
[];
ref
=
_
.
lines
(
msg
);
for
(
i
=
0
,
len
=
ref
.
length
;
i
<
len
;
i
++
)
{
line
=
ref
[
i
];
...
...
@@ -112,6 +108,21 @@
r
=
ref1
[
o
];
line
=
line
.
replace
(
r
.
regex
,
r
.
text
);
}
lines
.
push
(
line
);
}
return
lines
;
};
//util
this
.
stoc_send_chat
=
async
function
(
client
,
msg
,
player
=
8
)
{
var
i
,
len
,
line
,
ref
;
if
(
!
client
)
{
console
.
log
(
"
err stoc_send_chat
"
);
return
;
}
ref
=
this
.
splitLines
(
msg
,
player
);
for
(
i
=
0
,
len
=
ref
.
length
;
i
<
len
;
i
++
)
{
line
=
ref
[
i
];
await
this
.
stoc_send
(
client
,
'
CHAT
'
,
{
player
:
player
,
msg
:
line
...
...
@@ -125,7 +136,7 @@
console
.
log
(
"
err stoc_send_chat_to_room
"
);
return
;
}
ref
=
_
.
lines
(
msg
);
ref
=
this
.
splitLines
(
msg
,
player
);
for
(
i
=
0
,
len
=
ref
.
length
;
i
<
len
;
i
++
)
{
line
=
ref
[
i
];
chat_buffer
=
this
.
helper
.
prepareMessage
(
"
STOC_CHAT
"
,
{
...
...
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