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
a284ed8e
Commit
a284ed8e
authored
May 06, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/fallenstardust/YGOMobile-cn-ko-en
parents
6a5598dd
1bee0fe7
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
29 deletions
+59
-29
Classes/gframe/config.h
Classes/gframe/config.h
+15
-0
Classes/gframe/data_manager.cpp
Classes/gframe/data_manager.cpp
+2
-4
Classes/gframe/deck_manager.cpp
Classes/gframe/deck_manager.cpp
+2
-5
Classes/gframe/myfilesystem.h
Classes/gframe/myfilesystem.h
+20
-2
Classes/gframe/network.h
Classes/gframe/network.h
+1
-1
Classes/gframe/replay.cpp
Classes/gframe/replay.cpp
+2
-10
Classes/gframe/replay.h
Classes/gframe/replay.h
+7
-7
mobile/src/main/java/cn/garymb/ygomobile/ui/plus/DefWebViewClient.java
...in/java/cn/garymb/ygomobile/ui/plus/DefWebViewClient.java
+10
-0
No files found.
Classes/gframe/config.h
View file @
a284ed8e
...
...
@@ -69,6 +69,21 @@ inline FILE* mywfopen(const wchar_t* filename, const char* mode) {
return
fp
;
}
#if !defined(_WIN32)
#define myfopen std::fopen
#elif defined(WDK_NTDDI_VERSION) && (WDK_NTDDI_VERSION >= 0x0A000005) // Redstone 4, Version 1803, Build 17134.
#define FOPEN_WINDOWS_SUPPORT_UTF8
#define myfopen std::fopen
#else
inline
FILE
*
myfopen
(
const
char
*
filename
,
const
char
*
mode
)
{
wchar_t
wfilename
[
256
]{};
BufferIO
::
DecodeUTF8
(
filename
,
wfilename
);
wchar_t
wmode
[
20
]{};
BufferIO
::
CopyCharArray
(
mode
,
wmode
);
return
_wfopen
(
wfilename
,
wmode
);
}
#endif
#include <irrlicht.h>
using
namespace
irr
::
io
;
using
namespace
irr
::
os
;
...
...
Classes/gframe/data_manager.cpp
View file @
a284ed8e
...
...
@@ -104,7 +104,7 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
return
ret
;
}
bool
DataManager
::
LoadStrings
(
const
char
*
file
)
{
FILE
*
fp
=
std
::
fopen
(
file
,
"r"
);
FILE
*
fp
=
my
fopen
(
file
,
"r"
);
if
(
!
fp
)
return
false
;
char
linebuf
[
TEXT_LINE_SIZE
]{};
...
...
@@ -422,9 +422,7 @@ unsigned char* DataManager::ReadScriptFromIrrFS(const char* script_name, int* sl
return
scriptBuffer
;
}
unsigned
char
*
DataManager
::
ReadScriptFromFile
(
const
char
*
script_name
,
int
*
slen
)
{
wchar_t
fname
[
256
]{};
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
FILE
*
fp
=
mywfopen
(
fname
,
"rb"
);
FILE
*
fp
=
myfopen
(
script_name
,
"rb"
);
if
(
!
fp
)
return
nullptr
;
size_t
len
=
std
::
fread
(
scriptBuffer
,
1
,
sizeof
scriptBuffer
,
fp
);
...
...
Classes/gframe/deck_manager.cpp
View file @
a284ed8e
...
...
@@ -10,7 +10,7 @@ DeckManager deckManager;
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
auto
cur
=
_lfList
.
rend
();
FILE
*
fp
=
std
::
fopen
(
path
,
"r"
);
FILE
*
fp
=
my
fopen
(
path
,
"r"
);
char
linebuf
[
256
]{};
wchar_t
strBuffer
[
256
]{};
char
str1
[
16
]{};
...
...
@@ -340,10 +340,7 @@ bool DeckManager::SaveDeck(Deck& deck, const wchar_t* file) {
return
true
;
}
bool
DeckManager
::
DeleteDeck
(
const
wchar_t
*
file
)
{
char
filefn
[
256
];
BufferIO
::
EncodeUTF8
(
file
,
filefn
);
int
result
=
unlink
(
filefn
);
return
result
==
0
;
return
FileSystem
::
RemoveFile
(
file
);
}
bool
DeckManager
::
CreateCategory
(
const
wchar_t
*
name
)
{
if
(
!
FileSystem
::
IsDirExists
(
L"./deck"
)
&&
!
FileSystem
::
MakeDir
(
L"./deck"
))
...
...
Classes/gframe/myfilesystem.h
View file @
a284ed8e
...
...
@@ -86,6 +86,14 @@ public:
return
DeleteDir
(
wdir
);
}
static
bool
RemoveFile
(
const
wchar_t
*
wfile
)
{
return
DeleteFileW
(
wfile
);
}
static
bool
RemoveFile
(
const
char
*
file
)
{
return
DeleteFileA
(
file
);
}
static
void
TraversalDir
(
const
wchar_t
*
wpath
,
const
std
::
function
<
void
(
const
wchar_t
*
,
bool
)
>&
cb
)
{
wchar_t
findstr
[
1024
];
std
::
swprintf
(
findstr
,
sizeof
findstr
/
sizeof
findstr
[
0
],
L"%ls/*"
,
wpath
);
...
...
@@ -94,7 +102,7 @@ public:
if
(
fh
==
INVALID_HANDLE_VALUE
)
return
;
do
{
if
(
mywcsncasecmp
(
fdataw
.
cFileName
,
L"."
,
1
)
&&
mywcsncasecmp
(
fdataw
.
cFileName
,
L".."
,
2
))
if
(
std
::
wcscmp
(
fdataw
.
cFileName
,
L"."
)
&&
std
::
wcscmp
(
fdataw
.
cFileName
,
L".."
))
cb
(
fdataw
.
cFileName
,
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
));
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
...
...
@@ -195,6 +203,16 @@ public:
return
success
;
}
static
bool
RemoveFile
(
const
wchar_t
*
wfile
)
{
char
file
[
1024
];
BufferIO
::
EncodeUTF8
(
wfile
,
file
);
return
RemoveFile
(
file
);
}
static
bool
RemoveFile
(
const
char
*
file
)
{
return
unlink
(
file
)
==
0
;
}
struct
file_unit
{
std
::
string
filename
;
bool
is_dir
;
...
...
@@ -216,7 +234,7 @@ public:
stat
(
fname
,
&
fileStat
);
funit
.
filename
=
std
::
string
(
dirp
->
d_name
);
funit
.
is_dir
=
S_ISDIR
(
fileStat
.
st_mode
);
if
(
funit
.
is_dir
&&
(
st
rcmp
(
dirp
->
d_name
,
"."
)
==
0
||
strcmp
(
dirp
->
d_name
,
".."
)
==
0
))
if
(
funit
.
is_dir
&&
(
st
d
::
strcmp
(
dirp
->
d_name
,
"."
)
==
0
||
std
::
strcmp
(
dirp
->
d_name
,
".."
)
==
0
))
continue
;
file_list
.
push_back
(
funit
);
}
...
...
Classes/gframe/network.h
View file @
a284ed8e
...
...
@@ -27,7 +27,7 @@ struct HostInfo {
uint8_t
no_shuffle_deck
{};
// byte padding[3]
u
int32_t
start_lp
{};
int32_t
start_lp
{};
uint8_t
start_hand
{};
uint8_t
draw_count
{};
uint16_t
time_limit
{};
...
...
Classes/gframe/replay.cpp
View file @
a284ed8e
...
...
@@ -24,7 +24,7 @@ void Replay::BeginRecord() {
#else
if
(
is_recording
)
std
::
fclose
(
fp
);
fp
=
std
::
fopen
(
"./replay/_LastReplay.yrp"
,
"wb"
);
fp
=
my
fopen
(
"./replay/_LastReplay.yrp"
,
"wb"
);
if
(
!
fp
)
return
;
#endif
...
...
@@ -154,15 +154,7 @@ bool Replay::CheckReplay(const wchar_t* name) {
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
#ifdef _WIN32
BOOL
result
=
DeleteFileW
(
fname
);
return
!!
result
;
#else
char
filefn
[
256
];
BufferIO
::
EncodeUTF8
(
fname
,
filefn
);
int
result
=
unlink
(
filefn
);
return
result
==
0
;
#endif
return
FileSystem
::
RemoveFile
(
fname
);
}
bool
Replay
::
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
)
{
wchar_t
oldfname
[
256
];
...
...
Classes/gframe/replay.h
View file @
a284ed8e
...
...
@@ -17,13 +17,13 @@ constexpr int MAX_REPLAY_SIZE = 0x20000;
constexpr
int
MAX_COMP_SIZE
=
UINT16_MAX
+
1
;
struct
ReplayHeader
{
u
nsigned
in
t
id
{};
u
nsigned
in
t
version
{};
u
nsigned
in
t
flag
{};
u
nsigned
in
t
seed
{};
u
nsigned
in
t
datasize
{};
u
nsigned
in
t
start_time
{};
u
nsigned
char
props
[
8
]{};
u
int32_
t
id
{};
u
int32_
t
version
{};
u
int32_
t
flag
{};
u
int32_
t
seed
{};
u
int32_
t
datasize
{};
u
int32_
t
start_time
{};
u
int8_t
props
[
8
]{};
};
class
Replay
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/plus/DefWebViewClient.java
View file @
a284ed8e
package
cn.garymb.ygomobile.ui.plus
;
import
android.content.Intent
;
import
android.net.Uri
;
import
com.ourygo.lib.duelassistant.util.DARecord
;
import
com.ourygo.lib.duelassistant.util.DuelAssistantManagement
;
import
com.tencent.smtt.sdk.WebView
;
...
...
@@ -26,6 +29,13 @@ public class DefWebViewClient extends WebViewClient {
DuelAssistantManagement
.
getInstance
().
deckCheck
(
url
,
daCheckId
);
return
true
;
}
if
(!
url
.
startsWith
(
"http://"
)
&&
!
url
.
startsWith
(
"https://"
))
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
);
intent
.
setData
(
Uri
.
parse
(
url
));
view
.
getContext
().
startActivity
(
intent
);
return
true
;
}
return
false
;
}
}
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