Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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-2pick
Commits
ac3baf79
Commit
ac3baf79
authored
Dec 28, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
mg_custom
parents
6a15c97a
14a10e97
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
69 additions
and
11 deletions
+69
-11
README.md
README.md
+3
-3
appveyor.yml
appveyor.yml
+6
-1
gframe/game.cpp
gframe/game.cpp
+33
-1
gframe/game.h
gframe/game.h
+1
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+5
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+5
-0
ocgcore/card.h
ocgcore/card.h
+1
-1
ocgcore/field.h
ocgcore/field.h
+4
-0
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+9
-3
ocgcore/processor.cpp
ocgcore/processor.cpp
+2
-2
No files found.
README.md
View file @
ac3baf79
## YGOPro(Server)
OCG server data for 222/7210
[

](https://travis-ci.org/purerosefallen/ygopro-7210srv)
\ No newline at end of file
## YGOPro-222DIY
The server of YGOPRO 222DIY group
[

](https://travis-ci.org/purerosefallen/ygopro-222DIY)
\ No newline at end of file
appveyor.yml
View file @
ac3baf79
...
...
@@ -26,6 +26,9 @@ install:
# let premake happy
-
xcopy /E premake\* .
# patch lua
# - patch -p0 < lua\lua.patch
# premake
-
premake5 vs2015
...
...
@@ -37,6 +40,7 @@ build:
after_build
:
-
ps
:
move bin\release\ygopro.exe .
-
git clone https://github.com/Smile-DK/ygopro-svrelease
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/ygopro-server/archive/master.zip ; exit 0"
-
7z x ygopro-server-master.zip
...
...
@@ -112,7 +116,7 @@ artifacts:
-
path
:
ygopro.exe
name
:
ygopro
-
path
:
ygopro-server.7z
name
:
ygopro-server
name
:
ygopro-server
cache
:
-
premake-5.0.0-alpha12-windows.zip
...
...
@@ -124,3 +128,4 @@ cache:
-
irrKlang-32bit-1.5.0.zip
-
premake-5.0.0-alpha10-windows.zip
-
Redis-x64-3.2.100.zip
gframe/game.cpp
View file @
ac3baf79
...
...
@@ -33,9 +33,9 @@ HostInfo game_info;
void
Game
::
MainServerLoop
()
{
deckManager
.
LoadLFList
();
LoadBetaDB
();
LoadExpansionDB
();
dataManager
.
LoadDB
(
"cards.cdb"
);
aServerPort
=
NetServer
::
StartServer
(
aServerPort
);
NetServer
::
InitDuel
();
printf
(
"%u
\n
"
,
aServerPort
);
...
...
@@ -49,6 +49,38 @@ void Game::MainServerLoop() {
#endif
}
}
void
Game
::
LoadBetaDB
()
{
#ifdef _WIN32
char
fpath
[
1000
];
WIN32_FIND_DATAW
fdataw
;
HANDLE
fh
=
FindFirstFileW
(
L"./beta/*.cdb"
,
&
fdataw
);
if
(
fh
!=
INVALID_HANDLE_VALUE
)
{
do
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
char
fname
[
780
];
BufferIO
::
EncodeUTF8
(
fdataw
.
cFileName
,
fname
);
sprintf
(
fpath
,
"./beta/%s"
,
fname
);
dataManager
.
LoadDB
(
fpath
);
}
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
}
#else
DIR
*
dir
;
struct
dirent
*
dirp
;
if
((
dir
=
opendir
(
"./beta/"
))
!=
NULL
)
{
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
size_t
len
=
strlen
(
dirp
->
d_name
);
if
(
len
<
5
||
strcasecmp
(
dirp
->
d_name
+
len
-
4
,
".cdb"
)
!=
0
)
continue
;
char
filepath
[
1000
];
sprintf
(
filepath
,
"./beta/%s"
,
dirp
->
d_name
);
dataManager
.
LoadDB
(
filepath
);
}
closedir
(
dir
);
}
#endif
}
#else //YGOPRO_SERVER_MODE
bool
Game
::
Initialize
()
{
srand
(
time
(
0
));
...
...
gframe/game.h
View file @
ac3baf79
...
...
@@ -102,6 +102,7 @@ public:
#ifdef YGOPRO_SERVER_MODE
void
MainServerLoop
();
void
LoadExpansionDB
();
void
LoadBetaDB
();
void
AddDebugMsg
(
char
*
msgbuf
);
#else
void
MainLoop
();
...
...
gframe/single_duel.cpp
View file @
ac3baf79
...
...
@@ -741,7 +741,12 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
//modded
case
10
:
case
11
:
<<<<<<<
HEAD
case
12
:
{
=======
case
12
:
case
13
:
{
>>>>>>>
14
a10e9739978823dada7a651464807daa69d5a3
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
1
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
gframe/tag_duel.cpp
View file @
ac3baf79
...
...
@@ -667,7 +667,12 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
}
//modded
case
11
:
<<<<<<<
HEAD
case
12
:
{
=======
case
12
:
case
13
:
{
>>>>>>>
14
a10e9739978823dada7a651464807daa69d5a3
for
(
int
i
=
0
;
i
<
4
;
++
i
)
NetServer
::
SendBufferToPlayer
(
players
[
i
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
ocgcore/card.h
View file @
ac3baf79
...
...
@@ -104,7 +104,7 @@ public:
public:
void
addcard
(
card
*
pcard
);
};
//millux
uint32
get_ritual_type
();
//modded
...
...
ocgcore/field.h
View file @
ac3baf79
...
...
@@ -783,6 +783,10 @@ public:
#define HINT_CODE 8
#define HINT_NUMBER 9
#define HINT_CARD 10
//custom hints in KoishiPro for custom sound
#define HINT_MUSIC 11
#define HINT_SOUND 12
#define HINT_MUSIC_OGG 13
//
#define CHINT_TURN 1
#define CHINT_CARD 2
...
...
ocgcore/interpreter.cpp
View file @
ac3baf79
...
...
@@ -645,7 +645,7 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal
(
lua_state
,
"Debug"
);
//extra scripts
load_script
((
char
*
)
"./script/constant.lua"
);
load_script
((
char
*
)
"./script/utility.lua"
);
load_script
((
char
*
)
"./script/utility.lua"
);
//load kpro constant
lua_pushinteger
(
lua_state
,
EFFECT_CHANGE_LINK_MARKER_KOISHI
);
lua_setglobal
(
lua_state
,
"EFFECT_CHANGE_LINK_MARKER_KOISHI"
);
...
...
@@ -655,10 +655,16 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal
(
lua_state
,
"EFFECT_REMOVE_LINK_MARKER_KOISHI"
);
lua_pushinteger
(
lua_state
,
EFFECT_CANNOT_LOSE_KOISHI
);
lua_setglobal
(
lua_state
,
"EFFECT_CANNOT_LOSE_KOISHI"
);
lua_pushinteger
(
lua_state
,
HINT_MUSIC
);
lua_setglobal
(
lua_state
,
"HINT_MUSIC"
);
lua_pushinteger
(
lua_state
,
HINT_SOUND
);
lua_setglobal
(
lua_state
,
"HINT_SOUND"
);
lua_pushinteger
(
lua_state
,
HINT_MUSIC_OGG
);
lua_setglobal
(
lua_state
,
"HINT_MUSIC_OGG"
);
//load init.lua by MLD
load_script
((
char
*
)
"./expansions/script/init.lua"
);
//2pick rule
load_script
((
char
*
)
"./2pick/pick.lua"
);
//load init.lua by MLD
load_script
((
char
*
)
"./expansions/script/init.lua"
);
}
interpreter
::~
interpreter
()
{
lua_close
(
lua_state
);
...
...
ocgcore/processor.cpp
View file @
ac3baf79
...
...
@@ -3379,7 +3379,7 @@ int32 field::process_battle_command(uint16 step) {
pduel
->
write_buffer32
(
indestructable_effect
->
owner
->
data
.
code
);
if
(
indestructable_effect
->
description
)
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
12
);
pduel
->
write_buffer8
(
HINT_SOUND
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
(
indestructable_effect
->
description
);
}
...
...
@@ -3396,7 +3396,7 @@ int32 field::process_battle_command(uint16 step) {
pduel
->
write_buffer32
(
indestructable_effect
->
owner
->
data
.
code
);
if
(
indestructable_effect
->
description
)
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
12
);
pduel
->
write_buffer8
(
HINT_SOUND
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
(
indestructable_effect
->
description
);
}
...
...
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