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
02637e1a
Commit
02637e1a
authored
Sep 25, 2021
by
feihuaduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配决斗助手1.0卡组协议,卡组码长度优化
parent
2221b0bb
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
374 additions
and
92 deletions
+374
-92
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+11
-3
mobile/src/main/java/cn/garymb/ygomobile/bean/CardIdNum.java
mobile/src/main/java/cn/garymb/ygomobile/bean/CardIdNum.java
+30
-0
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
+301
-74
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
+1
-1
mobile/src/main/java/com/ourygo/assistant/util/DuelAssistantManagement.java
...va/com/ourygo/assistant/util/DuelAssistantManagement.java
+26
-14
mobile/src/main/java/com/ourygo/assistant/util/Record.java
mobile/src/main/java/com/ourygo/assistant/util/Record.java
+5
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
02637e1a
...
...
@@ -190,14 +190,21 @@ public interface Constants {
*/
String
PATH_DECK
=
"/deck"
;
String
SCHEME_HTTP
=
"http"
;
String
SCHEME_HTTPS
=
"https"
;
String
SCHEME_APP
=
"ygo"
;
String
URI_HOST
=
"deck"
;
String
QUERY_YDK
=
"ydk"
;
String
QUERY_NAME
=
"name"
;
String
QUERY_MAIN
=
"main"
;
String
QUERY_EXTRA
=
"extra"
;
String
QUERY_SIDE
=
"side"
;
String
QUERY_MAIN
=
"m"
;
String
QUERY_EXTRA
=
"e"
;
String
QUERY_SIDE
=
"s"
;
String
QUERY_VERSION
=
"v"
;
String
QUERY_MAIN_ALL
=
"main"
;
String
QUERY_EXTRA_ALL
=
"extra"
;
String
QUERY_SIDE_ALL
=
"side"
;
String
QUERY_YGO_TYPE
=
"ygotype"
;
String
ARG_DECK
=
"deck"
;
String
PATH_ROOM
=
"/room"
;
String
QUERY_HOST
=
"host"
;
String
QUERY_PORT
=
"port"
;
...
...
@@ -214,4 +221,5 @@ public interface Constants {
String
TAG
=
"ygo-java"
;
String
DEF_ENCODING
=
"utf-8"
;
}
mobile/src/main/java/cn/garymb/ygomobile/bean/CardIdNum.java
0 → 100644
View file @
02637e1a
package
cn.garymb.ygomobile.bean
;
/**
* Create By feihua On 2021/9/25
*/
public
class
CardIdNum
{
private
String
cardIdNum
;
private
String
CardIdNumCompressed
;
public
CardIdNum
(
String
cardIdNum
,
String
cardIdNumCompressed
)
{
this
.
cardIdNum
=
cardIdNum
;
CardIdNumCompressed
=
cardIdNumCompressed
;
}
public
String
getCardIdNum
()
{
return
cardIdNum
;
}
public
void
setCardIdNum
(
String
cardIdNum
)
{
this
.
cardIdNum
=
cardIdNum
;
}
public
String
getCardIdNumCompressed
()
{
return
CardIdNumCompressed
;
}
public
void
setCardIdNumCompressed
(
String
cardIdNumCompressed
)
{
CardIdNumCompressed
=
cardIdNumCompressed
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
View file @
02637e1a
This diff is collapsed.
Click to expand it.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
View file @
02637e1a
...
...
@@ -804,7 +804,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
BitmapUtil
.
saveBitmap
(
bitmap
,
savePath
,
50
);
builderShareLoading
.
dismiss
();
DialogUtils
du
=
DialogUtils
.
getdx
(
this
);
View
viewDialog
=
du
.
dialogBottomSheet
(
R
.
layout
.
dialog_deck_share
,
0
);
View
viewDialog
=
du
.
dialogBottomSheet
(
R
.
layout
.
dialog_deck_share
,
0
);
ImageView
iv_image
=
viewDialog
.
findViewById
(
R
.
id
.
iv_image
);
Button
bt_image_share
=
viewDialog
.
findViewById
(
R
.
id
.
bt_image_share
);
Button
bt_code_share
=
viewDialog
.
findViewById
(
R
.
id
.
bt_code_share
);
...
...
mobile/src/main/java/com/ourygo/assistant/util/DuelAssistantManagement.java
View file @
02637e1a
...
...
@@ -3,12 +3,10 @@ package com.ourygo.assistant.util;
import
android.content.Context
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
com.ourygo.assistant.base.listener.OnClipChangedListener
;
import
com.ourygo.assistant.base.listener.OnDuelAssistantListener
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
...
...
@@ -87,6 +85,19 @@ public class DuelAssistantManagement implements OnClipChangedListener {
if
(
deckStart
!=
-
1
)
{
onSaveDeck
(
message
.
substring
(
deckStart
+
Record
.
DECK_URL_PREFIX
.
length
()),
true
,
id
);
return
true
;
}
else
if
(
message
.
contains
(
"?"
+
Record
.
ARG_YGO_TYPE
+
"="
+
Record
.
ARG_DECK
)
||
message
.
contains
(
"&"
+
Record
.
ARG_YGO_TYPE
+
"="
+
Record
.
ARG_DECK
))
{
String
m1
=
"?"
+
Record
.
ARG_YGO_TYPE
+
"="
+
Record
.
ARG_DECK
;
String
m2
=
"&"
+
Record
.
ARG_YGO_TYPE
+
"="
+
Record
.
ARG_DECK
;
int
s1
=
message
.
indexOf
(
m1
);
if
(
s1
==
-
1
)
s1
=
message
.
indexOf
(
m2
);
int
start
=
message
.
lastIndexOf
(
Record
.
DECK_URL_PREFIX
,
s1
);
if
(
start
==-
1
)
start
=
message
.
lastIndexOf
(
Record
.
HTTP_URL_PREFIX
,
s1
);
if
(
start
==-
1
)
start
=
message
.
lastIndexOf
(
Record
.
HTTPS_URL_PREFIX
,
s1
);
onSaveDeck
(
message
.
substring
(
start
+
Record
.
DECK_URL_PREFIX
.
length
()),
true
,
id
);
return
true
;
}
return
false
;
}
...
...
@@ -94,17 +105,18 @@ public class DuelAssistantManagement implements OnClipChangedListener {
public
boolean
roomCheck
(
String
message
,
int
id
)
{
int
start
=
-
1
;
int
end
=
-
1
;
start
=
message
.
indexOf
(
Record
.
ROOM_PREFIX
);
if
(
start
!=-
1
)
{
end
=
message
.
indexOf
(
Record
.
ROOM_END
,
start
);
if
(
end
!=-
1
)
{
message
=
message
.
substring
(
start
,
end
);
JSONObject
jsonObject
=
null
;
start
=
message
.
indexOf
(
Record
.
ROOM_PREFIX
);
if
(
start
!=
-
1
)
{
end
=
message
.
indexOf
(
Record
.
ROOM_END
,
start
);
if
(
end
!=
-
1
)
{
message
=
message
.
substring
(
start
,
end
);
JSONObject
jsonObject
=
null
;
try
{
jsonObject
=
new
JSONObject
(
message
);
onJoinRoom
(
jsonObject
.
getString
(
Record
.
ARG_HOST
),
jsonObject
.
getInt
(
Record
.
ARG_PORT
),
jsonObject
.
getString
(
Record
.
ARG_PASSWORD
),
id
);
onJoinRoom
(
jsonObject
.
getString
(
Record
.
ARG_HOST
),
jsonObject
.
getInt
(
Record
.
ARG_PORT
),
jsonObject
.
getString
(
Record
.
ARG_PASSWORD
),
id
);
return
true
;
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
}
...
...
@@ -131,8 +143,8 @@ public class DuelAssistantManagement implements OnClipChangedListener {
if
(
end
-
start
==
passwordPrefixKey
.
length
())
return
false
;
}
onJoinRoom
(
null
,
0
,
message
.
substring
(
start
,
end
),
id
);
return
true
;
onJoinRoom
(
null
,
0
,
message
.
substring
(
start
,
end
),
id
);
return
true
;
}
return
false
;
}
...
...
@@ -160,12 +172,12 @@ public class DuelAssistantManagement implements OnClipChangedListener {
return
false
;
}
private
void
onJoinRoom
(
String
host
,
int
port
,
String
password
,
int
id
)
{
private
void
onJoinRoom
(
String
host
,
int
port
,
String
password
,
int
id
)
{
int
i
=
0
;
while
(
i
<
onDuelAssistantListenerList
.
size
())
{
OnDuelAssistantListener
onDuelAssistantListener
=
onDuelAssistantListenerList
.
get
(
i
);
if
(
onDuelAssistantListener
.
isListenerEffective
())
{
onDuelAssistantListener
.
onJoinRoom
(
host
,
port
,
password
,
id
);
onDuelAssistantListener
.
onJoinRoom
(
host
,
port
,
password
,
id
);
i
++;
}
else
{
onDuelAssistantListenerList
.
remove
(
i
);
...
...
mobile/src/main/java/com/ourygo/assistant/util/Record.java
View file @
02637e1a
...
...
@@ -32,7 +32,12 @@ public class Record {
//卡组url前缀
public
static
final
String
DECK_URL_PREFIX
=
"ygo://deck"
;
public
static
final
String
HTTP_URL_PREFIX
=
"http://"
;
public
static
final
String
HTTPS_URL_PREFIX
=
"https://"
;
public
static
final
String
ARG_PORT
=
"port"
;
public
static
final
String
ARG_HOST
=
"host"
;
public
static
final
String
ARG_PASSWORD
=
"password"
;
public
static
final
String
ARG_YGO_TYPE
=
"ygotype"
;
public
static
final
String
ARG_DECK
=
"deck"
;
}
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