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
6bf0003b
Commit
6bf0003b
authored
Nov 15, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vip info
parent
56f15b58
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
669 additions
and
746 deletions
+669
-746
data-manager/DataManager.js
data-manager/DataManager.js
+20
-0
data-manager/DataManager.ts
data-manager/DataManager.ts
+21
-0
data-manager/entities/Ban.js
data-manager/entities/Ban.js
+23
-20
data-manager/entities/BasePlayer.js
data-manager/entities/BasePlayer.js
+17
-14
data-manager/entities/CloudReplay.js
data-manager/entities/CloudReplay.js
+41
-38
data-manager/entities/CloudReplayPlayer.js
data-manager/entities/CloudReplayPlayer.js
+25
-22
data-manager/entities/DuelLog.js
data-manager/entities/DuelLog.js
+71
-68
data-manager/entities/DuelLogPlayer.js
data-manager/entities/DuelLogPlayer.js
+83
-80
data-manager/entities/RandomDuelBan.js
data-manager/entities/RandomDuelBan.js
+34
-31
data-manager/entities/User.js
data-manager/entities/User.js
+40
-37
data-manager/entities/UserDialog.js
data-manager/entities/UserDialog.js
+25
-22
data-manager/entities/VipKey.js
data-manager/entities/VipKey.js
+32
-29
data/i18n.json
data/i18n.json
+2
-0
ygopro-server.coffee
ygopro-server.coffee
+87
-135
ygopro-server.js
ygopro-server.js
+148
-250
No files found.
data-manager/DataManager.js
View file @
6bf0003b
...
...
@@ -335,6 +335,10 @@ class DataManager {
user
.
chatColor
=
color
;
return
await
this
.
saveUser
(
user
);
}
async
isUserVip
(
key
)
{
const
user
=
await
this
.
getUser
(
key
);
return
user
?
user
.
isVip
()
:
false
;
}
async
getUserDialogueText
(
key
,
cardCode
)
{
try
{
const
dialogue
=
await
this
.
db
.
getRepository
(
UserDialog_1
.
UserDialog
)
...
...
@@ -395,6 +399,20 @@ class DataManager {
}
});
}
async
removeUserDialogues
(
key
,
cardCode
)
{
try
{
await
this
.
db
.
createQueryBuilder
()
.
delete
()
.
from
(
UserDialog_1
.
UserDialog
)
.
where
(
"
cardCode = :cardCode and userKey = :key
"
,
{
cardCode
,
key
})
.
execute
();
return
true
;
}
catch
(
e
)
{
this
.
log
.
warn
(
`Failed to remove dialogue:
${
e
.
toString
()}
`
);
return
false
;
}
}
async
migrateChatColors
(
data
)
{
await
this
.
transaction
(
async
(
mdb
)
=>
{
try
{
...
...
@@ -443,9 +461,11 @@ class DataManager {
});
try
{
await
this
.
db
.
manager
.
save
(
vipKeys
);
return
true
;
}
catch
(
e
)
{
this
.
log
.
warn
(
`Failed to generate keys of keyType
${
keyType
}
:
${
e
.
toString
()}
`
);
return
false
;
}
}
async
useVipKey
(
userKey
,
vipKeyText
)
{
...
...
data-manager/DataManager.ts
View file @
6bf0003b
...
...
@@ -359,6 +359,10 @@ export class DataManager {
user
.
chatColor
=
color
;
return
await
this
.
saveUser
(
user
);
}
async
isUserVip
(
key
:
string
)
{
const
user
=
await
this
.
getUser
(
key
);
return
user
?
user
.
isVip
()
:
false
;
}
async
getUserDialogueText
(
key
:
string
,
cardCode
:
number
)
{
try
{
const
dialogue
=
await
this
.
db
.
getRepository
(
UserDialog
)
...
...
@@ -418,6 +422,21 @@ export class DataManager {
}
async
removeUserDialogues
(
key
:
string
,
cardCode
:
number
)
{
try
{
await
this
.
db
.
createQueryBuilder
()
.
delete
()
.
from
(
UserDialog
)
.
where
(
"
cardCode = :cardCode and userKey = :key
"
,
{
cardCode
,
key
})
.
execute
();
return
true
;
}
catch
(
e
)
{
this
.
log
.
warn
(
`Failed to remove dialogue:
${
e
.
toString
()}
`
);
return
false
;
}
}
async
migrateChatColors
(
data
:
any
)
{
await
this
.
transaction
(
async
(
mdb
)
=>
{
try
{
...
...
@@ -467,8 +486,10 @@ export class DataManager {
});
try
{
await
this
.
db
.
manager
.
save
(
vipKeys
);
return
true
;
}
catch
(
e
)
{
this
.
log
.
warn
(
`Failed to generate keys of keyType
${
keyType
}
:
${
e
.
toString
()}
`
);
return
false
;
}
}
...
...
data-manager/entities/Ban.js
View file @
6bf0003b
...
...
@@ -11,25 +11,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
Ban
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
let
Ban
=
class
Ban
{
};
__decorate
([
let
Ban
=
/** @class */
(()
=>
{
let
Ban
=
class
Ban
{
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
Ban
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
],
Ban
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
64
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
Ban
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
],
Ban
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
Ban
.
prototype
,
"
name
"
,
void
0
);
Ban
=
__decorate
([
],
Ban
.
prototype
,
"
name
"
,
void
0
);
Ban
=
__decorate
([
typeorm_1
.
Entity
(),
typeorm_1
.
Unique
([
"
ip
"
,
"
name
"
])
],
Ban
);
],
Ban
);
return
Ban
;
})();
exports
.
Ban
=
Ban
;
//# sourceMappingURL=Ban.js.map
\ No newline at end of file
data-manager/entities/BasePlayer.js
View file @
6bf0003b
...
...
@@ -11,19 +11,22 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
BasePlayer
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
class
BasePlayer
{
}
__decorate
([
let
BasePlayer
=
/** @class */
(()
=>
{
class
BasePlayer
{
}
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
BasePlayer
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
],
BasePlayer
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
BasePlayer
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
],
BasePlayer
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
tinyint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
BasePlayer
.
prototype
,
"
pos
"
,
void
0
);
],
BasePlayer
.
prototype
,
"
pos
"
,
void
0
);
return
BasePlayer
;
})();
exports
.
BasePlayer
=
BasePlayer
;
//# sourceMappingURL=BasePlayer.js.map
\ No newline at end of file
data-manager/entities/CloudReplay.js
View file @
6bf0003b
...
...
@@ -17,7 +17,8 @@ const typeorm_1 = require("typeorm");
const
CloudReplayPlayer_1
=
require
(
"
./CloudReplayPlayer
"
);
const
underscore_1
=
__importDefault
(
require
(
"
underscore
"
));
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
let
CloudReplay
=
class
CloudReplay
{
let
CloudReplay
=
/** @class */
(()
=>
{
let
CloudReplay
=
class
CloudReplay
{
fromBuffer
(
buffer
)
{
this
.
data
=
buffer
.
toString
(
"
base64
"
);
}
...
...
@@ -35,25 +36,27 @@ let CloudReplay = class CloudReplay {
getDisplayString
()
{
return
`R#
${
this
.
id
}
${
this
.
getPlayerNamesString
()}
${
this
.
getDateString
()}
`
;
}
};
__decorate
([
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
CloudReplay
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
],
CloudReplay
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
text
"
}),
__metadata
(
"
design:type
"
,
String
)
],
CloudReplay
.
prototype
,
"
data
"
,
void
0
);
__decorate
([
],
CloudReplay
.
prototype
,
"
data
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
datetime
"
}),
__metadata
(
"
design:type
"
,
Date
)
],
CloudReplay
.
prototype
,
"
date
"
,
void
0
);
__decorate
([
],
CloudReplay
.
prototype
,
"
date
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
CloudReplayPlayer_1
.
CloudReplayPlayer
,
player
=>
player
.
cloudReplay
),
__metadata
(
"
design:type
"
,
Array
)
],
CloudReplay
.
prototype
,
"
players
"
,
void
0
);
CloudReplay
=
__decorate
([
],
CloudReplay
.
prototype
,
"
players
"
,
void
0
);
CloudReplay
=
__decorate
([
typeorm_1
.
Entity
()
],
CloudReplay
);
],
CloudReplay
);
return
CloudReplay
;
})();
exports
.
CloudReplay
=
CloudReplay
;
//# sourceMappingURL=CloudReplay.js.map
\ No newline at end of file
data-manager/entities/CloudReplayPlayer.js
View file @
6bf0003b
...
...
@@ -8,13 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
var
__metadata
=
(
this
&&
this
.
__metadata
)
||
function
(
k
,
v
)
{
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
metadata
===
"
function
"
)
return
Reflect
.
metadata
(
k
,
v
);
};
var
CloudReplayPlayer_1
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
CloudReplayPlayer
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
CloudReplay_1
=
require
(
"
./CloudReplay
"
);
const
BasePlayer_1
=
require
(
"
./BasePlayer
"
);
let
CloudReplayPlayer
=
CloudReplayPlayer_1
=
class
CloudReplayPlayer
extends
BasePlayer_1
.
BasePlayer
{
let
CloudReplayPlayer
=
/** @class */
(()
=>
{
var
CloudReplayPlayer_1
;
let
CloudReplayPlayer
=
CloudReplayPlayer_1
=
class
CloudReplayPlayer
extends
BasePlayer_1
.
BasePlayer
{
static
fromPlayerInfo
(
info
)
{
const
p
=
new
CloudReplayPlayer_1
();
p
.
key
=
info
.
key
;
...
...
@@ -22,18 +23,20 @@ let CloudReplayPlayer = CloudReplayPlayer_1 = class CloudReplayPlayer extends Ba
p
.
pos
=
info
.
pos
;
return
p
;
}
};
__decorate
([
};
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
40
}),
__metadata
(
"
design:type
"
,
String
)
],
CloudReplayPlayer
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
],
CloudReplayPlayer
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
CloudReplay_1
.
CloudReplay
,
replay
=>
replay
.
players
),
__metadata
(
"
design:type
"
,
CloudReplay_1
.
CloudReplay
)
],
CloudReplayPlayer
.
prototype
,
"
cloudReplay
"
,
void
0
);
CloudReplayPlayer
=
CloudReplayPlayer_1
=
__decorate
([
],
CloudReplayPlayer
.
prototype
,
"
cloudReplay
"
,
void
0
);
CloudReplayPlayer
=
CloudReplayPlayer_1
=
__decorate
([
typeorm_1
.
Entity
()
],
CloudReplayPlayer
);
],
CloudReplayPlayer
);
return
CloudReplayPlayer
;
})();
exports
.
CloudReplayPlayer
=
CloudReplayPlayer
;
//# sourceMappingURL=CloudReplayPlayer.js.map
\ No newline at end of file
data-manager/entities/DuelLog.js
View file @
6bf0003b
...
...
@@ -17,7 +17,8 @@ const typeorm_1 = require("typeorm");
const
DuelLogPlayer_1
=
require
(
"
./DuelLogPlayer
"
);
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
const
underscore_1
=
__importDefault
(
require
(
"
underscore
"
));
let
DuelLog
=
class
DuelLog
{
let
DuelLog
=
/** @class */
(()
=>
{
let
DuelLog
=
class
DuelLog
{
getViewString
()
{
const
viewPlayers
=
underscore_1
.
default
.
clone
(
this
.
players
);
viewPlayers
.
sort
((
p1
,
p2
)
=>
p1
.
pos
-
p2
.
pos
);
...
...
@@ -44,46 +45,48 @@ let DuelLog = class DuelLog {
};
return
data
;
}
};
__decorate
([
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
datetime
"
),
__metadata
(
"
design:type
"
,
Date
)
],
DuelLog
.
prototype
,
"
time
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
time
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLog
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
roomId
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
roomId
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
bigint
"
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
cloudReplayId
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
cloudReplayId
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
256
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLog
.
prototype
,
"
replayFileName
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
replayFileName
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
roomMode
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
roomMode
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLog
.
prototype
,
"
duelCount
"
,
void
0
);
__decorate
([
],
DuelLog
.
prototype
,
"
duelCount
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
DuelLogPlayer_1
.
DuelLogPlayer
,
player
=>
player
.
duelLog
),
__metadata
(
"
design:type
"
,
Array
)
],
DuelLog
.
prototype
,
"
players
"
,
void
0
);
DuelLog
=
__decorate
([
],
DuelLog
.
prototype
,
"
players
"
,
void
0
);
DuelLog
=
__decorate
([
typeorm_1
.
Entity
()
],
DuelLog
);
],
DuelLog
);
return
DuelLog
;
})();
exports
.
DuelLog
=
DuelLog
;
//# sourceMappingURL=DuelLog.js.map
\ No newline at end of file
data-manager/entities/DuelLogPlayer.js
View file @
6bf0003b
...
...
@@ -8,14 +8,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
var
__metadata
=
(
this
&&
this
.
__metadata
)
||
function
(
k
,
v
)
{
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
metadata
===
"
function
"
)
return
Reflect
.
metadata
(
k
,
v
);
};
var
DuelLogPlayer_1
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
DuelLogPlayer
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
BasePlayer_1
=
require
(
"
./BasePlayer
"
);
const
DuelLog_1
=
require
(
"
./DuelLog
"
);
const
DeckEncoder_1
=
require
(
"
../DeckEncoder
"
);
let
DuelLogPlayer
=
DuelLogPlayer_1
=
class
DuelLogPlayer
extends
BasePlayer_1
.
BasePlayer
{
let
DuelLogPlayer
=
/** @class */
(()
=>
{
var
DuelLogPlayer_1
;
let
DuelLogPlayer
=
DuelLogPlayer_1
=
class
DuelLogPlayer
extends
BasePlayer_1
.
BasePlayer
{
setStartDeck
(
deck
)
{
if
(
deck
===
null
)
{
this
.
startDeckBuffer
=
null
;
...
...
@@ -51,50 +52,52 @@ let DuelLogPlayer = DuelLogPlayer_1 = class DuelLogPlayer extends BasePlayer_1.B
p
.
setCurrentDeck
(
info
.
deck
);
return
p
;
}
};
__decorate
([
};
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
realName
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
realName
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
varchar
"
,
length
:
64
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
isFirst
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
isFirst
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
score
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
score
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
lp
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
lp
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
smallint
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
cardCount
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
cardCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
startDeckBuffer
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
startDeckBuffer
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
DuelLogPlayer
.
prototype
,
"
currentDeckBuffer
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
currentDeckBuffer
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
),
__metadata
(
"
design:type
"
,
Number
)
],
DuelLogPlayer
.
prototype
,
"
winner
"
,
void
0
);
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
winner
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
DuelLog_1
.
DuelLog
,
duelLog
=>
duelLog
.
players
),
__metadata
(
"
design:type
"
,
DuelLog_1
.
DuelLog
)
],
DuelLogPlayer
.
prototype
,
"
duelLog
"
,
void
0
);
DuelLogPlayer
=
DuelLogPlayer_1
=
__decorate
([
],
DuelLogPlayer
.
prototype
,
"
duelLog
"
,
void
0
);
DuelLogPlayer
=
DuelLogPlayer_1
=
__decorate
([
typeorm_1
.
Entity
()
],
DuelLogPlayer
);
],
DuelLogPlayer
);
return
DuelLogPlayer
;
})();
exports
.
DuelLogPlayer
=
DuelLogPlayer
;
//# sourceMappingURL=DuelLogPlayer.js.map
\ No newline at end of file
data-manager/entities/RandomDuelBan.js
View file @
6bf0003b
...
...
@@ -11,36 +11,39 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
RandomDuelBan
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
let
RandomDuelBan
=
class
RandomDuelBan
{
let
RandomDuelBan
=
/** @class */
(()
=>
{
let
RandomDuelBan
=
class
RandomDuelBan
{
setNeedTip
(
need
)
{
this
.
needTip
=
need
?
1
:
0
;
}
getNeedTip
()
{
return
this
.
needTip
>
0
?
true
:
false
;
}
};
__decorate
([
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
type
:
"
varchar
"
,
length
:
64
}),
__metadata
(
"
design:type
"
,
String
)
],
RandomDuelBan
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
],
RandomDuelBan
.
prototype
,
"
ip
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
datetime
"
),
__metadata
(
"
design:type
"
,
Date
)
],
RandomDuelBan
.
prototype
,
"
time
"
,
void
0
);
__decorate
([
],
RandomDuelBan
.
prototype
,
"
time
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
smallint
"
),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelBan
.
prototype
,
"
count
"
,
void
0
);
__decorate
([
],
RandomDuelBan
.
prototype
,
"
count
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
simple-array
"
}),
__metadata
(
"
design:type
"
,
Array
)
],
RandomDuelBan
.
prototype
,
"
reasons
"
,
void
0
);
__decorate
([
],
RandomDuelBan
.
prototype
,
"
reasons
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
({
type
:
"
tinyint
"
,
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelBan
.
prototype
,
"
needTip
"
,
void
0
);
RandomDuelBan
=
__decorate
([
],
RandomDuelBan
.
prototype
,
"
needTip
"
,
void
0
);
RandomDuelBan
=
__decorate
([
typeorm_1
.
Entity
()
],
RandomDuelBan
);
],
RandomDuelBan
);
return
RandomDuelBan
;
})();
exports
.
RandomDuelBan
=
RandomDuelBan
;
//# sourceMappingURL=RandomDuelBan.js.map
\ No newline at end of file
data-manager/entities/User.js
View file @
6bf0003b
...
...
@@ -17,42 +17,45 @@ const typeorm_1 = require("typeorm");
const
UserDialog_1
=
require
(
"
./UserDialog
"
);
const
VipKey_1
=
require
(
"
./VipKey
"
);
const
moment_1
=
__importDefault
(
require
(
"
moment
"
));
let
User
=
class
User
{
let
User
=
/** @class */
(()
=>
{
let
User
=
class
User
{
isVip
()
{
return
this
.
vipExpireDate
&&
moment_1
.
default
().
isBefore
(
this
.
vipExpireDate
);
}
};
__decorate
([
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
type
:
"
varchar
"
,
length
:
128
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
],
User
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
varchar
"
,
{
length
:
16
,
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
chatColor
"
,
void
0
);
__decorate
([
],
User
.
prototype
,
"
chatColor
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
datetime
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
Date
)
],
User
.
prototype
,
"
vipExpireDate
"
,
void
0
);
__decorate
([
],
User
.
prototype
,
"
vipExpireDate
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
victory
"
,
void
0
);
__decorate
([
],
User
.
prototype
,
"
victory
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
words
"
,
void
0
);
__decorate
([
],
User
.
prototype
,
"
words
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
UserDialog_1
.
UserDialog
,
dialog
=>
dialog
.
user
),
__metadata
(
"
design:type
"
,
Array
)
],
User
.
prototype
,
"
dialogues
"
,
void
0
);
__decorate
([
],
User
.
prototype
,
"
dialogues
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
VipKey_1
.
VipKey
,
vipKey
=>
vipKey
.
usedBy
),
__metadata
(
"
design:type
"
,
Array
)
],
User
.
prototype
,
"
usedKeys
"
,
void
0
);
User
=
__decorate
([
],
User
.
prototype
,
"
usedKeys
"
,
void
0
);
User
=
__decorate
([
typeorm_1
.
Entity
()
],
User
);
],
User
);
return
User
;
})();
exports
.
User
=
User
;
//# sourceMappingURL=User.js.map
\ No newline at end of file
data-manager/entities/UserDialog.js
View file @
6bf0003b
...
...
@@ -12,27 +12,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports
.
UserDialog
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
User_1
=
require
(
"
./User
"
);
let
UserDialog
=
class
UserDialog
{
};
__decorate
([
let
UserDialog
=
/** @class */
(()
=>
{
let
UserDialog
=
class
UserDialog
{
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
UserDialog
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
],
UserDialog
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
UserDialog
.
prototype
,
"
cardCode
"
,
void
0
);
__decorate
([
],
UserDialog
.
prototype
,
"
cardCode
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
),
__metadata
(
"
design:type
"
,
String
)
],
UserDialog
.
prototype
,
"
text
"
,
void
0
);
__decorate
([
],
UserDialog
.
prototype
,
"
text
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
User_1
.
User
,
user
=>
user
.
dialogues
),
__metadata
(
"
design:type
"
,
User_1
.
User
)
],
UserDialog
.
prototype
,
"
user
"
,
void
0
);
UserDialog
=
__decorate
([
],
UserDialog
.
prototype
,
"
user
"
,
void
0
);
UserDialog
=
__decorate
([
typeorm_1
.
Entity
()
],
UserDialog
);
],
UserDialog
);
return
UserDialog
;
})();
exports
.
UserDialog
=
UserDialog
;
//# sourceMappingURL=UserDialog.js.map
\ No newline at end of file
data-manager/entities/VipKey.js
View file @
6bf0003b
...
...
@@ -12,34 +12,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports
.
VipKey
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
const
User_1
=
require
(
"
./User
"
);
let
VipKey
=
class
VipKey
{
let
VipKey
=
/** @class */
(()
=>
{
let
VipKey
=
class
VipKey
{
toJSON
()
{
return
{
key
:
this
.
key
,
type
:
this
.
type
};
}
};
__decorate
([
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
],
VipKey
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
({
unique
:
true
}),
typeorm_1
.
Column
(
"
varchar
"
,
{
length
:
30
}),
__metadata
(
"
design:type
"
,
String
)
],
VipKey
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
],
VipKey
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
type
"
,
void
0
);
__decorate
([
],
VipKey
.
prototype
,
"
type
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
isUsed
"
,
void
0
);
__decorate
([
],
VipKey
.
prototype
,
"
isUsed
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
User_1
.
User
,
user
=>
user
.
usedKeys
),
__metadata
(
"
design:type
"
,
User_1
.
User
)
],
VipKey
.
prototype
,
"
usedBy
"
,
void
0
);
VipKey
=
__decorate
([
],
VipKey
.
prototype
,
"
usedBy
"
,
void
0
);
VipKey
=
__decorate
([
typeorm_1
.
Entity
()
],
VipKey
);
],
VipKey
);
return
VipKey
;
})();
exports
.
VipKey
=
VipKey
;
//# sourceMappingURL=VipKey.js.map
\ No newline at end of file
data/i18n.json
View file @
6bf0003b
...
...
@@ -193,6 +193,7 @@
"vip_set_victory"
:
"Your victory word have been set."
,
"vip_password_changed"
:
"Password changed."
,
"vip_player_name_too_long"
:
"Your username or password is too long to log in. Please change your username and try again."
,
"vip_no_pass"
:
"You must use the name format of Name$Password to support."
,
"replay_hint_part1"
:
"Sending the replay of the duel number "
,
"replay_hint_part2"
:
"."
,
"arena_wait_hint"
:
"If you opponent does not appear within 25 seconds, you may quit without any penalty."
,
...
...
@@ -543,6 +544,7 @@
"vip_set_victory"
:
"已设置胜利台词。"
,
"vip_password_changed"
:
"密码修改成功。"
,
"vip_player_name_too_long"
:
"你的用户名或设置的密码太长,使用此用户名可能会无法登陆。请更换用户名重试。"
,
"vip_no_pass"
:
"为了保证未来可以识别您的身份,请使用 用户名$密码 的格式重试。"
,
"replay_hint_part1"
:
"正在发送第"
,
"replay_hint_part2"
:
"局决斗的录像。"
,
"arena_wait_hint"
:
"若对手在25秒内不进入游戏,您退房时不会进行扣分。"
,
...
...
ygopro-server.coffee
View file @
6bf0003b
This diff is collapsed.
Click to expand it.
ygopro-server.js
View file @
6bf0003b
This diff is collapsed.
Click to expand it.
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