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
dc5e8e37
Commit
dc5e8e37
authored
Nov 19, 2025
by
fallenstardust
Committed by
GitHub
Nov 19, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #204 from jwyxym/master
补充userId
parents
18d1e3bd
a0428127
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
8 deletions
+39
-8
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
+9
-1
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
+6
-1
mobile/src/main/java/cn/garymb/ygomobile/loader/DeckLoader.java
.../src/main/java/cn/garymb/ygomobile/loader/DeckLoader.java
+8
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
.../java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
+8
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItemUtils.java
...java/cn/garymb/ygomobile/ui/cards/deck/DeckItemUtils.java
+6
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckUtils.java
...ain/java/cn/garymb/ygomobile/ui/cards/deck/DeckUtils.java
+2
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
View file @
dc5e8e37
...
@@ -48,6 +48,10 @@ public class Deck implements Parcelable {
...
@@ -48,6 +48,10 @@ public class Deck implements Parcelable {
* 卡组广场用的卡组id,可以为空
* 卡组广场用的卡组id,可以为空
*/
*/
public
String
deckId
=
null
;
public
String
deckId
=
null
;
/**
* 卡组广场用的用户id,可以为空
*/
public
String
userId
=
null
;
public
Deck
()
{
public
Deck
()
{
mainlist
=
new
ArrayList
<>();
mainlist
=
new
ArrayList
<>();
...
@@ -195,7 +199,11 @@ public class Deck implements Parcelable {
...
@@ -195,7 +199,11 @@ public class Deck implements Parcelable {
dest
.
writeList
(
this
.
sideList
);
dest
.
writeList
(
this
.
sideList
);
}
}
public
void
setId
(
String
id
)
{
public
void
set
Deck
Id
(
String
id
)
{
deckId
=
id
;
deckId
=
id
;
}
}
public
void
setUserId
(
String
id
)
{
userId
=
id
;
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
View file @
dc5e8e37
...
@@ -30,6 +30,7 @@ public class DeckInfo {
...
@@ -30,6 +30,7 @@ public class DeckInfo {
private
int
mainCount
,
extraCount
,
sideCount
;
private
int
mainCount
,
extraCount
,
sideCount
;
public
String
deckId
=
null
;
//当前的卡组id(卡组广场)
public
String
deckId
=
null
;
//当前的卡组id(卡组广场)
public
String
userId
=
null
;
//当前的用户id(卡组广场)
public
DeckInfo
()
{
public
DeckInfo
()
{
mainCards
=
new
ArrayList
<>();
mainCards
=
new
ArrayList
<>();
...
@@ -356,7 +357,11 @@ public class DeckInfo {
...
@@ -356,7 +357,11 @@ public class DeckInfo {
return
allCards
;
return
allCards
;
}
}
public
void
setId
(
String
id
)
{
public
void
set
Deck
Id
(
String
id
)
{
deckId
=
id
;
deckId
=
id
;
}
}
public
void
setUserId
(
String
id
)
{
userId
=
id
;
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/loader/DeckLoader.java
View file @
dc5e8e37
...
@@ -70,10 +70,14 @@ public class DeckLoader {
...
@@ -70,10 +70,14 @@ public class DeckLoader {
type
=
DeckItemType
.
MainCard
;
type
=
DeckItemType
.
MainCard
;
}
else
if
(
line
.
startsWith
(
"#extra"
))
{
}
else
if
(
line
.
startsWith
(
"#extra"
))
{
type
=
DeckItemType
.
ExtraCard
;
type
=
DeckItemType
.
ExtraCard
;
}
else
if
(
line
.
startsWith
(
"###"
))
{
line
=
line
.
trim
().
substring
(
3
);
if
(
line
.
length
()
>
0
)
deck
.
setUserId
(
line
);
}
else
if
(
line
.
startsWith
(
"##"
))
{
}
else
if
(
line
.
startsWith
(
"##"
))
{
line
=
line
.
trim
().
substring
(
2
);
line
=
line
.
trim
().
substring
(
2
);
if
(
line
.
length
()
>
0
)
if
(
line
.
length
()
>
0
)
deck
.
setId
(
line
);
deck
.
set
Deck
Id
(
line
);
}
else
{
}
else
{
type
=
DeckItemType
.
Pack
;
type
=
DeckItemType
.
Pack
;
}
}
...
@@ -137,7 +141,9 @@ public class DeckLoader {
...
@@ -137,7 +141,9 @@ public class DeckLoader {
int
code
;
int
code
;
isChanged
=
false
;
isChanged
=
false
;
if
(
deck
.
deckId
!=
null
)
if
(
deck
.
deckId
!=
null
)
deckInfo
.
setId
(
deck
.
deckId
);
deckInfo
.
setDeckId
(
deck
.
deckId
);
if
(
deck
.
userId
!=
null
)
deckInfo
.
setUserId
(
deck
.
userId
);
for
(
Integer
id
:
deck
.
getMainlist
())
{
for
(
Integer
id
:
deck
.
getMainlist
())
{
if
(
tmp
.
get
(
id
)
!=
null
)
{
if
(
tmp
.
get
(
id
)
!=
null
)
{
if
(
released_code_list
.
contains
(
tmp
.
get
(
id
).
getCode
()))
{
//先查看id对应的卡片密码是否在正式数组中存在
if
(
released_code_list
.
contains
(
tmp
.
get
(
id
).
getCode
()))
{
//先查看id对应的卡片密码是否在正式数组中存在
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
View file @
dc5e8e37
...
@@ -69,6 +69,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
...
@@ -69,6 +69,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
private
String
mDeckMd5
;
private
String
mDeckMd5
;
private
DeckInfo
mDeckInfo
;
private
DeckInfo
mDeckInfo
;
private
String
deckId
=
null
;
private
String
deckId
=
null
;
private
String
userId
=
null
;
public
DeckAdapater
(
Context
context
,
RecyclerView
recyclerView
,
ImageLoader
imageLoader
)
{
public
DeckAdapater
(
Context
context
,
RecyclerView
recyclerView
,
ImageLoader
imageLoader
)
{
this
.
context
=
context
;
this
.
context
=
context
;
...
@@ -450,7 +451,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
...
@@ -450,7 +451,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
public
boolean
save
(
File
file
,
boolean
withoutId
)
{
public
boolean
save
(
File
file
,
boolean
withoutId
)
{
//保存了,记录状态
//保存了,记录状态
mDeckMd5
=
DeckItemUtils
.
makeMd5
(
mItems
);
mDeckMd5
=
DeckItemUtils
.
makeMd5
(
mItems
);
return
DeckItemUtils
.
save
(
mItems
,
withoutId
?
null
:
deckId
,
file
);
return
DeckItemUtils
.
save
(
mItems
,
withoutId
?
null
:
deckId
,
withoutId
?
null
:
userId
,
file
);
}
}
public
Deck
toDeck
(
File
file
)
{
public
Deck
toDeck
(
File
file
)
{
...
@@ -463,6 +464,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
...
@@ -463,6 +464,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
private
void
loadData
(
DeckInfo
deckInfo
,
boolean
isPack
)
{
private
void
loadData
(
DeckInfo
deckInfo
,
boolean
isPack
)
{
deckId
=
null
;
deckId
=
null
;
userId
=
null
;
mCount
.
clear
();
mCount
.
clear
();
mMainCount
=
0
;
mMainCount
=
0
;
mExtraCount
=
0
;
mExtraCount
=
0
;
...
@@ -662,7 +664,11 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
...
@@ -662,7 +664,11 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
return
mItems
.
size
();
return
mItems
.
size
();
}
}
public
void
setId
(
String
id
)
{
public
void
set
Deck
Id
(
String
id
)
{
deckId
=
id
;
deckId
=
id
;
}
}
public
void
setUserId
(
String
id
)
{
userId
=
id
;
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItemUtils.java
View file @
dc5e8e37
...
@@ -117,7 +117,7 @@ class DeckItemUtils {
...
@@ -117,7 +117,7 @@ class DeckItemUtils {
* @param file 原有file
* @param file 原有file
* @return 如果file为null,返回false
* @return 如果file为null,返回false
*/
*/
public
static
boolean
save
(
List
<
DeckItem
>
items
,
String
deckId
,
File
file
)
{
public
static
boolean
save
(
List
<
DeckItem
>
items
,
String
deckId
,
String
userId
,
File
file
)
{
FileOutputStream
outputStream
=
null
;
FileOutputStream
outputStream
=
null
;
OutputStreamWriter
writer
=
null
;
OutputStreamWriter
writer
=
null
;
try
{
try
{
...
@@ -166,6 +166,8 @@ class DeckItemUtils {
...
@@ -166,6 +166,8 @@ class DeckItemUtils {
}
}
if
(
deckId
!=
null
)
if
(
deckId
!=
null
)
writer
.
write
((
"\n##"
+
deckId
).
toCharArray
());
writer
.
write
((
"\n##"
+
deckId
).
toCharArray
());
if
(
userId
!=
null
)
writer
.
write
((
"\n###"
+
userId
).
toCharArray
());
writer
.
flush
();
writer
.
flush
();
outputStream
.
flush
();
outputStream
.
flush
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -181,7 +183,9 @@ class DeckItemUtils {
...
@@ -181,7 +183,9 @@ class DeckItemUtils {
public
static
void
makeItems
(
DeckInfo
deckInfo
,
boolean
isPack
,
DeckAdapater
adapater
)
{
public
static
void
makeItems
(
DeckInfo
deckInfo
,
boolean
isPack
,
DeckAdapater
adapater
)
{
if
(
deckInfo
!=
null
)
{
if
(
deckInfo
!=
null
)
{
if
(
deckInfo
.
deckId
!=
null
)
if
(
deckInfo
.
deckId
!=
null
)
adapater
.
setId
(
deckInfo
.
deckId
);
adapater
.
setDeckId
(
deckInfo
.
deckId
);
if
(
deckInfo
.
userId
!=
null
)
adapater
.
setUserId
(
deckInfo
.
userId
);
DeckItem
.
resetLabel
(
deckInfo
,
isPack
);
DeckItem
.
resetLabel
(
deckInfo
,
isPack
);
adapater
.
addItem
(
new
DeckItem
(
DeckItemType
.
MainLabel
));
adapater
.
addItem
(
new
DeckItem
(
DeckItemType
.
MainLabel
));
List
<
Card
>
main
=
deckInfo
.
getMainCards
();
List
<
Card
>
main
=
deckInfo
.
getMainCards
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckUtils.java
View file @
dc5e8e37
...
@@ -64,6 +64,8 @@ public class DeckUtils {
...
@@ -64,6 +64,8 @@ public class DeckUtils {
}
}
if
(
deck
.
deckId
!=
null
)
if
(
deck
.
deckId
!=
null
)
writer
.
write
((
"\n##"
+
deck
.
deckId
).
toCharArray
());
writer
.
write
((
"\n##"
+
deck
.
deckId
).
toCharArray
());
if
(
deck
.
userId
!=
null
)
writer
.
write
((
"\n###"
+
deck
.
userId
).
toCharArray
());
writer
.
flush
();
writer
.
flush
();
outputStream
.
flush
();
outputStream
.
flush
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
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