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
6bb22309
Commit
6bb22309
authored
Oct 28, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into ai-play
parents
8f87d5dc
2a7af07f
Pipeline
#6512
failed with stages
in 5 minutes and 7 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
150 additions
and
122 deletions
+150
-122
YGOProMessages.js
YGOProMessages.js
+10
-3
YGOProMessages.ts
YGOProMessages.ts
+9
-2
athletic-check.js
athletic-check.js
+2
-2
data-manager/DataManager.js
data-manager/DataManager.js
+12
-12
data-manager/DeckEncoder.js
data-manager/DeckEncoder.js
+2
-2
data-manager/entities/Ban.js
data-manager/entities/Ban.js
+7
-7
data-manager/entities/BasePlayer.js
data-manager/entities/BasePlayer.js
+3
-3
data-manager/entities/CloudReplay.js
data-manager/entities/CloudReplay.js
+7
-7
data-manager/entities/CloudReplayPlayer.js
data-manager/entities/CloudReplayPlayer.js
+4
-4
data-manager/entities/CreateAndUpdateTimeBase.js
data-manager/entities/CreateAndUpdateTimeBase.js
+2
-2
data-manager/entities/DuelLog.js
data-manager/entities/DuelLog.js
+15
-15
data-manager/entities/DuelLogPlayer.js
data-manager/entities/DuelLogPlayer.js
+17
-17
data-manager/entities/RandomDuelBan.js
data-manager/entities/RandomDuelBan.js
+6
-6
data-manager/entities/RandomDuelScore.js
data-manager/entities/RandomDuelScore.js
+9
-9
data-manager/entities/User.js
data-manager/entities/User.js
+10
-10
data-manager/entities/UserDialog.js
data-manager/entities/UserDialog.js
+6
-6
data-manager/entities/VipKey.js
data-manager/entities/VipKey.js
+8
-8
ygopro-server.coffee
ygopro-server.coffee
+9
-3
ygopro-server.js
ygopro-server.js
+12
-4
No files found.
YGOProMessages.js
View file @
6bb22309
...
...
@@ -71,7 +71,7 @@ class YGOProMessagesHelper {
this
.
structs
=
new
Map
();
for
(
let
name
in
this
.
structs_declaration
)
{
const
declaration
=
this
.
structs_declaration
[
name
];
let
result
=
struct_1
.
Struct
();
let
result
=
(
0
,
struct_1
.
Struct
)
();
for
(
let
field
of
declaration
)
{
if
(
field
.
encoding
)
{
switch
(
field
.
encoding
)
{
...
...
@@ -180,7 +180,7 @@ class YGOProMessagesHelper {
}
handlerCollection
.
get
(
translatedProto
).
push
(
handlerObj
);
}
async
handleBuffer
(
messageBuffer
,
direction
,
protoFilter
,
params
)
{
async
handleBuffer
(
messageBuffer
,
direction
,
protoFilter
,
params
,
disconnectIfInvalid
=
false
)
{
let
feedback
=
null
;
let
messageLength
=
0
;
let
bufferProto
=
0
;
...
...
@@ -215,7 +215,14 @@ class YGOProMessagesHelper {
else
{
if
(
messageBuffer
.
length
>=
2
+
messageLength
)
{
const
proto
=
this
.
constants
[
direction
][
bufferProto
];
let
cancel
=
proto
&&
protoFilter
&&
underscore_1
.
default
.
indexOf
(
protoFilter
,
proto
)
===
-
1
;
let
cancel
=
proto
&&
protoFilter
&&
!
protoFilter
.
includes
(
proto
);
if
(
cancel
&&
disconnectIfInvalid
)
{
feedback
=
{
type
:
"
INVALID_PACKET
"
,
message
:
`
${
direction
}
proto not allowed`
};
break
;
}
let
buffer
=
messageBuffer
.
slice
(
3
,
2
+
messageLength
);
//console.log(l, direction, proto, cancel);
for
(
let
priority
=
0
;
priority
<
4
;
++
priority
)
{
...
...
YGOProMessages.ts
View file @
6bb22309
...
...
@@ -226,7 +226,7 @@ export class YGOProMessagesHelper {
handlerCollection
.
get
(
translatedProto
).
push
(
handlerObj
);
}
async
handleBuffer
(
messageBuffer
:
Buffer
,
direction
:
string
,
protoFilter
?:
string
[],
params
?:
any
):
Promise
<
HandleResult
>
{
async
handleBuffer
(
messageBuffer
:
Buffer
,
direction
:
string
,
protoFilter
?:
string
[],
params
?:
any
,
disconnectIfInvalid
=
false
):
Promise
<
HandleResult
>
{
let
feedback
:
Feedback
=
null
;
let
messageLength
=
0
;
let
bufferProto
=
0
;
...
...
@@ -257,7 +257,14 @@ export class YGOProMessagesHelper {
}
else
{
if
(
messageBuffer
.
length
>=
2
+
messageLength
)
{
const
proto
=
this
.
constants
[
direction
][
bufferProto
];
let
cancel
=
proto
&&
protoFilter
&&
_
.
indexOf
(
protoFilter
,
proto
)
===
-
1
;
let
cancel
=
proto
&&
protoFilter
&&
!
protoFilter
.
includes
(
proto
);
if
(
cancel
&&
disconnectIfInvalid
)
{
feedback
=
{
type
:
"
INVALID_PACKET
"
,
message
:
`
${
direction
}
proto not allowed`
};
break
;
}
let
buffer
=
messageBuffer
.
slice
(
3
,
2
+
messageLength
);
//console.log(l, direction, proto, cancel);
for
(
let
priority
=
0
;
priority
<
4
;
++
priority
)
{
...
...
athletic-check.js
View file @
6bb22309
...
...
@@ -19,7 +19,7 @@ class AthleticChecker {
return
deckText
;
}
async
getAthleticDecks
()
{
if
(
this
.
athleticDeckCache
&&
moment_1
.
default
().
diff
(
this
.
lastAthleticDeckFetchTime
,
"
seconds
"
)
<
this
.
config
.
ttl
)
{
if
(
this
.
athleticDeckCache
&&
(
0
,
moment_1
.
default
)
().
diff
(
this
.
lastAthleticDeckFetchTime
,
"
seconds
"
)
<
this
.
config
.
ttl
)
{
return
this
.
athleticDeckCache
;
}
const
{
data
}
=
await
axios_1
.
default
.
get
(
this
.
config
.
rankURL
,
{
...
...
@@ -30,7 +30,7 @@ class AthleticChecker {
});
const
athleticDecks
=
data
.
slice
(
0
,
this
.
config
.
rankCount
).
map
(
m
=>
m
.
name
);
this
.
athleticDeckCache
=
athleticDecks
;
this
.
lastAthleticDeckFetchTime
=
moment_1
.
default
();
this
.
lastAthleticDeckFetchTime
=
(
0
,
moment_1
.
default
)
();
return
athleticDecks
;
}
async
getDeckType
(
deck
)
{
...
...
data-manager/DataManager.js
View file @
6bb22309
...
...
@@ -69,7 +69,7 @@ class DataManager {
}
}
async
init
()
{
this
.
db
=
await
typeorm_1
.
createConnection
({
this
.
db
=
await
(
0
,
typeorm_1
.
createConnection
)
({
type
:
"
mysql
"
,
synchronize
:
true
,
supportBigNumbers
:
true
,
...
...
@@ -135,7 +135,7 @@ class DataManager {
const
replay
=
new
CloudReplay_1
.
CloudReplay
();
replay
.
id
=
id
;
replay
.
fromBuffer
(
buffer
);
replay
.
date
=
moment_1
.
default
().
toDate
();
replay
.
date
=
(
0
,
moment_1
.
default
)
().
toDate
();
const
players
=
playerInfos
.
map
(
p
=>
{
const
player
=
CloudReplayPlayer_1
.
CloudReplayPlayer
.
fromPlayerInfo
(
p
);
return
player
;
...
...
@@ -226,12 +226,12 @@ class DataManager {
if
(
ban
)
{
ban
.
count
+=
count
;
const
banTime
=
ban
.
count
>
3
?
Math
.
pow
(
2
,
ban
.
count
-
3
)
*
2
:
0
;
const
banDate
=
moment_1
.
default
(
ban
.
time
);
if
(
moment_1
.
default
().
isAfter
(
banDate
))
{
ban
.
time
=
moment_1
.
default
().
add
(
banTime
,
'
m
'
).
toDate
();
const
banDate
=
(
0
,
moment_1
.
default
)
(
ban
.
time
);
if
(
(
0
,
moment_1
.
default
)
().
isAfter
(
banDate
))
{
ban
.
time
=
(
0
,
moment_1
.
default
)
().
add
(
banTime
,
'
m
'
).
toDate
();
}
else
{
ban
.
time
=
moment_1
.
default
(
banDate
).
add
(
banTime
,
'
m
'
).
toDate
();
ban
.
time
=
(
0
,
moment_1
.
default
)
(
banDate
).
add
(
banTime
,
'
m
'
).
toDate
();
}
if
(
!
underscore_1
.
default
.
contains
(
ban
.
reasons
,
reason
))
{
ban
.
reasons
.
push
(
reason
);
...
...
@@ -241,7 +241,7 @@ class DataManager {
else
{
ban
=
new
RandomDuelBan_1
.
RandomDuelBan
();
ban
.
ip
=
ip
;
ban
.
time
=
moment_1
.
default
().
toDate
();
ban
.
time
=
(
0
,
moment_1
.
default
)
().
toDate
();
ban
.
count
=
count
;
ban
.
reasons
=
[
reason
];
ban
.
needTip
=
1
;
...
...
@@ -416,7 +416,7 @@ class DataManager {
async
saveDuelLog
(
name
,
roomId
,
cloudReplayId
,
replayFilename
,
roomMode
,
duelCount
,
playerInfos
)
{
const
duelLog
=
new
DuelLog_1
.
DuelLog
();
duelLog
.
name
=
name
;
duelLog
.
time
=
moment_1
.
default
().
toDate
();
duelLog
.
time
=
(
0
,
moment_1
.
default
)
().
toDate
();
duelLog
.
roomId
=
roomId
;
duelLog
.
cloudReplayId
=
cloudReplayId
;
duelLog
.
replayFileName
=
replayFilename
;
...
...
@@ -623,11 +623,11 @@ class DataManager {
}
const
keyType
=
vipKey
.
type
;
const
previousDate
=
user
.
vipExpireDate
;
if
(
previousDate
&&
moment_1
.
default
().
isBefore
(
previousDate
))
{
user
.
vipExpireDate
=
moment_1
.
default
(
previousDate
).
add
(
keyType
,
"
d
"
).
toDate
();
if
(
previousDate
&&
(
0
,
moment_1
.
default
)
().
isBefore
(
previousDate
))
{
user
.
vipExpireDate
=
(
0
,
moment_1
.
default
)
(
previousDate
).
add
(
keyType
,
"
d
"
).
toDate
();
}
else
{
user
.
vipExpireDate
=
moment_1
.
default
().
add
(
keyType
,
"
d
"
).
toDate
();
user
.
vipExpireDate
=
(
0
,
moment_1
.
default
)
().
add
(
keyType
,
"
d
"
).
toDate
();
}
user
=
await
mdb
.
save
(
user
);
vipKey
.
isUsed
=
1
;
...
...
@@ -671,7 +671,7 @@ class DataManager {
user
=
new
User_1
.
User
();
user
.
key
=
userKey
;
}
user
.
vipExpireDate
=
moment_1
.
default
(
oldVipUserInfo
.
expire_date
).
toDate
();
user
.
vipExpireDate
=
(
0
,
moment_1
.
default
)
(
oldVipUserInfo
.
expire_date
).
toDate
();
user
.
victory
=
oldVipUserInfo
.
victory
||
null
;
user
.
words
=
oldVipUserInfo
.
words
||
null
;
user
=
await
mdb
.
save
(
user
);
...
...
data-manager/DeckEncoder.js
View file @
6bb22309
...
...
@@ -17,7 +17,7 @@ function encodeDeck(deck) {
buffer
.
writeInt32LE
(
cardCode
,
pointer
);
pointer
+=
4
;
}
assert_1
.
default
(
pointer
===
bufferSize
,
`Invalid buffer size. Expected:
${
bufferSize
}
. Got:
${
pointer
}
`
);
(
0
,
assert_1
.
default
)
(
pointer
===
bufferSize
,
`Invalid buffer size. Expected:
${
bufferSize
}
. Got:
${
pointer
}
`
);
return
buffer
;
}
exports
.
encodeDeck
=
encodeDeck
;
...
...
@@ -28,7 +28,7 @@ function decodeDeck(buffer) {
const
sideLength
=
buffer
.
readInt32LE
(
pointer
);
pointer
+=
4
;
const
correctBufferLength
=
(
2
+
mainLength
+
sideLength
)
*
4
;
assert_1
.
default
(
buffer
.
length
>=
(
2
+
mainLength
+
sideLength
)
*
4
,
`Invalid buffer size. Expected:
${
correctBufferLength
}
. Got:
${
buffer
.
length
}
`
);
(
0
,
assert_1
.
default
)
(
buffer
.
length
>=
(
2
+
mainLength
+
sideLength
)
*
4
,
`Invalid buffer size. Expected:
${
correctBufferLength
}
. Got:
${
buffer
.
length
}
`
);
const
main
=
[];
const
side
=
[];
for
(
let
i
=
0
;
i
<
mainLength
;
++
i
)
{
...
...
data-manager/entities/Ban.js
View file @
6bb22309
...
...
@@ -18,22 +18,22 @@ let Ban = class Ban extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
name
;
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
],
Ban
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
64
,
nullable
:
true
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
64
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
Ban
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
,
nullable
:
true
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
20
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
Ban
.
prototype
,
"
name
"
,
void
0
);
Ban
=
__decorate
([
typeorm_1
.
Entity
(),
typeorm_1
.
Unique
([
"
ip
"
,
"
name
"
])
(
0
,
typeorm_1
.
Entity
)
(),
(
0
,
typeorm_1
.
Unique
)
([
"
ip
"
,
"
name
"
])
],
Ban
);
exports
.
Ban
=
Ban
;
//# sourceMappingURL=Ban.js.map
\ No newline at end of file
data-manager/entities/BasePlayer.js
View file @
6bb22309
...
...
@@ -18,15 +18,15 @@ class BasePlayer extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
pos
;
}
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
],
BasePlayer
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
}),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
BasePlayer
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
tinyint
"
}),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
tinyint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
BasePlayer
.
prototype
,
"
pos
"
,
void
0
);
exports
.
BasePlayer
=
BasePlayer
;
...
...
data-manager/entities/CloudReplay.js
View file @
6bb22309
...
...
@@ -29,7 +29,7 @@ let CloudReplay = class CloudReplay extends CreateAndUpdateTimeBase_1.CreateAndU
}
date
;
getDateString
()
{
return
moment_1
.
default
(
this
.
date
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
);
return
(
0
,
moment_1
.
default
)
(
this
.
date
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
);
}
players
;
getPlayerNamesString
()
{
...
...
@@ -42,24 +42,24 @@ let CloudReplay = class CloudReplay extends CreateAndUpdateTimeBase_1.CreateAndU
}
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryColumn
)
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
],
CloudReplay
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
text
"
}),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
text
"
}),
__metadata
(
"
design:type
"
,
String
)
],
CloudReplay
.
prototype
,
"
data
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
datetime
"
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
datetime
"
}),
__metadata
(
"
design:type
"
,
Date
)
],
CloudReplay
.
prototype
,
"
date
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
CloudReplayPlayer_1
.
CloudReplayPlayer
,
player
=>
player
.
cloudReplay
),
(
0
,
typeorm_1
.
OneToMany
)
(()
=>
CloudReplayPlayer_1
.
CloudReplayPlayer
,
player
=>
player
.
cloudReplay
),
__metadata
(
"
design:type
"
,
Array
)
],
CloudReplay
.
prototype
,
"
players
"
,
void
0
);
CloudReplay
=
__decorate
([
typeorm_1
.
Entity
({
(
0
,
typeorm_1
.
Entity
)
({
orderBy
:
{
date
:
"
DESC
"
}
...
...
data-manager/entities/CloudReplayPlayer.js
View file @
6bb22309
...
...
@@ -26,16 +26,16 @@ let CloudReplayPlayer = CloudReplayPlayer_1 = class CloudReplayPlayer extends Ba
}
};
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
128
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
128
}),
__metadata
(
"
design:type
"
,
String
)
],
CloudReplayPlayer
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
CloudReplay_1
.
CloudReplay
,
replay
=>
replay
.
players
),
(
0
,
typeorm_1
.
ManyToOne
)
(()
=>
CloudReplay_1
.
CloudReplay
,
replay
=>
replay
.
players
),
__metadata
(
"
design:type
"
,
CloudReplay_1
.
CloudReplay
)
],
CloudReplayPlayer
.
prototype
,
"
cloudReplay
"
,
void
0
);
CloudReplayPlayer
=
CloudReplayPlayer_1
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
CloudReplayPlayer
);
exports
.
CloudReplayPlayer
=
CloudReplayPlayer
;
//# sourceMappingURL=CloudReplayPlayer.js.map
\ No newline at end of file
data-manager/entities/CreateAndUpdateTimeBase.js
View file @
6bb22309
...
...
@@ -16,11 +16,11 @@ class CreateAndUpdateTimeBase {
updateTime
;
}
__decorate
([
typeorm_1
.
CreateDateColumn
(),
(
0
,
typeorm_1
.
CreateDateColumn
)
(),
__metadata
(
"
design:type
"
,
Date
)
],
CreateAndUpdateTimeBase
.
prototype
,
"
createTime
"
,
void
0
);
__decorate
([
typeorm_1
.
UpdateDateColumn
(),
(
0
,
typeorm_1
.
UpdateDateColumn
)
(),
__metadata
(
"
design:type
"
,
Date
)
],
CreateAndUpdateTimeBase
.
prototype
,
"
updateTime
"
,
void
0
);
exports
.
CreateAndUpdateTimeBase
=
CreateAndUpdateTimeBase
;
...
...
data-manager/entities/DuelLog.js
View file @
6bb22309
...
...
@@ -32,12 +32,12 @@ let DuelLog = class DuelLog extends CreateAndUpdateTimeBase_1.CreateAndUpdateTim
const
viewPlayers
=
underscore_1
.
default
.
clone
(
this
.
players
);
viewPlayers
.
sort
((
p1
,
p2
)
=>
p1
.
pos
-
p2
.
pos
);
const
playerString
=
viewPlayers
[
0
].
realName
.
split
(
"
$
"
)[
0
]
+
(
viewPlayers
[
2
]
?
"
+
"
+
viewPlayers
[
2
].
realName
.
split
(
"
$
"
)[
0
]
:
""
)
+
"
VS
"
+
(
viewPlayers
[
1
]
?
viewPlayers
[
1
].
realName
.
split
(
"
$
"
)[
0
]
:
"
AI
"
)
+
(
viewPlayers
[
3
]
?
"
+
"
+
viewPlayers
[
3
].
realName
.
split
(
"
$
"
)[
0
]
:
""
);
return
`<
${
this
.
id
}
>
${
playerString
}
${
moment_1
.
default
(
this
.
time
).
format
(
"
YYYY-MM-DD HH-mm-ss
"
)}
`
;
return
`<
${
this
.
id
}
>
${
playerString
}
${
(
0
,
moment_1
.
default
)
(
this
.
time
).
format
(
"
YYYY-MM-DD HH-mm-ss
"
)}
`
;
}
getViewJSON
(
tournamentModeSettings
)
{
const
data
=
{
id
:
this
.
id
,
time
:
moment_1
.
default
(
this
.
time
).
format
(
"
YYYY-MM-DD HH:mm:ss
"
),
time
:
(
0
,
moment_1
.
default
)
(
this
.
time
).
format
(
"
YYYY-MM-DD HH:mm:ss
"
),
name
:
this
.
name
+
(
tournamentModeSettings
.
show_info
?
"
(Duel:
"
+
this
.
duelCount
+
"
)
"
:
""
),
roomid
:
this
.
roomId
,
cloud_replay_id
:
"
R#
"
+
this
.
cloudReplayId
,
...
...
@@ -56,46 +56,46 @@ let DuelLog = class DuelLog extends CreateAndUpdateTimeBase_1.CreateAndUpdateTim
}
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)
({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
datetime
"
),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
datetime
"
),
__metadata
(
"
design:type
"
,
Date
)
],
DuelLog
.
prototype
,
"
time
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLog
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
roomId
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
global
.
PrimaryKeyType
||
'
bigint
'
),
(
0
,
typeorm_1
.
Column
)
(
global
.
PrimaryKeyType
||
'
bigint
'
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
cloudReplayId
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
256
}),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
256
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLog
.
prototype
,
"
replayFileName
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
tinyint
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
roomMode
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
tinyint
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
duelCount
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
DuelLogPlayer_1
.
DuelLogPlayer
,
player
=>
player
.
duelLog
),
(
0
,
typeorm_1
.
OneToMany
)
(()
=>
DuelLogPlayer_1
.
DuelLogPlayer
,
player
=>
player
.
duelLog
),
__metadata
(
"
design:type
"
,
Array
)
],
DuelLog
.
prototype
,
"
players
"
,
void
0
);
DuelLog
=
__decorate
([
typeorm_1
.
Entity
({
(
0
,
typeorm_1
.
Entity
)
({
orderBy
:
{
id
:
"
DESC
"
}
...
...
data-manager/entities/DuelLogPlayer.js
View file @
6bb22309
...
...
@@ -30,20 +30,20 @@ let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.B
this
.
startDeckBuffer
=
null
;
return
;
}
this
.
startDeckBuffer
=
DeckEncoder_1
.
encodeDeck
(
deck
).
toString
(
"
base64
"
);
this
.
startDeckBuffer
=
(
0
,
DeckEncoder_1
.
encodeDeck
)
(
deck
).
toString
(
"
base64
"
);
}
getStartDeck
()
{
return
DeckEncoder_1
.
decodeDeck
(
Buffer
.
from
(
this
.
startDeckBuffer
,
"
base64
"
));
return
(
0
,
DeckEncoder_1
.
decodeDeck
)
(
Buffer
.
from
(
this
.
startDeckBuffer
,
"
base64
"
));
}
setCurrentDeck
(
deck
)
{
if
(
deck
===
null
)
{
this
.
currentDeckBuffer
=
null
;
return
;
}
this
.
currentDeckBuffer
=
DeckEncoder_1
.
encodeDeck
(
deck
).
toString
(
"
base64
"
);
this
.
currentDeckBuffer
=
(
0
,
DeckEncoder_1
.
encodeDeck
)
(
deck
).
toString
(
"
base64
"
);
}
getCurrentDeck
()
{
return
DeckEncoder_1
.
decodeDeck
(
Buffer
.
from
(
this
.
currentDeckBuffer
,
"
base64
"
));
return
(
0
,
DeckEncoder_1
.
decodeDeck
)
(
Buffer
.
from
(
this
.
currentDeckBuffer
,
"
base64
"
));
}
duelLog
;
static
fromDuelLogPlayerInfo
(
info
)
{
...
...
@@ -63,49 +63,49 @@ let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.B
}
};
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
realName
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
64
,
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
varchar
"
,
length
:
64
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
tinyint
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
isFirst
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
tinyint
"
),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
tinyint
"
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
score
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
lp
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
smallint
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
smallint
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
cardCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
startDeckBuffer
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
currentDeckBuffer
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
),
(
0
,
typeorm_1
.
Column
)
(
"
tinyint
"
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
winner
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
DuelLog_1
.
DuelLog
,
duelLog
=>
duelLog
.
players
),
(
0
,
typeorm_1
.
ManyToOne
)
(()
=>
DuelLog_1
.
DuelLog
,
duelLog
=>
duelLog
.
players
),
__metadata
(
"
design:type
"
,
DuelLog_1
.
DuelLog
)
],
DuelLogPlayer
.
prototype
,
"
duelLog
"
,
void
0
);
DuelLogPlayer
=
DuelLogPlayer_1
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
DuelLogPlayer
);
exports
.
DuelLogPlayer
=
DuelLogPlayer
;
//# sourceMappingURL=DuelLogPlayer.js.map
\ No newline at end of file
data-manager/entities/RandomDuelBan.js
View file @
6bb22309
...
...
@@ -26,27 +26,27 @@ let RandomDuelBan = class RandomDuelBan extends CreateAndUpdateTimeBase_1.Create
}
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
type
:
"
varchar
"
,
length
:
64
}),
(
0
,
typeorm_1
.
PrimaryColumn
)
({
type
:
"
varchar
"
,
length
:
64
}),
__metadata
(
"
design:type
"
,
String
)
],
RandomDuelBan
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
datetime
"
),
(
0
,
typeorm_1
.
Column
)
(
"
datetime
"
),
__metadata
(
"
design:type
"
,
Date
)
],
RandomDuelBan
.
prototype
,
"
time
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
smallint
"
),
(
0
,
typeorm_1
.
Column
)
(
"
smallint
"
),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelBan
.
prototype
,
"
count
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
simple-array
"
}),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
simple-array
"
}),
__metadata
(
"
design:type
"
,
Array
)
],
RandomDuelBan
.
prototype
,
"
reasons
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
tinyint
"
,
unsigned
:
true
}),
(
0
,
typeorm_1
.
Column
)
({
type
:
"
tinyint
"
,
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelBan
.
prototype
,
"
needTip
"
,
void
0
);
RandomDuelBan
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
RandomDuelBan
);
exports
.
RandomDuelBan
=
RandomDuelBan
;
//# sourceMappingURL=RandomDuelBan.js.map
\ No newline at end of file
data-manager/entities/RandomDuelScore.js
View file @
6bb22309
...
...
@@ -49,30 +49,30 @@ let RandomDuelScore = class RandomDuelScore extends CreateAndUpdateTimeBase_1.Cr
}
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
type
:
"
varchar
"
,
length
:
20
}),
(
0
,
typeorm_1
.
PrimaryColumn
)
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
RandomDuelScore
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
winCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
loseCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
fleeCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
winCombo
"
,
void
0
);
RandomDuelScore
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
RandomDuelScore
);
exports
.
RandomDuelScore
=
RandomDuelScore
;
//# sourceMappingURL=RandomDuelScore.js.map
\ No newline at end of file
data-manager/entities/User.js
View file @
6bb22309
...
...
@@ -23,7 +23,7 @@ let User = class User extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase
chatColor
;
vipExpireDate
;
isVip
()
{
return
this
.
vipExpireDate
&&
moment_1
.
default
().
isBefore
(
this
.
vipExpireDate
);
return
this
.
vipExpireDate
&&
(
0
,
moment_1
.
default
)
().
isBefore
(
this
.
vipExpireDate
);
}
victory
;
words
;
...
...
@@ -31,36 +31,36 @@ let User = class User extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase
usedKeys
;
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
type
:
"
varchar
"
,
length
:
128
}),
(
0
,
typeorm_1
.
PrimaryColumn
)
({
type
:
"
varchar
"
,
length
:
128
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
varchar
"
,
{
length
:
16
,
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
varchar
"
,
{
length
:
16
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
chatColor
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
datetime
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
datetime
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
Date
)
],
User
.
prototype
,
"
vipExpireDate
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
victory
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
words
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
UserDialog_1
.
UserDialog
,
dialog
=>
dialog
.
user
),
(
0
,
typeorm_1
.
OneToMany
)
(()
=>
UserDialog_1
.
UserDialog
,
dialog
=>
dialog
.
user
),
__metadata
(
"
design:type
"
,
Array
)
],
User
.
prototype
,
"
dialogues
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
VipKey_1
.
VipKey
,
vipKey
=>
vipKey
.
usedBy
),
(
0
,
typeorm_1
.
OneToMany
)
(()
=>
VipKey_1
.
VipKey
,
vipKey
=>
vipKey
.
usedBy
),
__metadata
(
"
design:type
"
,
Array
)
],
User
.
prototype
,
"
usedKeys
"
,
void
0
);
User
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
User
);
exports
.
User
=
User
;
//# sourceMappingURL=User.js.map
\ No newline at end of file
data-manager/entities/UserDialog.js
View file @
6bb22309
...
...
@@ -19,24 +19,24 @@ let UserDialog = class UserDialog {
user
;
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
UserDialog
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
UserDialog
.
prototype
,
"
cardCode
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
),
__metadata
(
"
design:type
"
,
String
)
],
UserDialog
.
prototype
,
"
text
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
User_1
.
User
,
user
=>
user
.
dialogues
),
(
0
,
typeorm_1
.
ManyToOne
)
(()
=>
User_1
.
User
,
user
=>
user
.
dialogues
),
__metadata
(
"
design:type
"
,
User_1
.
User
)
],
UserDialog
.
prototype
,
"
user
"
,
void
0
);
UserDialog
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
UserDialog
);
exports
.
UserDialog
=
UserDialog
;
//# sourceMappingURL=UserDialog.js.map
\ No newline at end of file
data-manager/entities/VipKey.js
View file @
6bb22309
...
...
@@ -24,29 +24,29 @@ let VipKey = class VipKey extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeB
}
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
({
unique
:
true
}),
typeorm_1
.
Column
(
"
varchar
"
,
{
length
:
30
}),
(
0
,
typeorm_1
.
Index
)
({
unique
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
varchar
"
,
{
length
:
30
}),
__metadata
(
"
design:type
"
,
String
)
],
VipKey
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
type
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
,
default
:
0
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
tinyint
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
isUsed
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
User_1
.
User
,
user
=>
user
.
usedKeys
),
(
0
,
typeorm_1
.
ManyToOne
)
(()
=>
User_1
.
User
,
user
=>
user
.
usedKeys
),
__metadata
(
"
design:type
"
,
User_1
.
User
)
],
VipKey
.
prototype
,
"
usedBy
"
,
void
0
);
VipKey
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
VipKey
);
exports
.
VipKey
=
VipKey
;
//# sourceMappingURL=VipKey.js.map
\ No newline at end of file
ygopro-server.coffee
View file @
6bb22309
...
...
@@ -2148,14 +2148,20 @@ netRequestHandler = (client) ->
return
room
.
watcher
.
write
(
buffer
)
for
buffer
in
handle_data
.
datas
else
ctos_filter
=
if
settings
.
modules
.
reconnect
.
enabled
and
client
.
pre_reconnecting
then
[
"UPDATE_DECK"
]
else
null
ctos_filter
=
null
disconnectIfInvalid
=
false
if
settings
.
modules
.
reconnect
.
enabled
and
client
.
pre_reconnecting_to_room
ctos_filter
=
[
"UPDATE_DECK"
]
if
!
client
.
name
ctos_filter
=
[
"JOIN_GAME"
,
"PLAYER_INFO"
]
disconnectIfInvalid
=
true
handle_data
=
await
ygopro
.
helper
.
handleBuffer
(
ctos_buffer
,
"CTOS"
,
ctos_filter
,
{
client
:
client
,
server
:
client
.
server
})
}
,
disconnectIfInvalid
)
if
handle_data
.
feedback
log
.
warn
(
handle_data
.
feedback
.
message
,
client
.
name
,
client
.
ip
)
if
handle_data
.
feedback
.
type
==
"OVERSIZE"
or
ROOM_bad_ip
[
client
.
ip
]
>
5
if
handle_data
.
feedback
.
type
==
"OVERSIZE"
or
handle_data
.
feedback
.
type
==
"INVALID_PACKET"
or
ROOM_bad_ip
[
client
.
ip
]
>
5
bad_ip_count
=
ROOM_bad_ip
[
client
.
ip
]
if
bad_ip_count
ROOM_bad_ip
[
client
.
ip
]
=
bad_ip_count
+
1
...
...
ygopro-server.js
View file @
6bb22309
...
...
@@ -2843,7 +2843,7 @@
// 客户端到服务端(ctos)协议分析
client
.
pre_establish_buffers
=
new
Array
();
client
.
on
(
'
data
'
,
async
function
(
ctos_buffer
)
{
var
bad_ip_count
,
buffer
,
ctos_filter
,
handle_data
,
j
,
l
,
len
,
len1
,
len2
,
m
,
ref
,
ref1
,
ref2
,
room
;
var
bad_ip_count
,
buffer
,
ctos_filter
,
disconnectIfInvalid
,
handle_data
,
j
,
l
,
len
,
len1
,
len2
,
m
,
ref
,
ref1
,
ref2
,
room
;
if
(
client
.
is_post_watcher
)
{
room
=
ROOM_all
[
client
.
rid
];
if
(
room
)
{
...
...
@@ -2871,14 +2871,22 @@
}
}
}
else
{
ctos_filter
=
settings
.
modules
.
reconnect
.
enabled
&&
client
.
pre_reconnecting
?
[
"
UPDATE_DECK
"
]
:
null
;
ctos_filter
=
null
;
disconnectIfInvalid
=
false
;
if
(
settings
.
modules
.
reconnect
.
enabled
&&
client
.
pre_reconnecting_to_room
)
{
ctos_filter
=
[
"
UPDATE_DECK
"
];
}
if
(
!
client
.
name
)
{
ctos_filter
=
[
"
JOIN_GAME
"
,
"
PLAYER_INFO
"
];
disconnectIfInvalid
=
true
;
}
handle_data
=
(
await
ygopro
.
helper
.
handleBuffer
(
ctos_buffer
,
"
CTOS
"
,
ctos_filter
,
{
client
:
client
,
server
:
client
.
server
}));
}
,
disconnectIfInvalid
));
if
(
handle_data
.
feedback
)
{
log
.
warn
(
handle_data
.
feedback
.
message
,
client
.
name
,
client
.
ip
);
if
(
handle_data
.
feedback
.
type
===
"
OVERSIZE
"
||
ROOM_bad_ip
[
client
.
ip
]
>
5
)
{
if
(
handle_data
.
feedback
.
type
===
"
OVERSIZE
"
||
handle_data
.
feedback
.
type
===
"
INVALID_PACKET
"
||
ROOM_bad_ip
[
client
.
ip
]
>
5
)
{
bad_ip_count
=
ROOM_bad_ip
[
client
.
ip
];
if
(
bad_ip_count
)
{
ROOM_bad_ip
[
client
.
ip
]
=
bad_ip_count
+
1
;
...
...
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