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
bcfe4525
Commit
bcfe4525
authored
Mar 29, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge
https://github.com/mycard/ygopro-server
into lite
parents
3b8b6594
947de68d
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
276 additions
and
225 deletions
+276
-225
.dockerignore
.dockerignore
+7
-0
Dockerfile
Dockerfile
+13
-2
config.json
config.json
+0
-1
room.coffee
room.coffee
+80
-74
room.js
room.js
+12
-4
ygopro-server.coffee
ygopro-server.coffee
+145
-142
ygopro-server.js
ygopro-server.js
+19
-2
No files found.
.dockerignore
0 → 100644
View file @
bcfe4525
Dockerfile
.git
.gitattributes
.gitignore
.gitmodules
.gitkeep
.dockerignore
Dockerfile
View file @
bcfe4525
FROM
node
FROM
node
RUN
apt-get update
RUN
apt-get update
RUN
apt-get
install
-y
git build-essential premake4 libfreetype6-dev libevent-dev libsqlite3-dev liblua5.2-dev mono-complete
RUN
apt-get
install
-y
git build-essential premake4 libfreetype6-dev libevent-dev libsqlite3-dev liblua5.2-dev mono-complete
cmake
RUN
mkdir
-p
/usr/src/app
RUN
mkdir
-p
/usr/src/app
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
...
@@ -17,11 +17,22 @@ WORKDIR /usr/src/app/ygopro
...
@@ -17,11 +17,22 @@ WORKDIR /usr/src/app/ygopro
RUN
ln
-s
bin/release/ygopro ygopro
RUN
ln
-s
bin/release/ygopro ygopro
RUN
strip ygopro
RUN
strip ygopro
WORKDIR
/usr/src/app/ygosharp
RUN
xbuild /property:Configuration
=
Release /property:OutDir
=
/usr/src/app/windbot/
RUN
mv
/usr/src/app/windbot /usr/src/app/windbot-source
RUN
mv
/usr/src/app/windbot /usr/src/app/windbot-source
WORKDIR
/usr/src/app/windbot-source/NLua/Core/KeraLua
ENV
CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64
RUN
make
-f
Makefile.Linux
RUN
xbuild KeraLua.Net45.sln /p:Configuration
=
Release
WORKDIR
/usr/src/app/windbot-source/NLua
RUN
xbuild NLua.Net45.sln /p:Configuration
=
Release
RUN
mv
/usr/src/app/windbot-source/NLua/Run/Release/net45/
*
.dll /usr/src/app/windbot-source/
WORKDIR
/usr/src/app/windbot-source
WORKDIR
/usr/src/app/windbot-source
RUN
xbuild /property:Configuration
=
Release /property:OutDir
=
/usr/src/app/windbot/
RUN
xbuild /property:Configuration
=
Release /property:OutDir
=
/usr/src/app/windbot/
RUN
mv
/usr/src/app/windbot-source/NLua/Core/KeraLua/external/lua/linux/lib64/liblua52.so /usr/src/app/windbot/
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
RUN
rm
-rf
/usr/src/app/windbot-source
#
RUN rm -rf /usr/src/app/windbot-source
RUN
ln
-s
/usr/src/app/ygopro/cards.cdb /usr/src/app/windbot/cards.cdb
RUN
ln
-s
/usr/src/app/ygopro/cards.cdb /usr/src/app/windbot/cards.cdb
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
...
...
config.json
View file @
bcfe4525
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
"enable_random_duel"
:
false
,
"enable_random_duel"
:
false
,
"mycard_auth"
:
false
,
"mycard_auth"
:
false
,
"post_start_watching"
:
true
,
"post_start_watching"
:
true
,
"TCG_banlist_id"
:
8
,
"enable_TCG_as_default"
:
false
,
"enable_TCG_as_default"
:
false
,
"http"
:
{
"http"
:
{
"port"
:
7922
,
"port"
:
7922
,
...
...
room.coffee
View file @
bcfe4525
This diff is collapsed.
Click to expand it.
room.js
View file @
bcfe4525
...
@@ -204,7 +204,9 @@
...
@@ -204,7 +204,9 @@
this
.
welcome
=
''
;
this
.
welcome
=
''
;
Room
.
all
.
push
(
this
);
Room
.
all
.
push
(
this
);
this
.
hostinfo
||
(
this
.
hostinfo
=
{
this
.
hostinfo
||
(
this
.
hostinfo
=
{
lflist
:
0
,
lflist
:
function
(
list
)
{
return
!
list
.
tcg
&&
list
.
date
.
isBefore
();
},
rule
:
settings
.
modules
.
enable_TCG_as_default
?
2
:
0
,
rule
:
settings
.
modules
.
enable_TCG_as_default
?
2
:
0
,
mode
:
0
,
mode
:
0
,
enable_priority
:
false
,
enable_priority
:
false
,
...
@@ -259,10 +261,14 @@
...
@@ -259,10 +261,14 @@
switch
(
rule
.
charAt
(
2
))
{
switch
(
rule
.
charAt
(
2
))
{
case
"
1
"
:
case
"
1
"
:
case
"
T
"
:
case
"
T
"
:
this
.
hostinfo
.
lflist
=
settings
.
modules
.
TCG_banlist_id
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
list
.
tcg
&&
list
.
date
.
isBefore
();
});
break
;
break
;
default
:
default
:
this
.
hostinfo
.
lflist
=
0
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
!
list
.
tcg
&&
list
.
date
.
isBefore
();
});
}
}
if
((
param
=
parseInt
(
rule
.
charAt
(
3
).
match
(
/
\d
/
)))
>=
0
)
{
if
((
param
=
parseInt
(
rule
.
charAt
(
3
).
match
(
/
\d
/
)))
>=
0
)
{
this
.
hostinfo
.
time_limit
=
param
*
60
;
this
.
hostinfo
.
time_limit
=
param
*
60
;
...
@@ -311,7 +317,9 @@
...
@@ -311,7 +317,9 @@
}
}
if
(
rule
.
match
(
/
(
^|,|,
)(
TCGONLY|TO
)(
,|,|$
)
/
))
{
if
(
rule
.
match
(
/
(
^|,|,
)(
TCGONLY|TO
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
1
;
this
.
hostinfo
.
rule
=
1
;
this
.
hostinfo
.
lflist
=
settings
.
modules
.
TCG_banlist_id
;
this
.
hostinfo
.
lflist
=
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
list
.
tcg
&&
list
.
date
.
isBefore
();
});
}
}
if
(
rule
.
match
(
/
(
^|,|,
)(
OCGONLY|OO
)(
,|,|$
)
/
))
{
if
(
rule
.
match
(
/
(
^|,|,
)(
OCGONLY|OO
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
rule
=
0
;
this
.
hostinfo
.
rule
=
0
;
...
...
ygopro-server.coffee
View file @
bcfe4525
This diff is collapsed.
Click to expand it.
ygopro-server.js
View file @
bcfe4525
// Generated by CoffeeScript 1.10.0
// Generated by CoffeeScript 1.10.0
(
function
()
{
(
function
()
{
var
Graveyard
,
Room
,
_
,
bunyan
,
crypto
,
debug
,
dialogues
,
execFile
,
fs
,
http
,
http_server
,
https
,
https_server
,
log
,
moment
,
net
,
options
,
os
,
path
,
pg
,
request
,
requestListener
,
roomlist
,
settings
,
tips
,
tribute
,
url
,
users_cache
,
wait_room_start
,
ygopro
;
var
Graveyard
,
Room
,
_
,
bunyan
,
crypto
,
debug
,
dialogues
,
execFile
,
fs
,
http
,
http_server
,
https
,
https_server
,
l
ist
,
l
og
,
moment
,
net
,
options
,
os
,
path
,
pg
,
request
,
requestListener
,
roomlist
,
settings
,
tips
,
tribute
,
url
,
users_cache
,
wait_room_start
,
ygopro
;
net
=
require
(
'
net
'
);
net
=
require
(
'
net
'
);
...
@@ -40,6 +40,20 @@
...
@@ -40,6 +40,20 @@
settings
.
version
=
parseInt
(
fs
.
readFileSync
(
'
ygopro/gframe/game.cpp
'
,
'
utf8
'
).
match
(
/PRO_VERSION =
([
x
\d]
+
)
/
)[
1
],
'
16
'
);
settings
.
version
=
parseInt
(
fs
.
readFileSync
(
'
ygopro/gframe/game.cpp
'
,
'
utf8
'
).
match
(
/PRO_VERSION =
([
x
\d]
+
)
/
)[
1
],
'
16
'
);
settings
.
lflist
=
(
function
()
{
var
k
,
len
,
ref
,
results
;
ref
=
fs
.
readFileSync
(
'
ygopro/lflist.conf
'
,
'
utf8
'
).
match
(
/!.*/g
);
results
=
[];
for
(
k
=
0
,
len
=
ref
.
length
;
k
<
len
;
k
++
)
{
list
=
ref
[
k
];
results
.
push
({
date
:
moment
(
list
.
match
(
/!
([\d\.]
+
)
/
)[
1
],
'
YYYY.MM.DD
'
),
tcg
:
list
.
indexOf
(
'
TCG
'
)
!==
-
1
});
}
return
results
;
})();
ygopro
=
require
(
'
./ygopro.js
'
);
ygopro
=
require
(
'
./ygopro.js
'
);
Room
=
require
(
'
./room.js
'
);
Room
=
require
(
'
./room.js
'
);
...
@@ -351,7 +365,7 @@
...
@@ -351,7 +365,7 @@
});
});
client
.
end
();
client
.
end
();
}
else
if
(
settings
.
modules
.
windbot
&&
info
.
pass
.
slice
(
0
,
2
)
===
'
AI
'
)
{
}
else
if
(
settings
.
modules
.
windbot
&&
info
.
pass
.
slice
(
0
,
2
)
===
'
AI
'
)
{
if
(
info
.
pass
.
length
>
3
&&
info
.
pass
.
slice
(
0
,
3
)
===
'
AI#
'
)
{
if
(
info
.
pass
.
length
>
3
&&
info
.
pass
.
slice
(
0
,
3
)
===
'
AI#
'
||
info
.
pass
.
slice
(
0
,
3
)
===
'
AI_
'
)
{
name
=
info
.
pass
.
slice
(
3
);
name
=
info
.
pass
.
slice
(
3
);
windbot
=
_
.
sample
(
_
.
filter
(
settings
.
modules
.
windbot
,
function
(
w
)
{
windbot
=
_
.
sample
(
_
.
filter
(
settings
.
modules
.
windbot
,
function
(
w
)
{
return
w
.
name
===
name
||
w
.
deck
===
name
;
return
w
.
name
===
name
||
w
.
deck
===
name
;
...
@@ -442,6 +456,9 @@
...
@@ -442,6 +456,9 @@
start_hand
:
opt3
>>
4
,
start_hand
:
opt3
>>
4
,
draw_count
:
opt3
&
0xF
draw_count
:
opt3
&
0xF
};
};
options
.
lflist
=
_
.
findIndex
(
settings
.
lflist
,
function
(
list
)
{
return
((
options
.
rule
===
1
)
===
list
.
tcg
)
&&
list
.
date
.
isBefore
();
});
room
=
new
Room
(
name
,
options
);
room
=
new
Room
(
name
,
options
);
room
.
title
=
info
.
pass
.
slice
(
8
).
replace
(
String
.
fromCharCode
(
0xFEFF
),
'
'
);
room
.
title
=
info
.
pass
.
slice
(
8
).
replace
(
String
.
fromCharCode
(
0xFEFF
),
'
'
);
room
[
"
private
"
]
=
action
===
2
;
room
[
"
private
"
]
=
action
===
2
;
...
...
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