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
xiaoye
ygopro
Commits
45f65abc
Commit
45f65abc
authored
May 21, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into another-develop
parents
8d8e9860
c67eae02
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
281 additions
and
75 deletions
+281
-75
cards.cdb
cards.cdb
+0
-0
gframe/bufferio.h
gframe/bufferio.h
+9
-18
gframe/client_field.cpp
gframe/client_field.cpp
+2
-0
gframe/client_field.h
gframe/client_field.h
+2
-0
gframe/drawing.cpp
gframe/drawing.cpp
+2
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+12
-18
gframe/event_handler.cpp
gframe/event_handler.cpp
+5
-2
gframe/network.h
gframe/network.h
+1
-0
gframe/replay.cpp
gframe/replay.cpp
+10
-16
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+17
-2
gframe/tag_duel.h
gframe/tag_duel.h
+1
-0
lflist.conf
lflist.conf
+213
-13
ocgcore
ocgcore
+1
-1
premake/gframe/ygopro.rc
premake/gframe/ygopro.rc
+2
-2
script
script
+1
-1
strings.conf
strings.conf
+3
-2
No files found.
cards.cdb
View file @
45f65abc
No preview for this file type
gframe/bufferio.h
View file @
45f65abc
#ifndef BUFFERIO_H
#define BUFFERIO_H
#include <cstdint>
#include "../ocgcore/buffer.h"
class
BufferIO
{
public:
inline
static
int
ReadInt32
(
unsigned
char
*&
p
)
{
int
ret
=
*
(
int
*
)
p
;
p
+=
4
;
return
ret
;
return
buffer_read
<
int32_t
>
(
p
);
}
inline
static
unsigned
int
ReadUInt32
(
unsigned
char
*&
p
)
{
unsigned
int
ret
=
*
(
unsigned
int
*
)
p
;
...
...
@@ -15,9 +15,7 @@ public:
return
ret
;
}
inline
static
short
ReadInt16
(
unsigned
char
*&
p
)
{
short
ret
=
*
(
short
*
)
p
;
p
+=
2
;
return
ret
;
return
buffer_read
<
int16_t
>
(
p
);
}
inline
static
unsigned
short
ReadUInt16
(
unsigned
char
*&
p
)
{
unsigned
short
ret
=
*
(
unsigned
short
*
)
p
;
...
...
@@ -25,26 +23,19 @@ public:
return
ret
;
}
inline
static
char
ReadInt8
(
unsigned
char
*&
p
)
{
char
ret
=
*
(
char
*
)
p
;
p
++
;
return
ret
;
return
buffer_read
<
char
>
(
p
);
}
inline
static
unsigned
char
ReadUInt8
(
unsigned
char
*&
p
)
{
unsigned
char
ret
=
*
(
unsigned
char
*
)
p
;
p
++
;
return
ret
;
return
buffer_read
<
unsigned
char
>
(
p
);
}
inline
static
void
WriteInt32
(
unsigned
char
*&
p
,
int
val
)
{
(
*
(
int
*
)
p
)
=
val
;
p
+=
4
;
buffer_write
<
int32_t
>
(
p
,
val
);
}
inline
static
void
WriteInt16
(
unsigned
char
*&
p
,
short
val
)
{
(
*
(
short
*
)
p
)
=
val
;
p
+=
2
;
buffer_write
<
int16_t
>
(
p
,
val
);
}
inline
static
void
WriteInt8
(
unsigned
char
*&
p
,
char
val
)
{
*
p
=
val
;
p
++
;
buffer_write
<
char
>
(
p
,
val
);
}
template
<
typename
T1
,
typename
T2
>
inline
static
int
CopyWStr
(
T1
*
src
,
T2
*
pstr
,
int
bufsize
)
{
...
...
gframe/client_field.cpp
View file @
45f65abc
...
...
@@ -120,6 +120,8 @@ void ClientField::Clear() {
conti_act
=
false
;
deck_reversed
=
false
;
cant_check_grave
=
false
;
tag_surrender
=
false
;
tag_teammate_surrender
=
false
;
RefreshCardCountDisplay
();
}
void
ClientField
::
Initial
(
int
player
,
int
deckc
,
int
extrac
)
{
...
...
gframe/client_field.h
View file @
45f65abc
...
...
@@ -87,6 +87,8 @@ public:
bool
deck_reversed
{
false
};
bool
conti_selecting
{
false
};
bool
cant_check_grave
{
false
};
bool
tag_surrender
{
false
};
bool
tag_teammate_surrender
{
false
};
mt19937
rnd
;
ClientField
();
...
...
gframe/drawing.cpp
View file @
45f65abc
...
...
@@ -559,6 +559,8 @@ void Game::DrawMisc() {
//finish button
if
(
btnCancelOrFinish
->
isVisible
()
&&
dField
.
select_ready
)
DrawSelectionLine
(
btnCancelOrFinish
,
2
,
0xffffff00
);
if
(
btnLeaveGame
->
isVisible
()
&&
dField
.
tag_teammate_surrender
)
DrawSelectionLine
(
btnLeaveGame
,
2
,
0xffffff00
);
//lp bar
if
((
dInfo
.
turn
%
2
&&
dInfo
.
isFirst
&&
!
dInfo
.
is_swapped
)
||
(
!
(
dInfo
.
turn
%
2
)
&&
!
dInfo
.
isFirst
&&
!
dInfo
.
is_swapped
)
||
(
!
(
dInfo
.
turn
%
2
)
&&
dInfo
.
isFirst
&&
dInfo
.
is_swapped
)
||
(
dInfo
.
turn
%
2
&&
!
dInfo
.
isFirst
&&
dInfo
.
is_swapped
))
{
driver
->
draw2DRectangle
(
0xa0000000
,
Resize
(
327
,
8
,
630
,
51
));
...
...
gframe/duelclient.cpp
View file @
45f65abc
...
...
@@ -747,7 +747,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
}
}
else
{
if
(
selftype
>
3
)
{
mainGame
->
dInfo
.
player_type
=
7
;
mainGame
->
dInfo
.
player_type
=
NETPLAYER_TYPE_OBSERVER
;
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1350
));
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
mainGame
->
btnSpectatorSwap
->
setVisible
(
true
);
...
...
@@ -927,23 +927,6 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
play_sound
=
true
;
if
(
play_sound
&&
mainGame
->
chkIgnore1
->
isChecked
())
break
;
if
(
!
mainGame
->
dInfo
.
isTag
)
{
if
(
mainGame
->
dInfo
.
isStarted
)
player
=
mainGame
->
LocalPlayer
(
player
);
}
else
{
if
(
mainGame
->
dInfo
.
isStarted
&&
!
mainGame
->
dInfo
.
isFirst
)
player
^=
2
;
if
(
player
==
0
)
player
=
0
;
else
if
(
player
==
1
)
player
=
2
;
else
if
(
player
==
2
)
player
=
1
;
else
if
(
player
==
3
)
player
=
3
;
else
player
=
10
;
}
}
else
{
if
(
player
==
8
)
{
//system custom message.
play_sound
=
true
;
...
...
@@ -1064,6 +1047,11 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
break
;
}
case
STOC_TEAMMATE_SURRENDER
:
{
if
(
!
mainGame
->
dField
.
tag_surrender
)
mainGame
->
dField
.
tag_teammate_surrender
=
true
;
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1355
));
}
}
}
// Analyze STOC_GAME_MSG packet
...
...
@@ -2737,6 +2725,12 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dInfo
.
is_swapped
=
!
mainGame
->
dInfo
.
is_swapped
;
return
true
;
}
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
player_type
<
7
)
{
mainGame
->
dField
.
tag_surrender
=
false
;
mainGame
->
dField
.
tag_teammate_surrender
=
false
;
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1351
));
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
}
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
player_type
<
7
)
{
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1351
));
...
...
gframe/event_handler.cpp
View file @
45f65abc
...
...
@@ -143,7 +143,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
}
else
{
mainGame
->
PopupElement
(
mainGame
->
wSurrender
);
if
(
!
(
mainGame
->
dInfo
.
isTag
&&
mainGame
->
dField
.
tag_surrender
))
mainGame
->
PopupElement
(
mainGame
->
wSurrender
);
}
break
;
}
...
...
@@ -151,10 +152,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
DuelClient
::
SendPacketToServer
(
CTOS_SURRENDER
);
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
dField
.
tag_surrender
=
true
;
break
;
}
case
BUTTON_SURRENDER_NO
:
{
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
mainGame
->
dField
.
tag_teammate_surrender
=
false
;
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
break
;
}
...
...
@@ -523,7 +526,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
current_mset_param
=
(
i
<<
16
)
+
3
;
if
(
mainGame
->
gameConf
.
ask_mset
)
{
wchar_t
wbuf
[
256
];
myswprintf
(
wbuf
,
dataManager
.
GetSysString
(
13
55
),
dataManager
.
GetName
(
clicked_card
->
code
));
myswprintf
(
wbuf
,
dataManager
.
GetSysString
(
13
68
),
dataManager
.
GetName
(
clicked_card
->
code
));
mainGame
->
stQMessage
->
setText
(
wbuf
);
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
}
else
{
...
...
gframe/network.h
View file @
45f65abc
...
...
@@ -194,6 +194,7 @@ public:
#define STOC_HS_PLAYER_ENTER 0x20
#define STOC_HS_PLAYER_CHANGE 0x21
#define STOC_HS_WATCH_CHANGE 0x22
#define STOC_TEAMMATE_SURRENDER 0x23
#define STOC_SRVPRO_ROOMLIST 0x31
#define PLAYERCHANGE_OBSERVE 0x8
...
...
gframe/replay.cpp
View file @
45f65abc
#include "replay.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h"
#include "lzma/LzmaLib.h"
#include "base64.h"
...
...
@@ -55,7 +53,7 @@ void Replay::WriteData(const void* data, int length, bool flush) {
return
;
if
(
length
<
0
||
(
pdata
-
replay_data
)
+
length
>
MAX_REPLAY_SIZE
)
return
;
memcpy
(
pdata
,
data
,
length
);
std
::
memcpy
(
pdata
,
data
,
length
);
pdata
+=
length
;
#ifdef _WIN32
DWORD
size
;
...
...
@@ -71,8 +69,7 @@ void Replay::WriteInt32(int data, bool flush) {
return
;
if
((
pdata
-
replay_data
)
+
4
>
MAX_REPLAY_SIZE
)
return
;
*
((
int
*
)(
pdata
))
=
data
;
pdata
+=
4
;
BufferIO
::
WriteInt32
(
pdata
,
data
);
#ifdef _WIN32
DWORD
size
;
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
int
),
&
size
,
NULL
);
...
...
@@ -87,8 +84,7 @@ void Replay::WriteInt16(short data, bool flush) {
return
;
if
((
pdata
-
replay_data
)
+
2
>
MAX_REPLAY_SIZE
)
return
;
*
((
short
*
)(
pdata
))
=
data
;
pdata
+=
2
;
BufferIO
::
WriteInt16
(
pdata
,
data
);
#ifdef _WIN32
DWORD
size
;
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
short
),
&
size
,
NULL
);
...
...
@@ -103,8 +99,7 @@ void Replay::WriteInt8(char data, bool flush) {
return
;
if
((
pdata
-
replay_data
)
+
1
>
MAX_REPLAY_SIZE
)
return
;
*
pdata
=
data
;
pdata
++
;
BufferIO
::
WriteInt8
(
pdata
,
data
);
#ifdef _WIN32
DWORD
size
;
WriteFile
(
recording_fp
,
&
data
,
sizeof
(
char
),
&
size
,
NULL
);
...
...
@@ -302,7 +297,7 @@ bool Replay::ReadNextResponse(unsigned char resp[]) {
int
len
=
*
pdata
++
;
if
(
len
>
SIZE_RETURN_VALUE
)
return
false
;
memcpy
(
resp
,
pdata
,
len
);
std
::
memcpy
(
resp
,
pdata
,
len
);
pdata
+=
len
;
return
true
;
}
...
...
@@ -316,27 +311,26 @@ void Replay::ReadName(wchar_t* data) {
void
Replay
::
ReadData
(
void
*
data
,
int
length
)
{
if
(
!
is_replaying
)
return
;
memcpy
(
data
,
pdata
,
length
);
std
::
memcpy
(
data
,
pdata
,
length
);
pdata
+=
length
;
}
int
Replay
::
ReadInt32
()
{
if
(
!
is_replaying
)
return
-
1
;
int
ret
=
*
((
int
*
)
pdata
);
pdata
+=
4
;
int
ret
=
BufferIO
::
ReadInt32
(
pdata
);
return
ret
;
}
short
Replay
::
ReadInt16
()
{
if
(
!
is_replaying
)
return
-
1
;
short
ret
=
*
((
short
*
)
pdata
);
pdata
+=
2
;
short
ret
=
BufferIO
::
ReadInt16
(
pdata
);
return
ret
;
}
char
Replay
::
ReadInt8
()
{
if
(
!
is_replaying
)
return
-
1
;
return
*
pdata
++
;
char
ret
=
BufferIO
::
ReadInt8
(
pdata
);
return
ret
;
}
void
Replay
::
Rewind
()
{
pdata
=
replay_data
;
...
...
gframe/tag_duel.cpp
View file @
45f65abc
...
...
@@ -11,6 +11,7 @@ TagDuel::TagDuel() {
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
players
[
i
]
=
0
;
ready
[
i
]
=
false
;
surrender
[
i
]
=
false
;
}
}
TagDuel
::~
TagDuel
()
{
...
...
@@ -526,10 +527,21 @@ void TagDuel::DuelEndProc() {
void
TagDuel
::
Surrender
(
DuelPlayer
*
dp
)
{
if
(
dp
->
type
>
3
||
!
pduel
)
return
;
uint32
player
=
dp
->
type
;
if
(
surrender
[
player
])
return
;
static
const
uint32
teammatemap
[]
=
{
1
,
0
,
3
,
2
};
uint32
teammate
=
teammatemap
[
player
];
if
(
!
surrender
[
teammate
])
{
surrender
[
player
]
=
true
;
NetServer
::
SendPacketToPlayer
(
players
[
player
],
STOC_TEAMMATE_SURRENDER
);
NetServer
::
SendPacketToPlayer
(
players
[
teammate
],
STOC_TEAMMATE_SURRENDER
);
return
;
}
static
const
uint32
winplayermap
[]
=
{
1
,
1
,
0
,
0
};
unsigned
char
wbuf
[
3
];
uint32
player
=
(
dp
->
type
<
2
)
?
0
:
1
;
wbuf
[
0
]
=
MSG_WIN
;
wbuf
[
1
]
=
1
-
player
;
wbuf
[
1
]
=
winplayermap
[
player
]
;
wbuf
[
2
]
=
0
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
wbuf
,
3
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -939,6 +951,9 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
}
turn_count
++
;
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
surrender
[
i
]
=
false
;
}
}
break
;
}
...
...
gframe/tag_duel.h
View file @
45f65abc
...
...
@@ -50,6 +50,7 @@ protected:
DuelPlayer
*
cur_player
[
2
];
std
::
set
<
DuelPlayer
*>
observers
;
bool
ready
[
4
];
bool
surrender
[
4
];
Deck
pdeck
[
4
];
int
deck_error
[
4
];
unsigned
char
hand_result
[
2
];
...
...
lflist.conf
View file @
45f65abc
This diff is collapsed.
Click to expand it.
ocgcore
@
7b4f8ec1
Subproject commit
5fe666ffe616a46010059560997f9525732c545
7
Subproject commit
7b4f8ec113d598de98598f651f3b542931f50d2
7
premake/gframe/ygopro.rc
View file @
45f65abc
...
...
@@ -16,8 +16,8 @@ VALUE "InternalName", "KoishiPro"
VALUE "LegalCopyright", "Copyright (C) 2023 Nanahira"
VALUE "OriginalFilename", "ygopro.exe"
VALUE "ProductName", "KoishiPro"
VALUE "FileVersion", "
Snowdream
"
VALUE "ProductVersion", "
Snowdream
"
VALUE "FileVersion", "
Natsukoi
"
VALUE "ProductVersion", "
Natsukoi
"
END
END
BLOCK "VarFileInfo"
...
...
script
@
bd4b306d
Subproject commit
59e5af144e6e35f842b1abb62bede801d5f5f005
Subproject commit
bd4b306d4594b5884a1f4b4f653526484c0ae4c4
strings.conf
View file @
45f65abc
...
...
@@ -407,7 +407,7 @@
!
system
1352
主要信息:
!
system
1353
播放起始于回合:
!
system
1354
开局默认显示所有时点
!
system
1355
是否确定盖放[%
ls
]?
!
system
1355
投降(
1
/
2
)
!
system
1356
此操作将放弃对当前卡组的修改,是否继续?
!
system
1357
不提示保留对卡组的修改
!
system
1358
键入关键字后自动进行搜索
...
...
@@ -420,6 +420,7 @@
!
system
1365
重命名失败,可能存在同名文件
!
system
1366
自动保存录像
!
system
1367
录像已自动保存为%
ls
.
yrp
!
system
1368
是否确定盖放[%
ls
]?
!
system
1369
提取卡组
!
system
1370
星数↑
!
system
1371
攻击↑
...
...
@@ -672,7 +673,7 @@
!
setname
0
x2
次世代 ジェネクス
!
setname
0
x1002
真次世代 レアル·ジェネクス
#!setname 0x2002 盟军·次世代 A・ジェネクス
#setname 0x3 N/A
!
setname
0
x3
魅惑的女王 魅惑の女王
!
setname
0
x4
亚马逊 アマゾネス
!
setname
0
x5
秘仪之力 アルカナフォース
!
setname
0
x6
暗黑界 暗黒界
...
...
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