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
b9ab979a
Commit
b9ab979a
authored
Jun 25, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add score post retry
parent
d2ba0463
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
160 additions
and
147 deletions
+160
-147
Replay.js
Replay.js
+1
-1
YGOProMessages.js
YGOProMessages.js
+0
-9
athletic-check.js
athletic-check.js
+0
-3
challonge.js
challonge.js
+4
-5
data-manager/DataManager.js
data-manager/DataManager.js
+22
-12
data-manager/DeckEncoder.js
data-manager/DeckEncoder.js
+2
-3
data-manager/entities/Ban.js
data-manager/entities/Ban.js
+2
-5
data-manager/entities/BasePlayer.js
data-manager/entities/BasePlayer.js
+1
-4
data-manager/entities/CloudReplay.js
data-manager/entities/CloudReplay.js
+2
-6
data-manager/entities/CloudReplayPlayer.js
data-manager/entities/CloudReplayPlayer.js
+2
-4
data-manager/entities/CreateAndUpdateTimeBase.js
data-manager/entities/CreateAndUpdateTimeBase.js
+1
-3
data-manager/entities/DuelLog.js
data-manager/entities/DuelLog.js
+2
-11
data-manager/entities/DuelLogPlayer.js
data-manager/entities/DuelLogPlayer.js
+2
-12
data-manager/entities/RandomDuelBan.js
data-manager/entities/RandomDuelBan.js
+2
-7
data-manager/entities/RandomDuelScore.js
data-manager/entities/RandomDuelScore.js
+2
-7
data-manager/entities/User.js
data-manager/entities/User.js
+2
-4
roomlist.js
roomlist.js
+1
-1
utility.js
utility.js
+21
-0
utility.ts
utility.ts
+22
-0
ygopro-auth.js
ygopro-auth.js
+1
-1
ygopro-server.coffee
ygopro-server.coffee
+32
-21
ygopro-server.js
ygopro-server.js
+35
-27
ygopro.js
ygopro.js
+1
-1
No files found.
Replay.js
View file @
b9ab979a
// Generated by CoffeeScript 2.
6.1
// Generated by CoffeeScript 2.
7.0
(
function
()
{
(
function
()
{
var
Replay
,
ReplayReader
,
fs
,
lzma
,
replayHeader
;
var
Replay
,
ReplayReader
,
fs
,
lzma
,
replayHeader
;
...
...
YGOProMessages.js
View file @
b9ab979a
...
@@ -11,8 +11,6 @@ const typedefs_json_1 = __importDefault(require("./data/typedefs.json"));
...
@@ -11,8 +11,6 @@ const typedefs_json_1 = __importDefault(require("./data/typedefs.json"));
const
proto_structs_json_1
=
__importDefault
(
require
(
"
./data/proto_structs.json
"
));
const
proto_structs_json_1
=
__importDefault
(
require
(
"
./data/proto_structs.json
"
));
const
constants_json_1
=
__importDefault
(
require
(
"
./data/constants.json
"
));
const
constants_json_1
=
__importDefault
(
require
(
"
./data/constants.json
"
));
class
Handler
{
class
Handler
{
handler
;
synchronous
;
constructor
(
handler
,
synchronous
)
{
constructor
(
handler
,
synchronous
)
{
this
.
handler
=
handler
;
this
.
handler
=
handler
;
this
.
synchronous
=
synchronous
||
false
;
this
.
synchronous
=
synchronous
||
false
;
...
@@ -30,13 +28,6 @@ class Handler {
...
@@ -30,13 +28,6 @@ class Handler {
}
}
}
}
class
YGOProMessagesHelper
{
class
YGOProMessagesHelper
{
handlers
;
structs
;
structs_declaration
;
typedefs
;
proto_structs
;
constants
;
singleHandleLimit
;
constructor
(
singleHandleLimit
)
{
constructor
(
singleHandleLimit
)
{
this
.
handlers
=
{
this
.
handlers
=
{
STOC
:
[
new
Map
(),
STOC
:
[
new
Map
(),
...
...
athletic-check.js
View file @
b9ab979a
...
@@ -8,9 +8,6 @@ const axios_1 = __importDefault(require("axios"));
...
@@ -8,9 +8,6 @@ const axios_1 = __importDefault(require("axios"));
const
querystring_1
=
__importDefault
(
require
(
"
querystring
"
));
const
querystring_1
=
__importDefault
(
require
(
"
querystring
"
));
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
class
AthleticChecker
{
class
AthleticChecker
{
config
;
athleticDeckCache
;
lastAthleticDeckFetchTime
;
constructor
(
config
)
{
constructor
(
config
)
{
this
.
config
=
config
;
this
.
config
=
config
;
}
}
...
...
challonge.js
View file @
b9ab979a
...
@@ -9,14 +9,11 @@ const bunyan_1 = require("bunyan");
...
@@ -9,14 +9,11 @@ const bunyan_1 = require("bunyan");
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
const
p_queue_1
=
__importDefault
(
require
(
"
p-queue
"
));
const
p_queue_1
=
__importDefault
(
require
(
"
p-queue
"
));
class
Challonge
{
class
Challonge
{
config
;
constructor
(
config
)
{
constructor
(
config
)
{
this
.
config
=
config
;
this
.
config
=
config
;
this
.
queue
=
new
p_queue_1
.
default
({
concurrency
:
1
});
this
.
log
=
(
0
,
bunyan_1
.
createLogger
)({
name
:
'
challonge
'
});
}
}
queue
=
new
p_queue_1
.
default
({
concurrency
:
1
});
log
=
(
0
,
bunyan_1
.
createLogger
)({
name
:
'
challonge
'
});
previous
;
previousTime
;
async
getTournamentProcess
(
noCache
=
false
)
{
async
getTournamentProcess
(
noCache
=
false
)
{
if
(
!
noCache
&&
this
.
previous
&&
this
.
previousTime
.
isAfter
((
0
,
moment_1
.
default
)().
subtract
(
this
.
config
.
cache_ttl
,
'
ms
'
)))
{
if
(
!
noCache
&&
this
.
previous
&&
this
.
previousTime
.
isAfter
((
0
,
moment_1
.
default
)().
subtract
(
this
.
config
.
cache_ttl
,
'
ms
'
)))
{
return
this
.
previous
;
return
this
.
previous
;
...
@@ -67,6 +64,7 @@ class Challonge {
...
@@ -67,6 +64,7 @@ class Challonge {
}
}
}
}
}
}
// DELETE /v1/tournaments/${tournament_id}/participants/clear.json?api_key=xxx returns ANY
async
clearParticipants
()
{
async
clearParticipants
()
{
try
{
try
{
await
axios_1
.
default
.
delete
(
`
${
this
.
config
.
challonge_url
}
/v1/tournaments/
${
this
.
config
.
tournament_id
}
/participants/clear.json`
,
{
await
axios_1
.
default
.
delete
(
`
${
this
.
config
.
challonge_url
}
/v1/tournaments/
${
this
.
config
.
tournament_id
}
/participants/clear.json`
,
{
...
@@ -82,6 +80,7 @@ class Challonge {
...
@@ -82,6 +80,7 @@ class Challonge {
return
false
;
return
false
;
}
}
}
}
// POST /v1/tournaments/${tournament_id}/participants/bulk_add.json { api_key: string, participants: { name: string }[] } returns ANY
async
uploadParticipants
(
participantNames
)
{
async
uploadParticipants
(
participantNames
)
{
try
{
try
{
await
axios_1
.
default
.
post
(
`
${
this
.
config
.
challonge_url
}
/v1/tournaments/
${
this
.
config
.
tournament_id
}
/participants/bulk_add.json`
,
{
await
axios_1
.
default
.
post
(
`
${
this
.
config
.
challonge_url
}
/v1/tournaments/
${
this
.
config
.
tournament_id
}
/participants/bulk_add.json`
,
{
...
...
data-manager/DataManager.js
View file @
b9ab979a
"
use strict
"
;
"
use strict
"
;
var
__createBinding
=
(
this
&&
this
.
__createBinding
)
||
(
Object
.
create
?
(
function
(
o
,
m
,
k
,
k2
)
{
var
__createBinding
=
(
this
&&
this
.
__createBinding
)
||
(
Object
.
create
?
(
function
(
o
,
m
,
k
,
k2
)
{
if
(
k2
===
undefined
)
k2
=
k
;
if
(
k2
===
undefined
)
k2
=
k
;
Object
.
defineProperty
(
o
,
k2
,
{
enumerable
:
true
,
get
:
function
()
{
return
m
[
k
];
}
});
var
desc
=
Object
.
getOwnPropertyDescriptor
(
m
,
k
);
if
(
!
desc
||
(
"
get
"
in
desc
?
!
m
.
__esModule
:
desc
.
writable
||
desc
.
configurable
))
{
desc
=
{
enumerable
:
true
,
get
:
function
()
{
return
m
[
k
];
}
};
}
Object
.
defineProperty
(
o
,
k2
,
desc
);
})
:
(
function
(
o
,
m
,
k
,
k2
)
{
})
:
(
function
(
o
,
m
,
k
,
k2
)
{
if
(
k2
===
undefined
)
k2
=
k
;
if
(
k2
===
undefined
)
k2
=
k
;
o
[
k2
]
=
m
[
k
];
o
[
k2
]
=
m
[
k
];
...
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
...
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
})
:
function
(
o
,
v
)
{
})
:
function
(
o
,
v
)
{
o
[
"
default
"
]
=
v
;
o
[
"
default
"
]
=
v
;
});
});
var
__importStar
=
(
this
&&
this
.
__importStar
)
||
function
(
mod
)
{
var
__importStar
=
(
this
&&
this
.
__importStar
)
||
(
function
()
{
if
(
mod
&&
mod
.
__esModule
)
return
mod
;
var
ownKeys
=
function
(
o
)
{
var
result
=
{};
ownKeys
=
Object
.
getOwnPropertyNames
||
function
(
o
)
{
if
(
mod
!=
null
)
for
(
var
k
in
mod
)
if
(
k
!==
"
default
"
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
mod
,
k
))
__createBinding
(
result
,
mod
,
k
);
var
ar
=
[];
__setModuleDefault
(
result
,
mod
);
for
(
var
k
in
o
)
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
o
,
k
))
ar
[
ar
.
length
]
=
k
;
return
result
;
return
ar
;
};
};
return
ownKeys
(
o
);
};
return
function
(
mod
)
{
if
(
mod
&&
mod
.
__esModule
)
return
mod
;
var
result
=
{};
if
(
mod
!=
null
)
for
(
var
k
=
ownKeys
(
mod
),
i
=
0
;
i
<
k
.
length
;
i
++
)
if
(
k
[
i
]
!==
"
default
"
)
__createBinding
(
result
,
mod
,
k
[
i
]);
__setModuleDefault
(
result
,
mod
);
return
result
;
};
})();
var
__importDefault
=
(
this
&&
this
.
__importDefault
)
||
function
(
mod
)
{
var
__importDefault
=
(
this
&&
this
.
__importDefault
)
||
function
(
mod
)
{
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"
default
"
:
mod
};
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"
default
"
:
mod
};
};
};
...
@@ -38,10 +52,6 @@ const jszip_1 = __importDefault(require("jszip"));
...
@@ -38,10 +52,6 @@ const jszip_1 = __importDefault(require("jszip"));
const
fs
=
__importStar
(
require
(
"
fs
"
));
const
fs
=
__importStar
(
require
(
"
fs
"
));
require
(
"
reflect-metadata
"
);
require
(
"
reflect-metadata
"
);
class
DataManager
{
class
DataManager
{
config
;
log
;
ready
;
db
;
constructor
(
config
,
log
)
{
constructor
(
config
,
log
)
{
this
.
config
=
config
;
this
.
config
=
config
;
this
.
log
=
log
;
this
.
log
=
log
;
...
...
data-manager/DeckEncoder.js
View file @
b9ab979a
...
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
...
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"
default
"
:
mod
};
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"
default
"
:
mod
};
};
};
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
decodeDeck
=
exports
.
encodeDeck
=
void
0
;
exports
.
encodeDeck
=
encodeDeck
;
exports
.
decodeDeck
=
decodeDeck
;
const
assert_1
=
__importDefault
(
require
(
"
assert
"
));
const
assert_1
=
__importDefault
(
require
(
"
assert
"
));
function
encodeDeck
(
deck
)
{
function
encodeDeck
(
deck
)
{
let
pointer
=
0
;
let
pointer
=
0
;
...
@@ -20,7 +21,6 @@ function encodeDeck(deck) {
...
@@ -20,7 +21,6 @@ function encodeDeck(deck) {
(
0
,
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
;
return
buffer
;
}
}
exports
.
encodeDeck
=
encodeDeck
;
function
decodeDeck
(
buffer
)
{
function
decodeDeck
(
buffer
)
{
let
pointer
=
0
;
let
pointer
=
0
;
const
mainLength
=
buffer
.
readInt32LE
(
pointer
);
const
mainLength
=
buffer
.
readInt32LE
(
pointer
);
...
@@ -41,5 +41,4 @@ function decodeDeck(buffer) {
...
@@ -41,5 +41,4 @@ function decodeDeck(buffer) {
}
}
return
{
main
,
side
};
return
{
main
,
side
};
}
}
exports
.
decodeDeck
=
decodeDeck
;
//# sourceMappingURL=DeckEncoder.js.map
//# sourceMappingURL=DeckEncoder.js.map
\ No newline at end of file
data-manager/entities/Ban.js
View file @
b9ab979a
...
@@ -13,10 +13,8 @@ exports.Ban = void 0;
...
@@ -13,10 +13,8 @@ exports.Ban = void 0;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
typeorm_1
=
require
(
"
typeorm
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
let
Ban
=
class
Ban
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
let
Ban
=
class
Ban
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
id
;
ip
;
name
;
};
};
exports
.
Ban
=
Ban
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
__metadata
(
"
design:type
"
,
Number
)
...
@@ -31,9 +29,8 @@ __decorate([
...
@@ -31,9 +29,8 @@ __decorate([
(
0
,
typeorm_1
.
Column
)({
type
:
"
varchar
"
,
length
:
20
,
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)({
type
:
"
varchar
"
,
length
:
20
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
__metadata
(
"
design:type
"
,
String
)
],
Ban
.
prototype
,
"
name
"
,
void
0
);
],
Ban
.
prototype
,
"
name
"
,
void
0
);
Ban
=
__decorate
([
exports
.
Ban
=
Ban
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)(),
(
0
,
typeorm_1
.
Entity
)(),
(
0
,
typeorm_1
.
Unique
)([
"
ip
"
,
"
name
"
])
(
0
,
typeorm_1
.
Unique
)([
"
ip
"
,
"
name
"
])
],
Ban
);
],
Ban
);
exports
.
Ban
=
Ban
;
//# sourceMappingURL=Ban.js.map
//# sourceMappingURL=Ban.js.map
\ No newline at end of file
data-manager/entities/BasePlayer.js
View file @
b9ab979a
...
@@ -13,10 +13,8 @@ exports.BasePlayer = void 0;
...
@@ -13,10 +13,8 @@ exports.BasePlayer = void 0;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
typeorm_1
=
require
(
"
typeorm
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
class
BasePlayer
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
class
BasePlayer
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
id
;
name
;
pos
;
}
}
exports
.
BasePlayer
=
BasePlayer
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
__metadata
(
"
design:type
"
,
Number
)
...
@@ -29,5 +27,4 @@ __decorate([
...
@@ -29,5 +27,4 @@ __decorate([
(
0
,
typeorm_1
.
Column
)({
type
:
"
tinyint
"
}),
(
0
,
typeorm_1
.
Column
)({
type
:
"
tinyint
"
}),
__metadata
(
"
design:type
"
,
Number
)
__metadata
(
"
design:type
"
,
Number
)
],
BasePlayer
.
prototype
,
"
pos
"
,
void
0
);
],
BasePlayer
.
prototype
,
"
pos
"
,
void
0
);
exports
.
BasePlayer
=
BasePlayer
;
//# sourceMappingURL=BasePlayer.js.map
//# sourceMappingURL=BasePlayer.js.map
\ No newline at end of file
data-manager/entities/CloudReplay.js
View file @
b9ab979a
...
@@ -19,19 +19,15 @@ const underscore_1 = __importDefault(require("underscore"));
...
@@ -19,19 +19,15 @@ const underscore_1 = __importDefault(require("underscore"));
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
let
CloudReplay
=
class
CloudReplay
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
let
CloudReplay
=
class
CloudReplay
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
id
;
data
;
fromBuffer
(
buffer
)
{
fromBuffer
(
buffer
)
{
this
.
data
=
buffer
.
toString
(
"
base64
"
);
this
.
data
=
buffer
.
toString
(
"
base64
"
);
}
}
toBuffer
()
{
toBuffer
()
{
return
Buffer
.
from
(
this
.
data
,
"
base64
"
);
return
Buffer
.
from
(
this
.
data
,
"
base64
"
);
}
}
date
;
getDateString
()
{
getDateString
()
{
return
(
0
,
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
()
{
getPlayerNamesString
()
{
const
playerInfos
=
underscore_1
.
default
.
clone
(
this
.
players
);
const
playerInfos
=
underscore_1
.
default
.
clone
(
this
.
players
);
playerInfos
.
sort
((
p1
,
p2
)
=>
p1
.
pos
-
p2
.
pos
);
playerInfos
.
sort
((
p1
,
p2
)
=>
p1
.
pos
-
p2
.
pos
);
...
@@ -41,6 +37,7 @@ let CloudReplay = class CloudReplay extends CreateAndUpdateTimeBase_1.CreateAndU
...
@@ -41,6 +37,7 @@ let CloudReplay = class CloudReplay extends CreateAndUpdateTimeBase_1.CreateAndU
return
`R#
${
this
.
id
}
${
this
.
getPlayerNamesString
()}
${
this
.
getDateString
()}
`
;
return
`R#
${
this
.
id
}
${
this
.
getPlayerNamesString
()}
${
this
.
getDateString
()}
`
;
}
}
};
};
exports
.
CloudReplay
=
CloudReplay
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
PrimaryColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
__metadata
(
"
design:type
"
,
Number
)
...
@@ -58,12 +55,11 @@ __decorate([
...
@@ -58,12 +55,11 @@ __decorate([
(
0
,
typeorm_1
.
OneToMany
)(()
=>
CloudReplayPlayer_1
.
CloudReplayPlayer
,
player
=>
player
.
cloudReplay
),
(
0
,
typeorm_1
.
OneToMany
)(()
=>
CloudReplayPlayer_1
.
CloudReplayPlayer
,
player
=>
player
.
cloudReplay
),
__metadata
(
"
design:type
"
,
Array
)
__metadata
(
"
design:type
"
,
Array
)
],
CloudReplay
.
prototype
,
"
players
"
,
void
0
);
],
CloudReplay
.
prototype
,
"
players
"
,
void
0
);
CloudReplay
=
__decorate
([
exports
.
CloudReplay
=
CloudReplay
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)({
(
0
,
typeorm_1
.
Entity
)({
orderBy
:
{
orderBy
:
{
date
:
"
DESC
"
date
:
"
DESC
"
}
}
})
})
],
CloudReplay
);
],
CloudReplay
);
exports
.
CloudReplay
=
CloudReplay
;
//# sourceMappingURL=CloudReplay.js.map
//# sourceMappingURL=CloudReplay.js.map
\ No newline at end of file
data-manager/entities/CloudReplayPlayer.js
View file @
b9ab979a
...
@@ -15,8 +15,6 @@ const typeorm_1 = require("typeorm");
...
@@ -15,8 +15,6 @@ const typeorm_1 = require("typeorm");
const
CloudReplay_1
=
require
(
"
./CloudReplay
"
);
const
CloudReplay_1
=
require
(
"
./CloudReplay
"
);
const
BasePlayer_1
=
require
(
"
./BasePlayer
"
);
const
BasePlayer_1
=
require
(
"
./BasePlayer
"
);
let
CloudReplayPlayer
=
CloudReplayPlayer_1
=
class
CloudReplayPlayer
extends
BasePlayer_1
.
BasePlayer
{
let
CloudReplayPlayer
=
CloudReplayPlayer_1
=
class
CloudReplayPlayer
extends
BasePlayer_1
.
BasePlayer
{
key
;
cloudReplay
;
static
fromPlayerInfo
(
info
)
{
static
fromPlayerInfo
(
info
)
{
const
p
=
new
CloudReplayPlayer_1
();
const
p
=
new
CloudReplayPlayer_1
();
p
.
key
=
info
.
key
;
p
.
key
=
info
.
key
;
...
@@ -25,6 +23,7 @@ let CloudReplayPlayer = CloudReplayPlayer_1 = class CloudReplayPlayer extends Ba
...
@@ -25,6 +23,7 @@ let CloudReplayPlayer = CloudReplayPlayer_1 = class CloudReplayPlayer extends Ba
return
p
;
return
p
;
}
}
};
};
exports
.
CloudReplayPlayer
=
CloudReplayPlayer
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
Index
)(),
(
0
,
typeorm_1
.
Index
)(),
(
0
,
typeorm_1
.
Column
)({
type
:
"
varchar
"
,
length
:
128
}),
(
0
,
typeorm_1
.
Column
)({
type
:
"
varchar
"
,
length
:
128
}),
...
@@ -34,8 +33,7 @@ __decorate([
...
@@ -34,8 +33,7 @@ __decorate([
(
0
,
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
)
__metadata
(
"
design:type
"
,
CloudReplay_1
.
CloudReplay
)
],
CloudReplayPlayer
.
prototype
,
"
cloudReplay
"
,
void
0
);
],
CloudReplayPlayer
.
prototype
,
"
cloudReplay
"
,
void
0
);
CloudReplayPlayer
=
CloudReplayPlayer_1
=
__decorate
([
exports
.
CloudReplayPlayer
=
CloudReplayPlayer
=
CloudReplayPlayer_1
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)()
(
0
,
typeorm_1
.
Entity
)()
],
CloudReplayPlayer
);
],
CloudReplayPlayer
);
exports
.
CloudReplayPlayer
=
CloudReplayPlayer
;
//# sourceMappingURL=CloudReplayPlayer.js.map
//# sourceMappingURL=CloudReplayPlayer.js.map
\ No newline at end of file
data-manager/entities/CreateAndUpdateTimeBase.js
View file @
b9ab979a
...
@@ -12,9 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
...
@@ -12,9 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports
.
CreateAndUpdateTimeBase
=
void
0
;
exports
.
CreateAndUpdateTimeBase
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
typeorm_1
=
require
(
"
typeorm
"
);
class
CreateAndUpdateTimeBase
{
class
CreateAndUpdateTimeBase
{
createTime
;
updateTime
;
}
}
exports
.
CreateAndUpdateTimeBase
=
CreateAndUpdateTimeBase
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
CreateDateColumn
)(),
(
0
,
typeorm_1
.
CreateDateColumn
)(),
__metadata
(
"
design:type
"
,
Date
)
__metadata
(
"
design:type
"
,
Date
)
...
@@ -23,5 +22,4 @@ __decorate([
...
@@ -23,5 +22,4 @@ __decorate([
(
0
,
typeorm_1
.
UpdateDateColumn
)(),
(
0
,
typeorm_1
.
UpdateDateColumn
)(),
__metadata
(
"
design:type
"
,
Date
)
__metadata
(
"
design:type
"
,
Date
)
],
CreateAndUpdateTimeBase
.
prototype
,
"
updateTime
"
,
void
0
);
],
CreateAndUpdateTimeBase
.
prototype
,
"
updateTime
"
,
void
0
);
exports
.
CreateAndUpdateTimeBase
=
CreateAndUpdateTimeBase
;
//# sourceMappingURL=CreateAndUpdateTimeBase.js.map
//# sourceMappingURL=CreateAndUpdateTimeBase.js.map
\ No newline at end of file
data-manager/entities/DuelLog.js
View file @
b9ab979a
...
@@ -19,15 +19,6 @@ const moment_1 = __importDefault(require("moment"));
...
@@ -19,15 +19,6 @@ const moment_1 = __importDefault(require("moment"));
const
underscore_1
=
__importDefault
(
require
(
"
underscore
"
));
const
underscore_1
=
__importDefault
(
require
(
"
underscore
"
));
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
let
DuelLog
=
class
DuelLog
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
let
DuelLog
=
class
DuelLog
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
id
;
time
;
name
;
roomId
;
cloudReplayId
;
// not very needed to become a relation
replayFileName
;
roomMode
;
duelCount
;
players
;
getViewString
()
{
getViewString
()
{
const
viewPlayers
=
underscore_1
.
default
.
clone
(
this
.
players
);
const
viewPlayers
=
underscore_1
.
default
.
clone
(
this
.
players
);
viewPlayers
.
sort
((
p1
,
p2
)
=>
p1
.
pos
-
p2
.
pos
);
viewPlayers
.
sort
((
p1
,
p2
)
=>
p1
.
pos
-
p2
.
pos
);
...
@@ -55,6 +46,7 @@ let DuelLog = class DuelLog extends CreateAndUpdateTimeBase_1.CreateAndUpdateTim
...
@@ -55,6 +46,7 @@ let DuelLog = class DuelLog extends CreateAndUpdateTimeBase_1.CreateAndUpdateTim
return
data
;
return
data
;
}
}
};
};
exports
.
DuelLog
=
DuelLog
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)({
unsigned
:
true
,
type
:
global
.
PrimaryKeyType
||
'
bigint
'
}),
__metadata
(
"
design:type
"
,
Number
)
__metadata
(
"
design:type
"
,
Number
)
...
@@ -94,12 +86,11 @@ __decorate([
...
@@ -94,12 +86,11 @@ __decorate([
(
0
,
typeorm_1
.
OneToMany
)(()
=>
DuelLogPlayer_1
.
DuelLogPlayer
,
player
=>
player
.
duelLog
),
(
0
,
typeorm_1
.
OneToMany
)(()
=>
DuelLogPlayer_1
.
DuelLogPlayer
,
player
=>
player
.
duelLog
),
__metadata
(
"
design:type
"
,
Array
)
__metadata
(
"
design:type
"
,
Array
)
],
DuelLog
.
prototype
,
"
players
"
,
void
0
);
],
DuelLog
.
prototype
,
"
players
"
,
void
0
);
DuelLog
=
__decorate
([
exports
.
DuelLog
=
DuelLog
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)({
(
0
,
typeorm_1
.
Entity
)({
orderBy
:
{
orderBy
:
{
id
:
"
DESC
"
id
:
"
DESC
"
}
}
})
})
],
DuelLog
);
],
DuelLog
);
exports
.
DuelLog
=
DuelLog
;
//# sourceMappingURL=DuelLog.js.map
//# sourceMappingURL=DuelLog.js.map
\ No newline at end of file
data-manager/entities/DuelLogPlayer.js
View file @
b9ab979a
...
@@ -16,15 +16,6 @@ const BasePlayer_1 = require("./BasePlayer");
...
@@ -16,15 +16,6 @@ const BasePlayer_1 = require("./BasePlayer");
const
DuelLog_1
=
require
(
"
./DuelLog
"
);
const
DuelLog_1
=
require
(
"
./DuelLog
"
);
const
DeckEncoder_1
=
require
(
"
../DeckEncoder
"
);
const
DeckEncoder_1
=
require
(
"
../DeckEncoder
"
);
let
DuelLogPlayer
=
DuelLogPlayer_1
=
class
DuelLogPlayer
extends
BasePlayer_1
.
BasePlayer
{
let
DuelLogPlayer
=
DuelLogPlayer_1
=
class
DuelLogPlayer
extends
BasePlayer_1
.
BasePlayer
{
realName
;
ip
;
isFirst
;
score
;
lp
;
cardCount
;
startDeckBuffer
;
currentDeckBuffer
;
winner
;
setStartDeck
(
deck
)
{
setStartDeck
(
deck
)
{
if
(
!
deck
)
{
if
(
!
deck
)
{
this
.
startDeckBuffer
=
null
;
this
.
startDeckBuffer
=
null
;
...
@@ -45,7 +36,6 @@ let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.B
...
@@ -45,7 +36,6 @@ let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.B
getCurrentDeck
()
{
getCurrentDeck
()
{
return
(
0
,
DeckEncoder_1
.
decodeDeck
)(
Buffer
.
from
(
this
.
currentDeckBuffer
,
"
base64
"
));
return
(
0
,
DeckEncoder_1
.
decodeDeck
)(
Buffer
.
from
(
this
.
currentDeckBuffer
,
"
base64
"
));
}
}
duelLog
;
static
fromDuelLogPlayerInfo
(
info
)
{
static
fromDuelLogPlayerInfo
(
info
)
{
const
p
=
new
DuelLogPlayer_1
();
const
p
=
new
DuelLogPlayer_1
();
p
.
name
=
info
.
name
;
p
.
name
=
info
.
name
;
...
@@ -62,6 +52,7 @@ let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.B
...
@@ -62,6 +52,7 @@ let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.B
return
p
;
return
p
;
}
}
};
};
exports
.
DuelLogPlayer
=
DuelLogPlayer
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
Index
)(),
(
0
,
typeorm_1
.
Index
)(),
(
0
,
typeorm_1
.
Column
)({
type
:
"
varchar
"
,
length
:
20
}),
(
0
,
typeorm_1
.
Column
)({
type
:
"
varchar
"
,
length
:
20
}),
...
@@ -104,8 +95,7 @@ __decorate([
...
@@ -104,8 +95,7 @@ __decorate([
(
0
,
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
)
__metadata
(
"
design:type
"
,
DuelLog_1
.
DuelLog
)
],
DuelLogPlayer
.
prototype
,
"
duelLog
"
,
void
0
);
],
DuelLogPlayer
.
prototype
,
"
duelLog
"
,
void
0
);
DuelLogPlayer
=
DuelLogPlayer_1
=
__decorate
([
exports
.
DuelLogPlayer
=
DuelLogPlayer
=
DuelLogPlayer_1
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)()
(
0
,
typeorm_1
.
Entity
)()
],
DuelLogPlayer
);
],
DuelLogPlayer
);
exports
.
DuelLogPlayer
=
DuelLogPlayer
;
//# sourceMappingURL=DuelLogPlayer.js.map
//# sourceMappingURL=DuelLogPlayer.js.map
\ No newline at end of file
data-manager/entities/RandomDuelBan.js
View file @
b9ab979a
...
@@ -13,11 +13,6 @@ exports.RandomDuelBan = void 0;
...
@@ -13,11 +13,6 @@ exports.RandomDuelBan = void 0;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
typeorm_1
=
require
(
"
typeorm
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
let
RandomDuelBan
=
class
RandomDuelBan
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
let
RandomDuelBan
=
class
RandomDuelBan
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
ip
;
time
;
count
;
reasons
;
needTip
;
setNeedTip
(
need
)
{
setNeedTip
(
need
)
{
this
.
needTip
=
need
?
1
:
0
;
this
.
needTip
=
need
?
1
:
0
;
}
}
...
@@ -25,6 +20,7 @@ let RandomDuelBan = class RandomDuelBan extends CreateAndUpdateTimeBase_1.Create
...
@@ -25,6 +20,7 @@ let RandomDuelBan = class RandomDuelBan extends CreateAndUpdateTimeBase_1.Create
return
this
.
needTip
>
0
?
true
:
false
;
return
this
.
needTip
>
0
?
true
:
false
;
}
}
};
};
exports
.
RandomDuelBan
=
RandomDuelBan
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
PrimaryColumn
)({
type
:
"
varchar
"
,
length
:
64
}),
(
0
,
typeorm_1
.
PrimaryColumn
)({
type
:
"
varchar
"
,
length
:
64
}),
__metadata
(
"
design:type
"
,
String
)
__metadata
(
"
design:type
"
,
String
)
...
@@ -45,8 +41,7 @@ __decorate([
...
@@ -45,8 +41,7 @@ __decorate([
(
0
,
typeorm_1
.
Column
)({
type
:
"
tinyint
"
,
unsigned
:
true
}),
(
0
,
typeorm_1
.
Column
)({
type
:
"
tinyint
"
,
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelBan
.
prototype
,
"
needTip
"
,
void
0
);
],
RandomDuelBan
.
prototype
,
"
needTip
"
,
void
0
);
RandomDuelBan
=
__decorate
([
exports
.
RandomDuelBan
=
RandomDuelBan
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)()
(
0
,
typeorm_1
.
Entity
)()
],
RandomDuelBan
);
],
RandomDuelBan
);
exports
.
RandomDuelBan
=
RandomDuelBan
;
//# sourceMappingURL=RandomDuelBan.js.map
//# sourceMappingURL=RandomDuelBan.js.map
\ No newline at end of file
data-manager/entities/RandomDuelScore.js
View file @
b9ab979a
...
@@ -13,11 +13,6 @@ exports.RandomDuelScore = void 0;
...
@@ -13,11 +13,6 @@ exports.RandomDuelScore = void 0;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
typeorm_1
=
require
(
"
typeorm
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
let
RandomDuelScore
=
class
RandomDuelScore
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
let
RandomDuelScore
=
class
RandomDuelScore
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
name
;
winCount
;
loseCount
;
fleeCount
;
winCombo
;
getDisplayName
()
{
getDisplayName
()
{
return
this
.
name
.
split
(
"
$
"
)[
0
];
return
this
.
name
.
split
(
"
$
"
)[
0
];
}
}
...
@@ -47,6 +42,7 @@ let RandomDuelScore = class RandomDuelScore extends CreateAndUpdateTimeBase_1.Cr
...
@@ -47,6 +42,7 @@ let RandomDuelScore = class RandomDuelScore extends CreateAndUpdateTimeBase_1.Cr
}
}
}
}
};
};
exports
.
RandomDuelScore
=
RandomDuelScore
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
PrimaryColumn
)({
type
:
"
varchar
"
,
length
:
20
}),
(
0
,
typeorm_1
.
PrimaryColumn
)({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
__metadata
(
"
design:type
"
,
String
)
...
@@ -70,8 +66,7 @@ __decorate([
...
@@ -70,8 +66,7 @@ __decorate([
(
0
,
typeorm_1
.
Column
)(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
(
0
,
typeorm_1
.
Column
)(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
winCombo
"
,
void
0
);
],
RandomDuelScore
.
prototype
,
"
winCombo
"
,
void
0
);
RandomDuelScore
=
__decorate
([
exports
.
RandomDuelScore
=
RandomDuelScore
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)()
(
0
,
typeorm_1
.
Entity
)()
],
RandomDuelScore
);
],
RandomDuelScore
);
exports
.
RandomDuelScore
=
RandomDuelScore
;
//# sourceMappingURL=RandomDuelScore.js.map
//# sourceMappingURL=RandomDuelScore.js.map
\ No newline at end of file
data-manager/entities/User.js
View file @
b9ab979a
...
@@ -13,9 +13,8 @@ exports.User = void 0;
...
@@ -13,9 +13,8 @@ exports.User = void 0;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
typeorm_1
=
require
(
"
typeorm
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
const
CreateAndUpdateTimeBase_1
=
require
(
"
./CreateAndUpdateTimeBase
"
);
let
User
=
class
User
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
let
User
=
class
User
extends
CreateAndUpdateTimeBase_1
.
CreateAndUpdateTimeBase
{
key
;
chatColor
;
};
};
exports
.
User
=
User
;
__decorate
([
__decorate
([
(
0
,
typeorm_1
.
PrimaryColumn
)({
type
:
"
varchar
"
,
length
:
128
}),
(
0
,
typeorm_1
.
PrimaryColumn
)({
type
:
"
varchar
"
,
length
:
128
}),
__metadata
(
"
design:type
"
,
String
)
__metadata
(
"
design:type
"
,
String
)
...
@@ -24,8 +23,7 @@ __decorate([
...
@@ -24,8 +23,7 @@ __decorate([
(
0
,
typeorm_1
.
Column
)(
"
varchar
"
,
{
length
:
16
,
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)(
"
varchar
"
,
{
length
:
16
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
chatColor
"
,
void
0
);
],
User
.
prototype
,
"
chatColor
"
,
void
0
);
User
=
__decorate
([
exports
.
User
=
User
=
__decorate
([
(
0
,
typeorm_1
.
Entity
)()
(
0
,
typeorm_1
.
Entity
)()
],
User
);
],
User
);
exports
.
User
=
User
;
//# sourceMappingURL=User.js.map
//# sourceMappingURL=User.js.map
\ No newline at end of file
roomlist.js
View file @
b9ab979a
// Generated by CoffeeScript 2.
6.1
// Generated by CoffeeScript 2.
7.0
(
function
()
{
(
function
()
{
var
WebSocketServer
,
_delete
,
broadcast
,
clients
,
create
,
init
,
room_data
,
server
,
settings
,
start
,
update
,
url
;
var
WebSocketServer
,
_delete
,
broadcast
,
clients
,
create
,
init
,
room_data
,
server
,
settings
,
start
,
update
,
url
;
...
...
utility.js
0 → 100644
View file @
b9ab979a
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
retry
=
retry
;
async
function
retry
(
fn
,
count
,
delayFn
=
(
attempt
)
=>
Math
.
pow
(
2
,
attempt
)
*
1000
)
{
let
lastError
;
for
(
let
attempt
=
0
;
attempt
<
count
;
attempt
++
)
{
try
{
return
await
fn
();
}
catch
(
error
)
{
lastError
=
error
;
if
(
attempt
<
count
-
1
)
{
const
delay
=
delayFn
(
attempt
);
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
delay
));
}
}
}
// 如果全部尝试失败,抛出最后一个错误
throw
lastError
;
}
//# sourceMappingURL=utility.js.map
\ No newline at end of file
utility.ts
0 → 100644
View file @
b9ab979a
export
async
function
retry
<
T
>
(
fn
:
()
=>
Promise
<
T
>
,
count
:
number
,
delayFn
:
(
attempt
:
number
)
=>
number
=
(
attempt
)
=>
Math
.
pow
(
2
,
attempt
)
*
1000
):
Promise
<
T
>
{
let
lastError
:
any
;
for
(
let
attempt
=
0
;
attempt
<
count
;
attempt
++
)
{
try
{
return
await
fn
();
}
catch
(
error
)
{
lastError
=
error
;
if
(
attempt
<
count
-
1
)
{
const
delay
=
delayFn
(
attempt
);
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
delay
));
}
}
}
// 如果全部尝试失败,抛出最后一个错误
throw
lastError
;
}
ygopro-auth.js
View file @
b9ab979a
// Generated by CoffeeScript 2.
6.1
// Generated by CoffeeScript 2.
7.0
(
function
()
{
(
function
()
{
/*
/*
Main script of new dashboard account system.
Main script of new dashboard account system.
...
...
ygopro-server.coffee
View file @
b9ab979a
...
@@ -12,6 +12,9 @@ spawn = require('child_process').spawn
...
@@ -12,6 +12,9 @@ spawn = require('child_process').spawn
spawnSync
=
require
(
'child_process'
).
spawnSync
spawnSync
=
require
(
'child_process'
).
spawnSync
_async
=
require
(
'async'
)
_async
=
require
(
'async'
)
# ts utility
utility
=
require
'./utility.js'
# 三方库
# 三方库
_
=
global
.
_
=
require
'underscore'
_
=
global
.
_
=
require
'underscore'
_
.
str
=
require
'underscore.string'
_
.
str
=
require
'underscore.string'
...
@@ -1454,28 +1457,36 @@ class Room
...
@@ -1454,28 +1457,36 @@ class Room
formatted_replays
=
[]
formatted_replays
=
[]
for
repbuf
in
@
replays
when
repbuf
for
repbuf
in
@
replays
when
repbuf
formatted_replays
.
push
(
repbuf
.
toString
(
"base64"
))
formatted_replays
.
push
(
repbuf
.
toString
(
"base64"
))
request
.
post
{
url
:
settings
.
modules
.
arena_mode
.
post_score
,
form
:
{
form_data
=
new
URLSearchParams
accesskey
:
settings
.
modules
.
arena_mode
.
accesskey
,
form_data
.
append
'accesskey'
,
settings
.
modules
.
arena_mode
.
accesskey
usernameA
:
score_array
[
0
].
name
,
form_data
.
append
'usernameA'
,
score_array
[
0
].
name
usernameB
:
score_array
[
1
].
name
,
form_data
.
append
'usernameB'
,
score_array
[
1
].
name
userscoreA
:
score_array
[
0
].
score
,
form_data
.
append
'userscoreA'
,
score_array
[
0
].
score
userscoreB
:
score_array
[
1
].
score
,
form_data
.
append
'userscoreB'
,
score_array
[
1
].
score
userdeckA
:
score_array
[
0
].
deck
,
form_data
.
append
'userdeckA'
,
score_array
[
0
].
deck
userdeckB
:
score_array
[
1
].
deck
,
form_data
.
append
'userdeckB'
,
score_array
[
1
].
deck
first
:
JSON
.
stringify
(
@
first_list
),
form_data
.
append
'first'
,
JSON
.
stringify
@
first_list
replays
:
JSON
.
stringify
(
formatted_replays
),
form_data
.
append
'replays'
,
JSON
.
stringify
formatted_replays
start
:
@
start_time
,
form_data
.
append
'start'
,
@
start_time
end
:
end_time
,
form_data
.
append
'end'
,
end_time
arena
:
@
arena
form_data
.
append
'arena'
,
@
arena
}},
(
error
,
response
,
body
)
=>
if
error
post_score_process
=
()
->
log
.
warn
'SCORE POST ERROR'
,
error
axios
.
post
settings
.
modules
.
arena_mode
.
post_score
,
form_data
,
validateStatus
:
(
status
)
->
status
<
400
headers
:
'Content-Type'
:
'application/x-www-form-urlencoded'
utility
.
retry
post_match_scores
,
10
.
then
(
response
)
=>
log
.
info
'SCORE POST OK'
,
response
.
status
,
response
.
statusText
,
@
name
,
response
.
data
.
catch
(
error
)
=>
if
error
.
response
?
log
.
warn
'SCORE POST FAIL'
,
error
.
response
.
status
,
error
.
response
.
statusText
,
@
name
,
error
.
response
.
data
else
else
if
response
.
statusCode
>=
300
log
.
warn
'SCORE POST ERROR'
,
error
.
message
log
.
warn
'SCORE POST FAIL'
,
response
.
statusCode
,
response
.
statusMessage
,
@
name
,
body
#else
# log.info 'SCORE POST OK', response.statusCode, response.statusMessage, @name, body
return
if
settings
.
modules
.
challonge
.
enabled
and
@
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
@
hostinfo
.
mode
!=
2
and
!
@
kicked
if
settings
.
modules
.
challonge
.
enabled
and
@
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
@
hostinfo
.
mode
!=
2
and
!
@
kicked
room_name
=
@
name
room_name
=
@
name
...
...
ygopro-server.js
View file @
b9ab979a
// Generated by CoffeeScript 2.
6.1
// Generated by CoffeeScript 2.
7.0
(
function
()
{
(
function
()
{
// 标准库
// 标准库
var
CLIENT_get_absolute_pos
,
CLIENT_get_authorize_key
,
CLIENT_get_kick_reconnect_target
,
CLIENT_get_partner
,
CLIENT_heartbeat_register
,
CLIENT_heartbeat_unregister
,
CLIENT_import_data
,
CLIENT_is_able_to_kick_reconnect
,
CLIENT_is_able_to_reconnect
,
CLIENT_is_banned_by_mc
,
CLIENT_is_player
,
CLIENT_kick
,
CLIENT_kick_reconnect
,
CLIENT_pre_reconnect
,
CLIENT_reconnect
,
CLIENT_reconnect_register
,
CLIENT_reconnect_unregister
,
CLIENT_send_pre_reconnect_info
,
CLIENT_send_reconnect_info
,
CLIENT_send_replays
,
CLIENT_send_replays_and_kick
,
Q
,
ROOM_all
,
ROOM_bad_ip
,
ROOM_ban_player
,
ROOM_clear_disconnect
,
ROOM_connected_ip
,
ROOM_find_by_name
,
ROOM_find_by_pid
,
ROOM_find_by_port
,
ROOM_find_by_title
,
ROOM_find_or_create_ai
,
ROOM_find_or_create_by_name
,
ROOM_find_or_create_random
,
ROOM_kick
,
ROOM_player_flee
,
ROOM_player_get_score
,
ROOM_player_lose
,
ROOM_player_win
,
ROOM_players_oppentlist
,
ROOM_unwelcome
,
ROOM_validate
,
ReplayParser
,
ResolveData
,
Room
,
SERVER_clear_disconnect
,
SERVER_kick
,
SOCKET_flush_data
,
_
,
_async
,
addCallback
,
athleticChecker
,
auth
,
axios
,
badwordR
,
badwords
,
ban_user
,
bunyan
,
challonge
,
checkFileExists
,
createDirectoryIfNotExists
,
crypto
,
dataManager
,
deck_name_match
,
dialogues
,
disconnect_list
,
exec
,
execFile
,
extra_mode_list
,
fs
,
geoip
,
getDuelLogQueryFromQs
,
getSeedTimet
,
get_memory_usage
,
http
,
httpRequestListener
,
importOldConfig
,
import_datas
,
init
,
ip6addr
,
lflists
,
loadJSON
,
loadJSONAsync
,
loadLFList
,
loadRemoteData
,
load_dialogues
,
load_tips
,
log
,
long_resolve_cards
,
memory_usage
,
merge
,
moment
,
moment_long_ago_string
,
moment_now
,
moment_now_string
,
neosRequestListener
,
net
,
netRequestHandler
,
os
,
osu
,
path
,
qs
,
real_windbot_server_ip
,
release_disconnect
,
report_to_big_brother
,
request
,
roomlist
,
rooms_count
,
setting_change
,
setting_get
,
setting_save
,
settings
,
spawn
,
spawnSync
,
spawn_windbot
,
tips
,
url
,
users_cache
,
util
,
wait_room_start
,
wait_room_start_arena
,
windbot_looplimit
,
windbot_process
,
windbots
,
ygopro
,
zlib
;
var
CLIENT_get_absolute_pos
,
CLIENT_get_authorize_key
,
CLIENT_get_kick_reconnect_target
,
CLIENT_get_partner
,
CLIENT_heartbeat_register
,
CLIENT_heartbeat_unregister
,
CLIENT_import_data
,
CLIENT_is_able_to_kick_reconnect
,
CLIENT_is_able_to_reconnect
,
CLIENT_is_banned_by_mc
,
CLIENT_is_player
,
CLIENT_kick
,
CLIENT_kick_reconnect
,
CLIENT_pre_reconnect
,
CLIENT_reconnect
,
CLIENT_reconnect_register
,
CLIENT_reconnect_unregister
,
CLIENT_send_pre_reconnect_info
,
CLIENT_send_reconnect_info
,
CLIENT_send_replays
,
CLIENT_send_replays_and_kick
,
Q
,
ROOM_all
,
ROOM_bad_ip
,
ROOM_ban_player
,
ROOM_clear_disconnect
,
ROOM_connected_ip
,
ROOM_find_by_name
,
ROOM_find_by_pid
,
ROOM_find_by_port
,
ROOM_find_by_title
,
ROOM_find_or_create_ai
,
ROOM_find_or_create_by_name
,
ROOM_find_or_create_random
,
ROOM_kick
,
ROOM_player_flee
,
ROOM_player_get_score
,
ROOM_player_lose
,
ROOM_player_win
,
ROOM_players_oppentlist
,
ROOM_unwelcome
,
ROOM_validate
,
ReplayParser
,
ResolveData
,
Room
,
SERVER_clear_disconnect
,
SERVER_kick
,
SOCKET_flush_data
,
_
,
_async
,
addCallback
,
athleticChecker
,
auth
,
axios
,
badwordR
,
badwords
,
ban_user
,
bunyan
,
challonge
,
checkFileExists
,
createDirectoryIfNotExists
,
crypto
,
dataManager
,
deck_name_match
,
dialogues
,
disconnect_list
,
exec
,
execFile
,
extra_mode_list
,
fs
,
geoip
,
getDuelLogQueryFromQs
,
getSeedTimet
,
get_memory_usage
,
http
,
httpRequestListener
,
importOldConfig
,
import_datas
,
init
,
ip6addr
,
lflists
,
loadJSON
,
loadJSONAsync
,
loadLFList
,
loadRemoteData
,
load_dialogues
,
load_tips
,
log
,
long_resolve_cards
,
memory_usage
,
merge
,
moment
,
moment_long_ago_string
,
moment_now
,
moment_now_string
,
neosRequestListener
,
net
,
netRequestHandler
,
os
,
osu
,
path
,
qs
,
real_windbot_server_ip
,
release_disconnect
,
report_to_big_brother
,
request
,
roomlist
,
rooms_count
,
setting_change
,
setting_get
,
setting_save
,
settings
,
spawn
,
spawnSync
,
spawn_windbot
,
tips
,
url
,
users_cache
,
util
,
utility
,
wait_room_start
,
wait_room_start_arena
,
windbot_looplimit
,
windbot_process
,
windbots
,
ygopro
,
zlib
;
net
=
require
(
'
net
'
);
net
=
require
(
'
net
'
);
...
@@ -27,6 +27,9 @@
...
@@ -27,6 +27,9 @@
_async
=
require
(
'
async
'
);
_async
=
require
(
'
async
'
);
// ts utility
utility
=
require
(
'
./utility.js
'
);
// 三方库
// 三方库
_
=
global
.
_
=
require
(
'
underscore
'
);
_
=
global
.
_
=
require
(
'
underscore
'
);
...
@@ -1851,7 +1854,7 @@
...
@@ -1851,7 +1854,7 @@
}
}
delete
()
{
delete
()
{
var
end_time
,
form
atted_replays
,
index
,
j
,
len
,
log_rep_id
,
name
,
name_vpass
,
player_data
s
,
recorder_buffer
,
ref
,
ref1
,
repbuf
,
replay_id
,
room_name
,
score
,
score_array
,
score_form
;
var
end_time
,
form
_data
,
formatted_replays
,
index
,
j
,
len
,
log_rep_id
,
name
,
name_vpass
,
player_datas
,
post_score_proces
s
,
recorder_buffer
,
ref
,
ref1
,
repbuf
,
replay_id
,
room_name
,
score
,
score_array
,
score_form
;
if
(
this
.
deleted
)
{
if
(
this
.
deleted
)
{
return
;
return
;
}
}
...
@@ -1922,34 +1925,39 @@
...
@@ -1922,34 +1925,39 @@
formatted_replays
.
push
(
repbuf
.
toString
(
"
base64
"
));
formatted_replays
.
push
(
repbuf
.
toString
(
"
base64
"
));
}
}
}
}
request
.
post
({
form_data
=
new
URLSearchParams
();
url
:
settings
.
modules
.
arena_mode
.
post_score
,
form_data
.
append
(
'
accesskey
'
,
settings
.
modules
.
arena_mode
.
accesskey
);
form
:
{
form_data
.
append
(
'
usernameA
'
,
score_array
[
0
].
name
);
accesskey
:
settings
.
modules
.
arena_mode
.
accesskey
,
form_data
.
append
(
'
usernameB
'
,
score_array
[
1
].
name
);
usernameA
:
score_array
[
0
].
name
,
form_data
.
append
(
'
userscoreA
'
,
score_array
[
0
].
score
);
usernameB
:
score_array
[
1
].
name
,
form_data
.
append
(
'
userscoreB
'
,
score_array
[
1
].
score
);
userscoreA
:
score_array
[
0
].
score
,
form_data
.
append
(
'
userdeckA
'
,
score_array
[
0
].
deck
);
userscoreB
:
score_array
[
1
].
score
,
form_data
.
append
(
'
userdeckB
'
,
score_array
[
1
].
deck
);
userdeckA
:
score_array
[
0
].
deck
,
form_data
.
append
(
'
first
'
,
JSON
.
stringify
(
this
.
first_list
));
userdeckB
:
score_array
[
1
].
deck
,
form_data
.
append
(
'
replays
'
,
JSON
.
stringify
(
formatted_replays
));
first
:
JSON
.
stringify
(
this
.
first_list
),
form_data
.
append
(
'
start
'
,
this
.
start_time
);
replays
:
JSON
.
stringify
(
formatted_replays
),
form_data
.
append
(
'
end
'
,
end_time
);
start
:
this
.
start_time
,
form_data
.
append
(
'
arena
'
,
this
.
arena
);
end
:
end_time
,
post_score_process
=
function
()
{
arena
:
this
.
arena
return
axios
.
post
(
settings
.
modules
.
arena_mode
.
post_score
,
form_data
,
{
}
validateStatus
:
function
(
status
)
{
},
(
error
,
response
,
body
)
=>
{
return
status
<
400
;
if
(
error
)
{
},
log
.
warn
(
'
SCORE POST ERROR
'
,
error
);
headers
:
{
}
else
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
if
(
response
.
statusCode
>=
300
)
{
log
.
warn
(
'
SCORE POST FAIL
'
,
response
.
statusCode
,
response
.
statusMessage
,
this
.
name
,
body
);
}
}
});
};
utility
.
retry
(
post_match_scores
,
10
).
then
((
response
)
=>
{
return
log
.
info
(
'
SCORE POST OK
'
,
response
.
status
,
response
.
statusText
,
this
.
name
,
response
.
data
);
}).
catch
((
error
)
=>
{
if
(
error
.
response
!=
null
)
{
return
log
.
warn
(
'
SCORE POST FAIL
'
,
error
.
response
.
status
,
error
.
response
.
statusText
,
this
.
name
,
error
.
response
.
data
);
}
else
{
return
log
.
warn
(
'
SCORE POST ERROR
'
,
error
.
message
);
}
}
});
});
}
}
//else
// log.info 'SCORE POST OK', response.statusCode, response.statusMessage, @name, body
if
(
settings
.
modules
.
challonge
.
enabled
&&
this
.
duel_stage
!==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
&&
this
.
hostinfo
.
mode
!==
2
&&
!
this
.
kicked
)
{
if
(
settings
.
modules
.
challonge
.
enabled
&&
this
.
duel_stage
!==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
&&
this
.
hostinfo
.
mode
!==
2
&&
!
this
.
kicked
)
{
room_name
=
this
.
name
;
room_name
=
this
.
name
;
this
.
post_challonge_score
();
this
.
post_challonge_score
();
...
...
ygopro.js
View file @
b9ab979a
// Generated by CoffeeScript 2.
6.1
// Generated by CoffeeScript 2.
7.0
(
function
()
{
(
function
()
{
var
Struct
,
YGOProMessagesHelper
,
_
,
loadJSON
,
translateHandler
;
var
Struct
,
YGOProMessagesHelper
,
_
,
loadJSON
,
translateHandler
;
...
...
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