Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
MobiusMei
ygopro
Commits
248f8bac
Commit
248f8bac
authored
Apr 09, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into server-link
parents
2f55ba41
6344b48c
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
75 additions
and
80 deletions
+75
-80
README.md
README.md
+3
-3
gframe/data_manager.cpp
gframe/data_manager.cpp
+16
-32
gframe/drawing.cpp
gframe/drawing.cpp
+13
-7
gframe/duelclient.cpp
gframe/duelclient.cpp
+9
-4
gframe/event_handler.cpp
gframe/event_handler.cpp
+4
-4
gframe/game.cpp
gframe/game.cpp
+23
-4
gframe/game.h
gframe/game.h
+1
-0
gframe/materials.cpp
gframe/materials.cpp
+1
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-11
gframe/single_mode.cpp
gframe/single_mode.cpp
+1
-11
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+1
-1
No files found.
README.md
View file @
248f8bac
...
...
@@ -5,7 +5,7 @@
现用于
[
萌卡
](
https://mycard.moe/
)
和
[
YGOPRO 233服
](
http://mercury233.me/ygosrv233/
)
。
###Linux下编译
###
Linux下编译
*
需要以下组件或工具
*
gcc
*
premake4
...
...
@@ -14,7 +14,7 @@
*
sqlite3
*
可参考 https://github.com/mercury233/ygopro-server/wiki 中的脚本
###Windows下编译
###
Windows下编译
*
需要以下组件或工具
*
Visual Studio
*
premake5
...
...
@@ -24,7 +24,7 @@
*
dirent for windows
*
可参考本项目
[
appveyor.yml
](
https://github.com/mycard/ygopro/blob/server/appveyor.yml
)
中的脚本
###运行
###
运行
*
使用
[
ygopro-server
](
https://github.com/mycard/ygopro-server
)
运行
*
手动运行的参数是
*
./ygopro 0 0 0 1 F F F 8000 5 1 180 0
...
...
gframe/data_manager.cpp
View file @
248f8bac
...
...
@@ -305,38 +305,22 @@ const wchar_t* DataManager::FormatSetName(unsigned long long setcode) {
}
const
wchar_t
*
DataManager
::
FormatLinkMarker
(
int
link_marker
)
{
wchar_t
*
p
=
lmBuffer
;
if
(
link_marker
&
LINK_MARKER_TOP_LEFT
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2196
;
}
if
(
link_marker
&
LINK_MARKER_TOP
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2191
;
}
if
(
link_marker
&
LINK_MARKER_TOP_RIGHT
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2197
;
}
if
(
link_marker
&
LINK_MARKER_LEFT
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2190
;
}
if
(
link_marker
&
LINK_MARKER_RIGHT
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2192
;
}
if
(
link_marker
&
LINK_MARKER_BOTTOM_LEFT
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2199
;
}
if
(
link_marker
&
LINK_MARKER_BOTTOM
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2193
;
}
if
(
link_marker
&
LINK_MARKER_BOTTOM_RIGHT
)
{
BufferIO
::
CopyWStrRef
(
L"[ ]"
,
p
,
4
);
*
(
p
-
2
)
=
0x2198
;
}
if
(
link_marker
&
LINK_MARKER_TOP_LEFT
)
BufferIO
::
CopyWStrRef
(
L"[\u2196]"
,
p
,
4
);
if
(
link_marker
&
LINK_MARKER_TOP
)
BufferIO
::
CopyWStrRef
(
L"[\u2191]"
,
p
,
4
);
if
(
link_marker
&
LINK_MARKER_TOP_RIGHT
)
BufferIO
::
CopyWStrRef
(
L"[\u2197]"
,
p
,
4
);
if
(
link_marker
&
LINK_MARKER_LEFT
)
BufferIO
::
CopyWStrRef
(
L"[\u2190]"
,
p
,
4
);
if
(
link_marker
&
LINK_MARKER_RIGHT
)
BufferIO
::
CopyWStrRef
(
L"[\u2192]"
,
p
,
4
);
if
(
link_marker
&
LINK_MARKER_BOTTOM_LEFT
)
BufferIO
::
CopyWStrRef
(
L"[\u2199]"
,
p
,
4
);
if
(
link_marker
&
LINK_MARKER_BOTTOM
)
BufferIO
::
CopyWStrRef
(
L"[\u2193]"
,
p
,
4
);
if
(
link_marker
&
LINK_MARKER_BOTTOM_RIGHT
)
BufferIO
::
CopyWStrRef
(
L"[\u2198]"
,
p
,
4
);
return
lmBuffer
;
}
int
DataManager
::
CardReader
(
int
code
,
void
*
pData
)
{
...
...
gframe/drawing.cpp
View file @
248f8bac
...
...
@@ -307,14 +307,20 @@ void Game::DrawMisc() {
driver
->
drawVertexPrimitiveList
(
matManager
.
vActivate
,
4
,
matManager
.
iRectangle
,
2
);
}
if
(
dField
.
pzone_act
[
0
])
{
im
.
setTranslation
(
vector3df
((
matManager
.
vFieldSzone
[
0
][
6
][
0
].
Pos
.
X
+
matManager
.
vFieldSzone
[
0
][
6
][
1
].
Pos
.
X
)
/
2
,
(
matManager
.
vFieldSzone
[
0
][
6
][
0
].
Pos
.
Y
+
matManager
.
vFieldSzone
[
0
][
6
][
2
].
Pos
.
Y
)
/
2
,
0.03
f
));
int
seq
=
0
;
if
(
dField
.
szone
[
0
][
6
]
&&
dField
.
szone
[
0
][
6
]
->
lscale
)
seq
=
6
;
im
.
setTranslation
(
vector3df
((
matManager
.
vFieldSzone
[
0
][
seq
][
0
].
Pos
.
X
+
matManager
.
vFieldSzone
[
0
][
seq
][
1
].
Pos
.
X
)
/
2
,
(
matManager
.
vFieldSzone
[
0
][
seq
][
0
].
Pos
.
Y
+
matManager
.
vFieldSzone
[
0
][
seq
][
2
].
Pos
.
Y
)
/
2
,
0.03
f
));
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vActivate
,
4
,
matManager
.
iRectangle
,
2
);
}
if
(
dField
.
pzone_act
[
1
])
{
im
.
setTranslation
(
vector3df
((
matManager
.
vFieldSzone
[
0
][
7
][
0
].
Pos
.
X
+
matManager
.
vFieldSzone
[
0
][
7
][
1
].
Pos
.
X
)
/
2
,
(
matManager
.
vFieldSzone
[
0
][
7
][
0
].
Pos
.
Y
+
matManager
.
vFieldSzone
[
0
][
7
][
2
].
Pos
.
Y
)
/
2
,
0.03
f
));
int
seq
=
0
;
if
(
dField
.
szone
[
1
][
6
]
&&
dField
.
szone
[
1
][
6
]
->
lscale
)
seq
=
6
;
im
.
setTranslation
(
vector3df
((
matManager
.
vFieldSzone
[
1
][
seq
][
0
].
Pos
.
X
+
matManager
.
vFieldSzone
[
1
][
seq
][
1
].
Pos
.
X
)
/
2
,
(
matManager
.
vFieldSzone
[
1
][
seq
][
0
].
Pos
.
Y
+
matManager
.
vFieldSzone
[
1
][
seq
][
2
].
Pos
.
Y
)
/
2
,
0.03
f
));
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vActivate
,
4
,
matManager
.
iRectangle
,
2
);
}
...
...
@@ -983,9 +989,9 @@ void Game::DrawDeckBd() {
textFont
->
draw
(
textBuffer
,
recti
(
859
,
164
+
i
*
66
,
955
,
185
+
i
*
66
),
0xff000000
,
false
,
false
);
textFont
->
draw
(
textBuffer
,
recti
(
860
,
165
+
i
*
66
,
955
,
185
+
i
*
66
),
0xffffffff
,
false
,
false
);
if
(
!
(
ptr
->
second
.
type
&
TYPE_LINK
))
{
int
form
=
0x2605
;
if
(
ptr
->
second
.
type
&
TYPE_XYZ
)
++
form
;
myswprintf
(
textBuffer
,
L"%ls/%ls %
c
%d"
,
dataManager
.
FormatAttribute
(
ptr
->
second
.
attribute
),
dataManager
.
FormatRace
(
ptr
->
second
.
race
),
form
,
ptr
->
second
.
level
);
wchar_t
*
form
=
L"\u2605"
;
if
(
ptr
->
second
.
type
&
TYPE_XYZ
)
form
=
L"\u2606"
;
myswprintf
(
textBuffer
,
L"%ls/%ls %
ls
%d"
,
dataManager
.
FormatAttribute
(
ptr
->
second
.
attribute
),
dataManager
.
FormatRace
(
ptr
->
second
.
race
),
form
,
ptr
->
second
.
level
);
textFont
->
draw
(
textBuffer
,
recti
(
859
,
186
+
i
*
66
,
955
,
207
+
i
*
66
),
0xff000000
,
false
,
false
);
textFont
->
draw
(
textBuffer
,
recti
(
860
,
187
+
i
*
66
,
955
,
207
+
i
*
66
),
0xffffffff
,
false
,
false
);
if
(
ptr
->
second
.
attack
<
0
&&
ptr
->
second
.
defense
<
0
)
...
...
gframe/duelclient.cpp
View file @
248f8bac
...
...
@@ -1013,7 +1013,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
remove_act
=
true
;
else
if
(
pcard
->
location
==
LOCATION_EXTRA
)
mainGame
->
dField
.
extra_act
=
true
;
else
if
(
pcard
->
location
==
LOCATION_SZONE
&&
pcard
->
sequence
==
6
)
else
if
(
pcard
->
location
==
LOCATION_SZONE
&&
(
pcard
->
sequence
==
0
||
pcard
->
sequence
==
6
)
&&
pcard
->
lscale
)
mainGame
->
dField
.
pzone_act
[
pcard
->
controler
]
=
true
;
}
mainGame
->
dField
.
reposable_cards
.
clear
();
...
...
@@ -1289,9 +1289,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
selected_field
=
0
;
unsigned
char
respbuf
[
64
];
int
pzone
=
0
;
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_PLACE
)
mainGame
->
stHintMsg
->
setText
(
dataManager
.
GetSysString
(
569
));
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_PLACE
)
{
if
(
select_hint
)
{
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
569
),
dataManager
.
GetName
(
select_hint
));
}
else
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
560
));
select_hint
=
0
;
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
}
else
mainGame
->
stHintMsg
->
setText
(
dataManager
.
GetSysString
(
570
));
mainGame
->
stHintMsg
->
setVisible
(
true
);
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_PLACE
&&
mainGame
->
chkAutoPos
->
isChecked
())
{
...
...
gframe/event_handler.cpp
View file @
248f8bac
...
...
@@ -1750,9 +1750,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf
(
formatBuffer
,
L"
\n
%ls/%ls"
,
mcard
->
atkstring
,
mcard
->
defstring
);
str
.
append
(
formatBuffer
);
if
(
!
(
mcard
->
type
&
TYPE_LINK
))
{
int
form
=
0x2605
;
if
(
mcard
->
rank
)
++
form
;
myswprintf
(
formatBuffer
,
L"
\n
%
c
%d"
,
form
,
(
mcard
->
level
?
mcard
->
level
:
mcard
->
rank
));
wchar_t
*
form
=
L"\u2605"
;
if
(
mcard
->
rank
)
form
=
L"\u2606"
;
myswprintf
(
formatBuffer
,
L"
\n
%
ls
%d"
,
form
,
(
mcard
->
level
?
mcard
->
level
:
mcard
->
rank
));
str
.
append
(
formatBuffer
);
}
else
{
myswprintf
(
formatBuffer
,
L"
\n
LINK-%d"
,
mcard
->
link
);
...
...
@@ -1769,7 +1769,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf
(
formatBuffer
,
L"
\n
(%ls)"
,
dataManager
.
GetName
(
mcard
->
alias
));
str
.
append
(
formatBuffer
);
}
if
(
mcard
->
location
==
LOCATION_SZONE
&&
(
mcard
->
sequence
==
6
||
mcard
->
sequence
==
7
)
)
{
if
(
mcard
->
location
==
LOCATION_SZONE
&&
mcard
->
lscale
)
{
myswprintf
(
formatBuffer
,
L"
\n
%d/%d"
,
mcard
->
lscale
,
mcard
->
rscale
);
str
.
append
(
formatBuffer
);
}
...
...
gframe/game.cpp
View file @
248f8bac
...
...
@@ -1084,9 +1084,9 @@ void Game::ShowCardInfo(int code) {
myswprintf(formatBuffer, L"[%ls] %ls/%ls", dataManager.FormatType(cd.type), dataManager.FormatRace(cd.race), dataManager.FormatAttribute(cd.attribute));
stInfo->setText(formatBuffer);
if(!(cd.type & TYPE_LINK)) {
int form = 0x2605
;
if(cd.type & TYPE_XYZ)
++form
;
myswprintf(formatBuffer, L"[%
c
%d] ", form, cd.level);
wchar_t* form = L"\u2605"
;
if(cd.type & TYPE_XYZ)
form = L"\u2606"
;
myswprintf(formatBuffer, L"[%
ls
%d] ", form, cd.level);
wchar_t adBuffer[16];
if(cd.attack < 0 && cd.defense < 0)
myswprintf(adBuffer, L"?/?");
...
...
@@ -1162,7 +1162,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
chatMsg[0].append(L"[System]: ");
break;
case 9: //error message
chatMsg[0].append(L"[Script
error:]
");
chatMsg[0].append(L"[Script
Error]:
");
break;
default: //from watcher or unknown
if(player < 11 || player > 19)
...
...
@@ -1170,6 +1170,25 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
}
chatMsg[0].append(msg);
}
void Game::AddDebugMsg(char* msg)
{
if (enable_log & 0x1) {
wchar_t wbuf[1024];
BufferIO::DecodeUTF8(msg, wbuf);
mainGame->AddChatMsg(wbuf, 9);
}
if (enable_log & 0x2) {
FILE* fp = fopen("error.log", "at");
if (!fp)
return;
time_t nowtime = time(NULL);
struct tm *localedtime = localtime(&nowtime);
char timebuf[40];
strftime(timebuf, 40, "%Y-%m-%d %H:%M:%S", localedtime);
fprintf(fp, "[%s][Script Error]: %s\n", timebuf, msg);
fclose(fp);
}
}
void Game::ClearTextures() {
matManager.mCard.setTexture(0, 0);
mainGame->imgCard->setImage(0);
...
...
gframe/game.h
View file @
248f8bac
...
...
@@ -106,6 +106,7 @@ public:
void SaveConfig();
void ShowCardInfo(int code);
void AddChatMsg(wchar_t* msg, int player);
void AddDebugMsg(char* msgbuf);
void ClearTextures();
void CloseDuelWindow();
*/
...
...
gframe/materials.cpp
View file @
248f8bac
...
...
@@ -23,7 +23,7 @@ Materials::Materials() {
SetS3DVertex
(
vField
,
-
1.0
f
,
-
4.0
f
,
9.0
f
,
4.0
f
,
0
,
1
,
0
,
0
,
1
,
1
);
SetS3DVertex
(
vFieldSpell
,
1.2
f
,
-
3.2
f
,
6.7
f
,
3.2
f
,
0
,
1
,
0
,
0
,
1
,
1
);
SetS3DVertex
(
vFieldSpell1
,
1.2
f
,
0.8
f
,
6.7
f
,
3.2
f
,
0
,
1
,
0
,
0.2
f
,
1
,
0.63636
f
);
SetS3DVertex
(
vFieldSpell2
,
1.2
f
,
-
3.2
f
,
6.7
f
,
-
0.8
f
,
0
,
1
,
0
,
0.63636
f
,
1
,
0.2
f
);
SetS3DVertex
(
vFieldSpell2
,
1.2
f
,
-
3.2
f
,
6.7
f
,
-
0.8
f
,
0
,
1
,
1
,
0.63636
f
,
0
,
0.2
f
);
/*
//background grids
...
...
gframe/replay_mode.cpp
View file @
248f8bac
...
...
@@ -855,17 +855,7 @@ int ReplayMode::MessageHandler(long fduel, int type) {
return
0
;
char
msgbuf
[
1024
];
get_log_message
(
fduel
,
(
byte
*
)
msgbuf
);
if
(
enable_log
==
1
)
{
wchar_t
wbuf
[
1024
];
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
mainGame
->
AddChatMsg
(
wbuf
,
9
);
}
else
if
(
enable_log
==
2
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
if
(
!
fp
)
return
0
;
fprintf
(
fp
,
"[Script error:] %s
\n
"
,
msgbuf
);
fclose
(
fp
);
}
mainGame
->
AddDebugMsg
(
msgbuf
);
return
0
;
}
...
...
gframe/single_mode.cpp
View file @
248f8bac
...
...
@@ -828,17 +828,7 @@ int SingleMode::MessageHandler(long fduel, int type) {
return
0
;
char
msgbuf
[
1024
];
get_log_message
(
fduel
,
(
byte
*
)
msgbuf
);
if
(
enable_log
==
1
)
{
wchar_t
wbuf
[
1024
];
BufferIO
::
DecodeUTF8
(
msgbuf
,
wbuf
);
mainGame
->
AddChatMsg
(
wbuf
,
9
);
}
else
if
(
enable_log
==
2
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
if
(
!
fp
)
return
0
;
fprintf
(
fp
,
"[Script error:] %s
\n
"
,
msgbuf
);
fclose
(
fp
);
}
mainGame
->
AddDebugMsg
(
msgbuf
);
return
0
;
}
...
...
ocgcore
@
6fcb8368
Subproject commit
79b333e777773847087bfb151240f1889a1eae33
Subproject commit
6fcb836853c8d1bd41a95b1350578732adf56ff9
script
@
2ec851da
Subproject commit
658042de2000249a3d08cf5e1c45253443e6de1c
Subproject commit
2ec851da8ba399fba856e14d58eb73050d02c002
strings.conf
View file @
248f8bac
...
...
@@ -114,7 +114,7 @@
!
system
566
请选择要发动效果的卡
!
system
567
请宣言一个等级
!
system
568
请选择要处理效果的卡
!
system
569
请选择
卡片
的位置
!
system
569
请选择
[%
ls
]
的位置
!
system
570
请选择要变成不能使用的卡片区域
!
system
1000
卡组
!
system
1001
手卡
...
...
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