Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
475e85bf
Commit
475e85bf
authored
Dec 08, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update gframe
parent
914fd2a8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
21 deletions
+21
-21
Classes/gframe/data_manager.cpp
Classes/gframe/data_manager.cpp
+6
-5
Classes/gframe/data_manager.h
Classes/gframe/data_manager.h
+4
-4
Classes/gframe/duelclient.cpp
Classes/gframe/duelclient.cpp
+2
-2
Classes/gframe/duelclient.h
Classes/gframe/duelclient.h
+7
-8
Classes/gframe/single_duel.h
Classes/gframe/single_duel.h
+1
-1
Classes/gframe/single_mode.h
Classes/gframe/single_mode.h
+1
-1
No files found.
Classes/gframe/data_manager.cpp
View file @
475e85bf
...
@@ -68,7 +68,8 @@ bool DataManager::ReadDB(sqlite3* pDB) {
...
@@ -68,7 +68,8 @@ bool DataManager::ReadDB(sqlite3* pDB) {
BufferIO
::
DecodeUTF8
(
text
,
strBuffer
);
BufferIO
::
DecodeUTF8
(
text
,
strBuffer
);
cs
.
text
=
strBuffer
;
cs
.
text
=
strBuffer
;
}
}
for
(
int
i
=
0
;
i
<
16
;
++
i
)
{
constexpr
int
desc_count
=
sizeof
cs
.
desc
/
sizeof
cs
.
desc
[
0
];
for
(
int
i
=
0
;
i
<
desc_count
;
++
i
)
{
if
(
const
char
*
text
=
(
const
char
*
)
sqlite3_column_text
(
pStmt
,
i
+
14
))
{
if
(
const
char
*
text
=
(
const
char
*
)
sqlite3_column_text
(
pStmt
,
i
+
14
))
{
BufferIO
::
DecodeUTF8
(
text
,
strBuffer
);
BufferIO
::
DecodeUTF8
(
text
,
strBuffer
);
cs
.
desc
[
i
]
=
strBuffer
;
cs
.
desc
[
i
]
=
strBuffer
;
...
@@ -174,16 +175,16 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
...
@@ -174,16 +175,16 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
return
_strings
.
find
(
code
);
}
}
code_pointer
DataManager
::
datas_begin
()
{
code_pointer
DataManager
::
datas_begin
()
const
{
return
_datas
.
cbegin
();
return
_datas
.
cbegin
();
}
}
code_pointer
DataManager
::
datas_end
()
{
code_pointer
DataManager
::
datas_end
()
const
{
return
_datas
.
cend
();
return
_datas
.
cend
();
}
}
string_pointer
DataManager
::
strings_begin
()
{
string_pointer
DataManager
::
strings_begin
()
const
{
return
_strings
.
cbegin
();
return
_strings
.
cbegin
();
}
}
string_pointer
DataManager
::
strings_end
()
{
string_pointer
DataManager
::
strings_end
()
const
{
return
_strings
.
cend
();
return
_strings
.
cend
();
}
}
bool
DataManager
::
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
{
bool
DataManager
::
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
{
...
...
Classes/gframe/data_manager.h
View file @
475e85bf
...
@@ -22,10 +22,10 @@ public:
...
@@ -22,10 +22,10 @@ public:
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
code_pointer
datas_begin
();
code_pointer
datas_begin
()
const
;
code_pointer
datas_end
();
code_pointer
datas_end
()
const
;
string_pointer
strings_begin
();
string_pointer
strings_begin
()
const
;
string_pointer
strings_end
();
string_pointer
strings_end
()
const
;
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
;
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
;
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
;
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
;
const
wchar_t
*
GetName
(
unsigned
int
code
)
const
;
const
wchar_t
*
GetName
(
unsigned
int
code
)
const
;
...
...
Classes/gframe/duelclient.cpp
View file @
475e85bf
...
@@ -120,9 +120,9 @@ void DuelClient::ClientRead(bufferevent* bev, void* ctx) {
...
@@ -120,9 +120,9 @@ void DuelClient::ClientRead(bufferevent* bev, void* ctx) {
}
}
delete
[]
duel_client_read
;
delete
[]
duel_client_read
;
}
}
void
DuelClient
::
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
)
{
void
DuelClient
::
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
)
{
if
(
events
&
BEV_EVENT_CONNECTED
)
{
if
(
events
&
BEV_EVENT_CONNECTED
)
{
bool
create_game
=
(
size_t
)
ctx
!=
0
;
bool
create_game
=
(
intptr_t
)
ctx
;
CTOS_PlayerInfo
cspi
;
CTOS_PlayerInfo
cspi
;
BufferIO
::
CopyCharArray
(
mainGame
->
ebNickName
->
getText
(),
cspi
.
name
);
BufferIO
::
CopyCharArray
(
mainGame
->
ebNickName
->
getText
(),
cspi
.
name
);
SendPacketToServer
(
CTOS_PLAYER_INFO
,
cspi
);
SendPacketToServer
(
CTOS_PLAYER_INFO
,
cspi
);
...
...
Classes/gframe/duelclient.h
View file @
475e85bf
...
@@ -31,13 +31,18 @@ private:
...
@@ -31,13 +31,18 @@ private:
static
unsigned
int
last_successful_msg_length
;
static
unsigned
int
last_successful_msg_length
;
static
wchar_t
event_string
[
256
];
static
wchar_t
event_string
[
256
];
static
mt19937
rnd
;
static
mt19937
rnd
;
static
bool
is_refreshing
;
static
int
match_kill
;
static
event
*
resp_event
;
static
std
::
set
<
std
::
pair
<
unsigned
int
,
unsigned
short
>>
remotes
;
public:
public:
static
unsigned
char
selftype
;
static
unsigned
char
selftype
;
static
bool
StartClient
(
unsigned
int
ip
,
unsigned
short
port
,
bool
create_game
=
true
);
static
bool
StartClient
(
unsigned
int
ip
,
unsigned
short
port
,
bool
create_game
=
true
);
static
void
ConnectTimeout
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
ConnectTimeout
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
StopClient
(
bool
is_exiting
=
false
);
static
void
StopClient
(
bool
is_exiting
=
false
);
static
void
ClientRead
(
bufferevent
*
bev
,
void
*
ctx
);
static
void
ClientRead
(
bufferevent
*
bev
,
void
*
ctx
);
static
void
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
);
static
void
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
);
static
int
ClientThread
();
static
int
ClientThread
();
static
void
HandleSTOCPacketLan
(
unsigned
char
*
data
,
int
len
);
static
void
HandleSTOCPacketLan
(
unsigned
char
*
data
,
int
len
);
static
int
ClientAnalyze
(
unsigned
char
*
msg
,
unsigned
int
len
);
static
int
ClientAnalyze
(
unsigned
char
*
msg
,
unsigned
int
len
);
...
@@ -74,12 +79,6 @@ public:
...
@@ -74,12 +79,6 @@ public:
bufferevent_write
(
client_bev
,
duel_client_write
,
blen
+
3
);
bufferevent_write
(
client_bev
,
duel_client_write
,
blen
+
3
);
}
}
protected:
static
bool
is_refreshing
;
static
int
match_kill
;
static
event
*
resp_event
;
static
std
::
set
<
std
::
pair
<
unsigned
int
,
unsigned
short
>>
remotes
;
public:
static
std
::
vector
<
HostPacket
>
hosts
;
static
std
::
vector
<
HostPacket
>
hosts
;
static
void
BeginRefreshHost
();
static
void
BeginRefreshHost
();
static
int
RefreshThread
(
event_base
*
broadev
);
static
int
RefreshThread
(
event_base
*
broadev
);
...
...
Classes/gframe/single_duel.h
View file @
475e85bf
...
@@ -38,7 +38,7 @@ public:
...
@@ -38,7 +38,7 @@ public:
void
RefreshExtra
(
int
player
,
int
flag
=
0xe81fff
,
int
use_cache
=
1
);
void
RefreshExtra
(
int
player
,
int
flag
=
0xe81fff
,
int
use_cache
=
1
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
uint32
MessageHandler
(
intptr_t
fduel
,
uint32
type
);
static
uint32
_t
MessageHandler
(
intptr_t
fduel
,
uint32_t
type
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
private:
private:
...
...
Classes/gframe/single_mode.h
View file @
475e85bf
...
@@ -30,7 +30,7 @@ public:
...
@@ -30,7 +30,7 @@ public:
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
SinglePlayReload
();
static
void
SinglePlayReload
();
static
uint32
MessageHandler
(
intptr_t
fduel
,
uint32
type
);
static
uint32
_t
MessageHandler
(
intptr_t
fduel
,
uint32_t
type
);
protected:
protected:
static
Replay
last_replay
;
static
Replay
last_replay
;
...
...
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