Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-arena-api
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
MyCard
ygopro-arena-api
Commits
9b5ab583
Commit
9b5ab583
authored
Mar 01, 2017
by
ganjingcun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a
parent
eeea4bec
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
14 deletions
+33
-14
routes/api.js
routes/api.js
+3
-3
test_read_conf.js
test_read_conf.js
+30
-11
ygopro-database/locales/en-US/cards.cdb
ygopro-database/locales/en-US/cards.cdb
+0
-0
ygopro-database/locales/en-US/strings.conf
ygopro-database/locales/en-US/strings.conf
+0
-0
ygopro-database/locales/ja-JP/cards.cdb
ygopro-database/locales/ja-JP/cards.cdb
+0
-0
ygopro-database/locales/ja-JP/strings.conf
ygopro-database/locales/ja-JP/strings.conf
+0
-0
ygopro-database/locales/zh-CN/cards.cdb
ygopro-database/locales/zh-CN/cards.cdb
+0
-0
ygopro-database/locales/zh-CN/strings.conf
ygopro-database/locales/zh-CN/strings.conf
+0
-0
No files found.
routes/api.js
View file @
9b5ab583
...
@@ -29,8 +29,8 @@ var config = {
...
@@ -29,8 +29,8 @@ var config = {
var
pool
=
new
pg
.
Pool
(
config
)
var
pool
=
new
pg
.
Pool
(
config
)
//sqlite
//sqlite
var
dbEn
=
new
sqlite3
.
Database
(
'
locales/en-US/cards.cdb
'
);
var
dbEn
=
new
sqlite3
.
Database
(
'
ygopro-database/
locales/en-US/cards.cdb
'
);
var
dbCn
=
new
sqlite3
.
Database
(
'
locales/zh-CN/cards.cdb
'
);
var
dbCn
=
new
sqlite3
.
Database
(
'
ygopro-database/
locales/zh-CN/cards.cdb
'
);
...
@@ -543,4 +543,4 @@ createUser = function (username, ep, epEventName) {
...
@@ -543,4 +543,4 @@ createUser = function (username, ep, epEventName) {
})
})
}
}
module
.
exports
=
router
module
.
exports
=
router
\ No newline at end of file
test_read_conf.js
View file @
9b5ab583
...
@@ -2,43 +2,62 @@ var fs = require('fs');
...
@@ -2,43 +2,62 @@ var fs = require('fs');
var
_
=
require
(
'
underscore
'
);
var
_
=
require
(
'
underscore
'
);
var
async
=
require
(
'
async
'
);
var
async
=
require
(
'
async
'
);
var
filePath
=
"
./locales/zh-CN/strings.conf
"
var
filePath
=
"
./
ygopro-database/
locales/zh-CN/strings.conf
"
var
filePath2
=
"
./locales/en-US/strings.conf
"
var
filePath2
=
"
./
ygopro-database/
locales/en-US/strings.conf
"
async
.
parallel
([
async
.
parallel
([
function
(
callback
)
{
function
(
callback
)
{
fs
.
readFile
(
filePath
,
'
utf8
'
,
(
err
,
data
)
=>
{
fs
.
readFile
(
filePath
,
'
utf8
'
,
(
err
,
data
)
=>
{
if
(
err
)
throw
err
;
if
(
err
)
throw
err
;
var
races
=
{}
var
strings
=
data
.
split
(
"
\n
"
)
var
strings
=
data
.
split
(
"
\n
"
)
.
filter
((
s
)
=>
{
.
filter
((
s
)
=>
{
return
s
.
startsWith
(
"
!
"
)
return
s
.
startsWith
(
"
!
"
)
}).
map
(
s
=>
{
}).
map
(
s
=>
{
let
strs
=
s
.
split
(
"
"
)
let
strs
=
s
.
split
(
"
"
)
return
{
[
strs
[
1
]]:
strs
[
2
]
}
return
[
strs
[
1
],
strs
[
2
]
]
}).
filter
((
s
)
=>
{
}).
filter
((
s
)
=>
{
var
key
=
Object
.
keys
(
s
)[
0
]
var
key
=
s
[
0
]
return
!
isNaN
(
key
)
&&
(
key
>
1000
&&
key
<
1050
)
return
!
isNaN
(
key
)
&&
(
key
>
1019
&&
key
<
1080
)
}).
map
(
s
=>
{
console
.
log
(
s
)
races
[
s
[
0
]]
=
s
[
1
]
})
})
callback
(
null
,
string
s
)
callback
(
null
,
race
s
)
});
});
},
},
function
(
callback
)
{
function
(
callback
)
{
fs
.
readFile
(
filePath2
,
'
utf8
'
,
(
err
,
data
)
=>
{
fs
.
readFile
(
filePath2
,
'
utf8
'
,
(
err
,
data
)
=>
{
if
(
err
)
throw
err
;
if
(
err
)
throw
err
;
var
races
=
{}
var
strings
=
data
.
split
(
"
\n
"
)
var
strings
=
data
.
split
(
"
\n
"
)
.
filter
((
s
)
=>
{
.
filter
((
s
)
=>
{
return
s
.
startsWith
(
"
!
"
)
return
s
.
startsWith
(
"
!
"
)
}).
map
(
s
=>
{
}).
map
(
s
=>
{
let
strs
=
s
.
split
(
"
"
)
let
strs
=
s
.
split
(
"
"
)
races
[
strs
[
1
]]
=
strs
[
2
]
return
{
[
strs
[
1
]]:
strs
[
2
]
}
return
{
[
strs
[
1
]]:
strs
[
2
]
}
}).
filter
((
s
)
=>
{
}).
filter
((
s
)
=>
{
var
key
=
Object
.
keys
(
s
)[
0
]
var
key
=
Object
.
keys
(
s
)[
0
]
return
!
isNaN
(
key
)
&&
(
key
>
10
00
&&
key
<
105
0
)
return
!
isNaN
(
key
)
&&
(
key
>
10
19
&&
key
<
108
0
)
})
})
callback
(
null
,
string
s
)
callback
(
null
,
race
s
)
});
});
}],
}],
function
(
err
,
results
)
{
function
(
err
,
results
)
{
console
.
log
(
err
)
// console.log(err)
console
.
log
(
JSON
.
stringify
(
results
))
//console.log(JSON.stringify(results[0]))
});
});
\ No newline at end of file
// dist = {"1001":"手卡","1002":"怪兽区","1003":"魔法陷阱区","1004":"墓地","1005":"除外","1006":"额外","1007":"叠放","1008":"场地区","1009":"灵摆区","1010":"地","1011":"水","1012":"炎","1013":"风","1014":"光","1015":"暗","1016":"神","1020":"战士","1021":"魔法师","1022":"天使","1023":"恶魔","1024":"不死","1025":"机械","1026":"水","1027":"炎","1028":"岩石","1029":"鸟兽","1030":"植物","1031":"昆虫","1032":"雷","1033":"龙","1034":"兽","1035":"兽战士","1036":"恐龙","1037":"鱼","1038":"海龙","1039":"爬虫","1040":"念动力","1041":"幻神兽","1042":"创造神","1043":"幻龙"}
// data = 32
// arrtOffset = 1010
// raceOffset = 1020
// typeOffset = 1050
// for i in range(32):
// if (data & (1 << i)):
// index = offset+ i
// print(dist[str(index)])
locales/en-US/cards.cdb
→
ygopro-database/
locales/en-US/cards.cdb
View file @
9b5ab583
File moved
locales/en-US/strings.conf
→
ygopro-database/
locales/en-US/strings.conf
View file @
9b5ab583
File moved
locales/ja-JP/cards.cdb
→
ygopro-database/
locales/ja-JP/cards.cdb
View file @
9b5ab583
File moved
locales/ja-JP/strings.conf
→
ygopro-database/
locales/ja-JP/strings.conf
View file @
9b5ab583
File moved
locales/zh-CN/cards.cdb
→
ygopro-database/
locales/zh-CN/cards.cdb
View file @
9b5ab583
File moved
locales/zh-CN/strings.conf
→
ygopro-database/
locales/zh-CN/strings.conf
View file @
9b5ab583
File moved
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