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
YGOPRO-520DIY
ygopro
Commits
7bab7fd2
Commit
7bab7fd2
authored
May 19, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fh' into patch-deck-category
parents
d690f3db
5009c68e
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
39 deletions
+79
-39
gframe/CMakeLists.txt
gframe/CMakeLists.txt
+1
-2
gframe/drawing.cpp
gframe/drawing.cpp
+20
-22
gframe/duelclient.cpp
gframe/duelclient.cpp
+21
-9
gframe/game.cpp
gframe/game.cpp
+4
-4
gframe/network.h
gframe/network.h
+1
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+14
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+16
-0
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/CMakeLists.txt
View file @
7bab7fd2
...
...
@@ -28,7 +28,7 @@ endif ()
target_link_libraries
(
ygopro ocgcore clzma
)
if
(
MSVC
)
target_link_libraries
(
ygopro irrlicht freetype sqlite3 event
lua
)
target_link_libraries
(
ygopro irrlicht freetype sqlite3 event
)
include_directories
(
"../irrlicht/include"
"../freetype/include"
"../event/include"
"../sqlite3"
)
else
()
target_link_libraries
(
ygopro
...
...
@@ -36,7 +36,6 @@ else ()
${
FREETYPE_LIBRARIES
}
${
SQLITE_LIBRARIES
}
${
LIBEVENT_LIBRARIES
}
${
LUA_LIBRARIES
}
${
OPENGL_gl_LIBRARY
}
)
include_directories
(
...
...
gframe/drawing.cpp
View file @
7bab7fd2
...
...
@@ -457,7 +457,6 @@ void Game::DrawMisc() {
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vActivate
,
4
,
matManager
.
iRectangle
,
2
);
}
if
(
dField
.
chains
.
size
()
>
1
)
{
for
(
size_t
i
=
0
;
i
<
dField
.
chains
.
size
();
++
i
)
{
if
(
dField
.
chains
[
i
].
solved
)
break
;
...
...
@@ -479,7 +478,6 @@ void Game::DrawMisc() {
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
it
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vChainNum
,
4
,
matManager
.
iRectangle
,
2
);
}
}
//finish button
if
(
btnCancelOrFinish
->
isVisible
()
&&
dField
.
select_ready
)
DrawSelectionLine
(
btnCancelOrFinish
,
2
,
0xffffff00
);
...
...
gframe/duelclient.cpp
View file @
7bab7fd2
...
...
@@ -409,6 +409,19 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
break
;
}
case
STOC_DECK_COUNT
:
{
mainGame
->
gMutex
.
lock
();
int
deckc
=
BufferIO
::
ReadInt16
(
pdata
);
int
extrac
=
BufferIO
::
ReadInt16
(
pdata
);
int
sidec
=
BufferIO
::
ReadInt16
(
pdata
);
mainGame
->
dField
.
Initial
(
0
,
deckc
,
extrac
);
deckc
=
BufferIO
::
ReadInt16
(
pdata
);
extrac
=
BufferIO
::
ReadInt16
(
pdata
);
sidec
=
BufferIO
::
ReadInt16
(
pdata
);
mainGame
->
dField
.
Initial
(
1
,
deckc
,
extrac
);
mainGame
->
gMutex
.
unlock
();
break
;
}
case
STOC_JOIN_GAME
:
{
STOC_JoinGame
*
pkt
=
(
STOC_JoinGame
*
)
pdata
;
std
::
wstring
str
;
...
...
@@ -1166,6 +1179,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
WaitFrameSignal
(
40
);
mainGame
->
showcard
=
0
;
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
Clear
();
int
playertype
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dInfo
.
isFirst
=
(
playertype
&
0xf
)
?
false
:
true
;
if
(
playertype
&
0xf0
)
...
...
@@ -2894,8 +2908,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
if
(
mainGame
->
dField
.
chains
.
size
()
>
1
)
{
if
(
mainGame
->
dField
.
last_chain
)
if
(
mainGame
->
dField
.
last_chain
)
mainGame
->
WaitFrameSignal
(
11
);
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
mainGame
->
dField
.
chains
[
ct
-
1
].
solved
=
false
;
...
...
@@ -2903,7 +2916,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
chains
[
ct
-
1
].
solved
=
true
;
mainGame
->
WaitFrameSignal
(
3
);
}
}
mainGame
->
dField
.
last_chain
=
false
;
return
true
;
}
...
...
gframe/game.cpp
View file @
7bab7fd2
...
...
@@ -10,7 +10,7 @@
#include "netserver.h"
#include "single_mode.h"
const
unsigned
short
PRO_VERSION
=
0x135
0
;
const
unsigned
short
PRO_VERSION
=
0x135
1
;
namespace
ygo
{
...
...
@@ -981,15 +981,15 @@ void Game::LoadExpansions() {
myswprintf
(
fpath
,
L"./expansions/%ls"
,
name
);
dataManager
.
LoadDB
(
fpath
);
}
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".zip"
,
4
))
{
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
(
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".zip"
,
4
)
||
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".ypk"
,
4
)
))
{
wchar_t
fpath
[
1024
];
myswprintf
(
fpath
,
L"./expansions/%ls"
,
name
);
#ifdef _WIN32
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
);
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
EFAT_ZIP
);
#else
char
upath
[
1024
];
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
dataManager
.
FileSystem
->
addFileArchive
(
upath
,
true
,
false
);
dataManager
.
FileSystem
->
addFileArchive
(
upath
,
true
,
false
,
EFAT_ZIP
);
#endif
}
});
...
...
gframe/network.h
View file @
7bab7fd2
...
...
@@ -185,6 +185,7 @@ public:
#define STOC_TP_RESULT 0x6
#define STOC_CHANGE_SIDE 0x7
#define STOC_WAITING_SIDE 0x8
#define STOC_DECK_COUNT 0x9
#define STOC_CREATE_GAME 0x11
#define STOC_JOIN_GAME 0x12
#define STOC_TYPE_CHANGE 0x13
...
...
gframe/single_duel.cpp
View file @
7bab7fd2
...
...
@@ -328,6 +328,20 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
NetServer
::
ReSendToPlayer
(
*
oit
);
}
char
deckbuff
[
12
];
char
*
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
char
tempbuff
[
6
];
memcpy
(
tempbuff
,
deckbuff
,
6
);
memcpy
(
deckbuff
,
deckbuff
+
6
,
6
);
memcpy
(
deckbuff
+
6
,
tempbuff
,
6
);
NetServer
::
SendBufferToPlayer
(
players
[
1
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
hand_result
[
0
]
=
0
;
...
...
gframe/tag_duel.cpp
View file @
7bab7fd2
...
...
@@ -285,6 +285,22 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
(
*
oit
)
->
state
=
CTOS_LEAVE_GAME
;
NetServer
::
ReSendToPlayer
(
*
oit
);
}
char
deckbuff
[
12
];
char
*
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
char
tempbuff
[
6
];
memcpy
(
tempbuff
,
deckbuff
,
6
);
memcpy
(
deckbuff
,
deckbuff
+
6
,
6
);
memcpy
(
deckbuff
+
6
,
tempbuff
,
6
);
NetServer
::
SendBufferToPlayer
(
players
[
2
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
ReSendToPlayer
(
players
[
3
]);
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_SELECT_HAND
);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
hand_result
[
0
]
=
0
;
...
...
ocgcore
@
4d2e3603
Subproject commit
e80d151ae5d9efba5cee6e2360e3679e1789d429
Subproject commit
4d2e3603745b8e92ab0248c9ff49174d0cbb4f5a
script
@
216c4754
Subproject commit
b820812a1ffb14eeb0022b2336c0c8c93d856d5c
Subproject commit
216c4754fb203fe2f598fee02ace05e54f7cea55
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