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
wind2009
ygopro
Commits
682aaa29
Commit
682aaa29
authored
May 13, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into server-develop
parents
7122e0ab
f29450b9
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
308 additions
and
92 deletions
+308
-92
gframe/CGUITTFont.cpp
gframe/CGUITTFont.cpp
+19
-20
gframe/bufferio.h
gframe/bufferio.h
+9
-18
gframe/deck_con.cpp
gframe/deck_con.cpp
+1
-0
gframe/drawing.cpp
gframe/drawing.cpp
+38
-18
gframe/duelclient.cpp
gframe/duelclient.cpp
+5
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+11
-5
gframe/game.h
gframe/game.h
+1
-0
gframe/replay.cpp
gframe/replay.cpp
+10
-16
lflist.conf
lflist.conf
+213
-13
No files found.
gframe/CGUITTFont.cpp
View file @
682aaa29
...
...
@@ -527,29 +527,28 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
core
::
ustring
::
const_iterator
iter
(
utext
);
while
(
!
iter
.
atEnd
())
{
uchar32_t
currentChar
=
*
iter
;
bool
lineBreak
=
false
;
if
(
currentChar
==
L'\r'
)
{
// Mac or Windows breaks
lineBreak
=
true
;
if
(
*
(
iter
+
1
)
==
L'\n'
)
// Windows line breaks.
currentChar
=
*
(
++
iter
);
}
else
if
(
currentChar
==
L'\n'
)
{
// Unix breaks
lineBreak
=
true
;
}
if
(
lineBreak
)
{
previousChar
=
0
;
offset
.
Y
+=
supposed_line_height
;
//font_metrics.ascender / 64;
offset
.
X
=
position
.
UpperLeftCorner
.
X
;
if
(
hcenter
)
offset
.
X
+=
(
position
.
getWidth
()
-
textDimension
.
Width
)
>>
1
;
++
iter
;
continue
;
}
n
=
getGlyphIndexByChar
(
currentChar
);
bool
visible
=
(
Invisible
.
findFirst
(
currentChar
)
==
-
1
);
if
(
n
>
0
&&
visible
)
{
bool
lineBreak
=
false
;
if
(
currentChar
==
L'\r'
)
{
// Mac or Windows breaks
lineBreak
=
true
;
if
(
*
(
iter
+
1
)
==
(
uchar32_t
)
'\n'
)
// Windows line breaks.
currentChar
=
*
(
++
iter
);
}
else
if
(
currentChar
==
(
uchar32_t
)
'\n'
)
{
// Unix breaks
lineBreak
=
true
;
}
if
(
lineBreak
)
{
previousChar
=
0
;
offset
.
Y
+=
supposed_line_height
;
//font_metrics.ascender / 64;
offset
.
X
=
position
.
UpperLeftCorner
.
X
;
if
(
hcenter
)
offset
.
X
+=
(
position
.
getWidth
()
-
textDimension
.
Width
)
>>
1
;
++
iter
;
continue
;
}
// Calculate the glyph offset.
s32
offx
=
Glyphs
[
n
-
1
].
offset
.
X
;
s32
offy
=
(
font_metrics
.
ascender
/
64
)
-
Glyphs
[
n
-
1
].
offset
.
Y
;
...
...
gframe/bufferio.h
View file @
682aaa29
#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
short
ReadInt16
(
unsigned
char
*&
p
)
{
short
ret
=
*
(
short
*
)
p
;
p
+=
2
;
return
ret
;
return
buffer_read
<
int16_t
>
(
p
);
}
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/deck_con.cpp
View file @
682aaa29
...
...
@@ -94,6 +94,7 @@ void DeckBuilder::Terminate() {
mainGame
->
btnBigCardZoomIn
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomOut
->
setVisible
(
false
);
mainGame
->
btnBigCardClose
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
();
mainGame
->
PopupElement
(
mainGame
->
wMainMenu
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
wACMessage
->
setVisible
(
false
);
...
...
gframe/drawing.cpp
View file @
682aaa29
...
...
@@ -989,26 +989,40 @@ void Game::DrawSpec() {
showChat
=
false
;
hideChatTimer
--
;
}
int
chatRectY
=
0
;
for
(
int
i
=
0
;
i
<
8
;
++
i
)
{
static
unsigned
int
chatColor
[]
=
{
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xff8080ff
,
0xffff4040
,
0xffff4040
,
0xffff4040
,
0xff40ff40
,
0xff4040ff
,
0xff40ffff
,
0xffff40ff
,
0xffffff40
,
0xffffffff
,
0xff808080
,
0xff404040
};
if
(
chatTiming
[
i
])
{
chatTiming
[
i
]
--
;
if
(
mainGame
->
dInfo
.
isStarted
&&
i
>=
5
)
continue
;
if
(
!
showChat
&&
i
>
2
)
continue
;
int
w
=
guiFont
->
getDimension
(
chatMsg
[
i
].
c_str
()).
Width
;
if
(
!
is_building
)
{
if
(
dInfo
.
isStarted
&&
i
>=
5
)
continue
;
if
(
!
showChat
&&
i
>
2
)
continue
;
}
int
x
=
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
;
int
y
=
window_size
.
Height
-
25
;
int
maxwidth
=
705
*
xScale
;
if
(
is_building
)
{
x
=
810
*
xScale
;
maxwidth
=
205
*
xScale
;
}
std
::
wstring
msg
=
SetStaticText
(
nullptr
,
maxwidth
,
guiFont
,
chatMsg
[
i
].
c_str
());
int
w
=
guiFont
->
getDimension
(
msg
).
Width
;
int
h
=
guiFont
->
getDimension
(
msg
).
Height
+
2
;
recti
rectloc
(
mainGame
->
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
,
mainGame
->
window_size
.
Height
-
45
,
mainGame
->
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
+
2
+
w
,
mainGame
->
window_size
.
Height
-
25
);
rectloc
-=
position2di
(
0
,
i
*
20
);
recti
msgloc
(
mainGame
->
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
,
mainGame
->
window_size
.
Height
-
45
,
mainGame
->
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
-
4
,
mainGame
->
window_size
.
Height
-
25
);
msgloc
-=
position2di
(
0
,
i
*
20
);
recti
rectloc
(
x
,
y
-
chatRectY
-
h
,
x
+
2
+
w
,
y
-
chatRectY
);
recti
msgloc
(
x
,
y
-
chatRectY
-
h
,
x
-
4
,
y
-
chatRectY
);
recti
shadowloc
=
msgloc
+
position2di
(
1
,
1
);
driver
->
draw2DRectangle
(
rectloc
,
0xa0000000
,
0xa0000000
,
0xa0000000
,
0xa0000000
);
guiFont
->
draw
(
chatMsg
[
i
].
c_str
(),
msgloc
,
0xff000000
,
false
,
false
);
guiFont
->
draw
(
chatMsg
[
i
].
c_str
(),
shadowloc
,
chatColor
[
chatType
[
i
]],
false
,
false
);
guiFont
->
draw
(
msg
.
c_str
(),
msgloc
,
0xff000000
,
false
,
false
);
guiFont
->
draw
(
msg
.
c_str
(),
shadowloc
,
chatColor
[
chatType
[
i
]],
false
,
false
);
chatRectY
+=
h
;
}
}
}
...
...
@@ -1235,13 +1249,19 @@ void Game::DrawDeckBd() {
driver
->
draw2DRectangleOutline
(
Resize
(
313
+
i
*
dx
,
563
,
359
+
i
*
dx
,
629
));
}
}
//search result
driver
->
draw2DRectangle
(
Resize
(
805
,
137
,
926
,
157
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
136
,
926
,
157
));
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1333
),
Resize
(
810
,
137
,
915
,
157
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
deckBuilder
.
result_string
,
Resize
(
875
,
137
,
935
,
157
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
driver
->
draw2DRectangle
(
Resize
(
805
,
160
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
159
,
1020
,
630
));
if
(
is_siding
)
{
// side chat background
driver
->
draw2DRectangle
(
Resize
(
805
,
10
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
9
,
1020
,
630
));
}
else
{
//search result
driver
->
draw2DRectangle
(
Resize
(
805
,
137
,
926
,
157
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
136
,
926
,
157
));
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1333
),
Resize
(
810
,
137
,
915
,
157
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
deckBuilder
.
result_string
,
Resize
(
875
,
137
,
935
,
157
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
driver
->
draw2DRectangle
(
Resize
(
805
,
160
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
159
,
1020
,
630
));
}
for
(
size_t
i
=
0
;
i
<
9
&&
i
+
scrFilter
->
getPos
()
<
deckBuilder
.
results
.
size
();
++
i
)
{
code_pointer
ptr
=
deckBuilder
.
results
[
i
+
scrFilter
->
getPos
()];
if
(
i
>=
7
)
...
...
gframe/duelclient.cpp
View file @
682aaa29
...
...
@@ -213,6 +213,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
is_building
=
false
;
mainGame
->
ResizeChatInputWindow
();
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
...
...
@@ -377,7 +378,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
is_building
=
true
;
mainGame
->
is_siding
=
true
;
mainGame
->
CloseGameWindow
();
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
(
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
...
...
@@ -493,6 +494,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ResizeChatInputWindow
();
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
gMutex
.
unlock
();
...
...
@@ -604,6 +606,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
();
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
mainGame
->
wChat
->
setVisible
(
true
);
if
(
mainGame
->
chkDefaultShowChain
->
isChecked
())
{
...
...
@@ -676,6 +679,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
();
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
...
...
gframe/event_handler.cpp
View file @
682aaa29
...
...
@@ -1904,7 +1904,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break
;
}
case
CHECKBOX_DISABLE_CHAT
:
{
bool
show
=
mainGame
->
is_building
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
bool
show
=
(
mainGame
->
is_building
&&
!
mainGame
->
is_siding
)
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
mainGame
->
wChat
->
setVisible
(
show
);
if
(
!
show
)
mainGame
->
ClearChatMsg
();
...
...
gframe/game.cpp
View file @
682aaa29
...
...
@@ -743,7 +743,7 @@ bool Game::Initialize() {
btnShuffleDeck
=
env
->
addButton
(
rect
<
s32
>
(
5
,
99
,
55
,
120
),
wDeckEdit
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
btnSortDeck
=
env
->
addButton
(
rect
<
s32
>
(
60
,
99
,
110
,
120
),
wDeckEdit
,
BUTTON_SORT_DECK
,
dataManager
.
GetSysString
(
1305
));
btnClearDeck
=
env
->
addButton
(
rect
<
s32
>
(
115
,
99
,
165
,
120
),
wDeckEdit
,
BUTTON_CLEAR_DECK
,
dataManager
.
GetSysString
(
1304
));
btnSideOK
=
env
->
addButton
(
rect
<
s32
>
(
510
,
40
,
82
0
,
80
),
0
,
BUTTON_SIDE_OK
,
dataManager
.
GetSysString
(
1334
));
btnSideOK
=
env
->
addButton
(
rect
<
s32
>
(
400
,
40
,
71
0
,
80
),
0
,
BUTTON_SIDE_OK
,
dataManager
.
GetSysString
(
1334
));
btnSideOK
->
setVisible
(
false
);
btnSideShuffle
=
env
->
addButton
(
rect
<
s32
>
(
310
,
100
,
370
,
130
),
0
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
btnSideShuffle
->
setVisible
(
false
);
...
...
@@ -1175,7 +1175,7 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth,
strBuffer
[
pbuffer
++
]
=
c
;
}
strBuffer
[
pbuffer
]
=
0
;
pControl
->
setText
(
strBuffer
);
if
(
pControl
)
pControl
->
setText
(
strBuffer
);
ret
.
assign
(
strBuffer
);
return
ret
;
}
...
...
@@ -1859,6 +1859,7 @@ void Game::CloseDuelWindow() {
lstHostList
->
clear
();
DuelClient
::
hosts
.
clear
();
ClearTextures
();
ResizeChatInputWindow
();
closeDoneSignal
.
Set
();
}
int
Game
::
LocalPlayer
(
int
player
)
const
{
...
...
@@ -1983,7 +1984,7 @@ void Game::OnResize() {
stStar
->
setRelativePosition
(
Resize
(
10
,
62
+
100
/
6
,
70
,
82
+
100
/
6
));
stSearch
->
setRelativePosition
(
Resize
(
205
,
62
+
100
/
6
,
280
,
82
+
100
/
6
));
stScale
->
setRelativePosition
(
Resize
(
105
,
62
+
100
/
6
,
165
,
82
+
100
/
6
));
btnSideOK
->
setRelativePosition
(
Resize
(
510
,
40
,
82
0
,
80
));
btnSideOK
->
setRelativePosition
(
Resize
(
400
,
40
,
71
0
,
80
));
btnSideShuffle
->
setRelativePosition
(
Resize
(
310
,
100
,
370
,
130
));
btnSideSort
->
setRelativePosition
(
Resize
(
375
,
100
,
435
,
130
));
btnSideReload
->
setRelativePosition
(
Resize
(
440
,
100
,
500
,
130
));
...
...
@@ -2074,8 +2075,7 @@ void Game::OnResize() {
btnM2
->
setRelativePosition
(
Resize
(
160
,
0
,
210
,
20
));
btnEP
->
setRelativePosition
(
Resize
(
320
,
0
,
370
,
20
));
wChat
->
setRelativePosition
(
recti
(
wInfos
->
getRelativePosition
().
LowerRightCorner
.
X
+
6
,
window_size
.
Height
-
25
,
window_size
.
Width
,
window_size
.
Height
));
ebChatInput
->
setRelativePosition
(
recti
(
3
,
2
,
window_size
.
Width
-
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
-
6
,
22
));
ResizeChatInputWindow
();
btnLeaveGame
->
setRelativePosition
(
Resize
(
205
,
5
,
295
,
80
));
wReplayControl
->
setRelativePosition
(
Resize
(
205
,
143
,
295
,
273
));
...
...
@@ -2098,6 +2098,12 @@ void Game::OnResize() {
btnBigCardZoomOut
->
setRelativePosition
(
Resize
(
205
,
180
,
295
,
215
));
btnBigCardClose
->
setRelativePosition
(
Resize
(
205
,
230
,
295
,
265
));
}
void
Game
::
ResizeChatInputWindow
()
{
s32
x
=
wInfos
->
getRelativePosition
().
LowerRightCorner
.
X
+
6
;
if
(
is_building
)
x
=
802
*
xScale
;
wChat
->
setRelativePosition
(
recti
(
x
,
window_size
.
Height
-
25
,
window_size
.
Width
,
window_size
.
Height
));
ebChatInput
->
setRelativePosition
(
recti
(
3
,
2
,
window_size
.
Width
-
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
-
6
,
22
));
}
recti
Game
::
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
x
=
x
*
xScale
;
y
=
y
*
yScale
;
...
...
gframe/game.h
View file @
682aaa29
...
...
@@ -196,6 +196,7 @@ public:
}
void
OnResize
();
void
ResizeChatInputWindow
();
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
dx
,
s32
dy
,
s32
dx2
,
s32
dy2
);
position2di
Resize
(
s32
x
,
s32
y
);
...
...
gframe/replay.cpp
View file @
682aaa29
#include "replay.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h"
#include "lzma/LzmaLib.h"
namespace
ygo
{
...
...
@@ -87,7 +85,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 YGOPRO_SERVER_MODE
if
(
!
(
replay_mode
&
REPLAY_MODE_SAVE_IN_SERVER
))
return
;
...
...
@@ -106,8 +104,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 YGOPRO_SERVER_MODE
if
(
!
(
replay_mode
&
REPLAY_MODE_SAVE_IN_SERVER
))
return
;
#endif
...
...
@@ -125,8 +122,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 YGOPRO_SERVER_MODE
if
(
!
(
replay_mode
&
REPLAY_MODE_SAVE_IN_SERVER
))
return
;
#endif
...
...
@@ -144,8 +140,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 YGOPRO_SERVER_MODE
if
(
!
(
replay_mode
&
REPLAY_MODE_SAVE_IN_SERVER
))
return
;
#endif
...
...
@@ -320,7 +315,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
;
}
...
...
@@ -334,27 +329,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
;
...
...
lflist.conf
View file @
682aaa29
This diff is collapsed.
Click to expand it.
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