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
4523dd9d
Commit
4523dd9d
authored
Jul 19, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
启动参数
同步startGame传参数量
parent
f33d84c9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
+8
-7
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
.../java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
...e/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
+1
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
View file @
4523dd9d
...
...
@@ -30,6 +30,7 @@ import static cn.garymb.ygomobile.Constants.QUERY_NAME;
public
class
GameUriManager
{
private
Activity
activity
;
private
String
fname
;
public
GameUriManager
(
Activity
activity
)
{
this
.
activity
=
activity
;
...
...
@@ -56,7 +57,7 @@ public class GameUriManager {
options
.
mUserName
=
intent
.
getStringExtra
(
Constants
.
QUERY_USER
);
options
.
mPort
=
intent
.
getIntExtra
(
Constants
.
QUERY_PORT
,
0
);
options
.
mRoomName
=
intent
.
getStringExtra
(
Constants
.
QUERY_ROOM
);
YGOStarter
.
startGame
(
getActivity
(),
options
);
YGOStarter
.
startGame
(
getActivity
(),
options
,
null
);
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getActivity
(),
R
.
string
.
start_game_error
,
Toast
.
LENGTH_SHORT
).
show
();
activity
.
finish
();
...
...
@@ -153,7 +154,7 @@ public class GameUriManager {
}
else
if
(
file
.
getName
().
toLowerCase
(
Locale
.
US
).
endsWith
(
".yrp"
))
{
File
yrp
=
new
File
(
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
CORE_REPLAY_PATH
+
"/"
+
file
.
getName
().
toLowerCase
(
Locale
.
US
));
if
(
yrp
.
exists
())
{
YGOStarter
.
startGame
(
getActivity
(),
null
);
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-r"
+
yrp
.
getName
()
);
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
file_exist
),
Toast
.
LENGTH_LONG
).
show
();
}
else
{
try
{
...
...
@@ -162,8 +163,8 @@ public class GameUriManager {
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
install_failed_bcos
)
+
e
,
Toast
.
LENGTH_LONG
).
show
();
}
if
(!
ComponentUtils
.
isActivityRunning
(
getActivity
(),
new
ComponentName
(
getActivity
(),
YGOMobileActivity
.
class
)))
{
YGOStarter
.
startGame
(
getActivity
(),
null
);
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
yrp_installed
),
Toast
.
LENGTH_LONG
).
show
();
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-r"
+
yrp
.
getName
()
);
Toast
.
makeText
(
activity
,
""
+
yrp
.
getName
(
),
Toast
.
LENGTH_LONG
).
show
();
}
}
}
...
...
@@ -225,7 +226,7 @@ public class GameUriManager {
File
yrp
=
new
File
(
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
CORE_REPLAY_PATH
+
"/"
+
urifile
.
getName
().
toLowerCase
(
Locale
.
US
));
ParcelFileDescriptor
pfd
=
getActivity
().
getContentResolver
().
openFileDescriptor
(
uri
,
"r"
);
if
(
yrp
.
exists
())
{
YGOStarter
.
startGame
(
getActivity
(),
null
);
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-r "
+
urifile
.
getName
()
);
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
file_exist
),
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
if
(
pfd
==
null
)
{
...
...
@@ -244,7 +245,7 @@ public class GameUriManager {
e
.
printStackTrace
();
}
if
(!
ComponentUtils
.
isActivityRunning
(
activity
,
new
ComponentName
(
activity
,
YGOMobileActivity
.
class
)))
{
YGOStarter
.
startGame
(
activity
,
null
);
YGOStarter
.
startGame
(
activity
,
null
,
"-r "
+
urifile
.
getName
()
);
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
yrp_installed
),
Toast
.
LENGTH_LONG
).
show
();
}
}
...
...
@@ -273,7 +274,7 @@ public class GameUriManager {
// options.mUserName = uri.getQueryParameter(Constants.QUERY_USER);
// options.mPort = Integer.parseInt(uri.getQueryParameter(Constants.QUERY_PORT));
// options.mRoomName = uri.getQueryParameter(Constants.QUERY_ROOM);
// YGOStarter.startGame(getActivity(), options);
// YGOStarter.startGame(getActivity(), options
, null
);
// } catch (Exception e) {
// Toast.makeText(getActivity(), R.string.start_game_error, Toast.LENGTH_SHORT).show();
// activity.finish();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
View file @
4523dd9d
...
...
@@ -23,7 +23,7 @@ public class LogoActivity extends Activity {
hideBottomUIMenu
();
setContentView
(
R
.
layout
.
activity_logo
);
if
(
AppsSettings
.
get
().
isOnlyGame
())
{
YGOStarter
.
startGame
(
this
,
null
);
YGOStarter
.
startGame
(
this
,
null
,
null
);
finish
();
return
;
}
else
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
4523dd9d
...
...
@@ -473,7 +473,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
options
.
mUserName
=
serverInfo
.
getPlayerName
();
options
.
mPort
=
serverInfo
.
getPort
();
options
.
mRoomName
=
name
;
YGOStarter
.
startGame
(
this
,
options
);
YGOStarter
.
startGame
(
this
,
options
,
null
);
}
protected
abstract
void
checkResourceDownload
(
ResCheckTask
.
ResCheckListener
listener
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
4523dd9d
...
...
@@ -246,7 +246,7 @@ public class MainActivity extends HomeActivity {
@Override
protected
void
openGame
()
{
if
(
enableStart
)
{
YGOStarter
.
startGame
(
this
,
null
);
YGOStarter
.
startGame
(
this
,
null
,
null
);
}
else
{
VUiKit
.
show
(
this
,
R
.
string
.
dont_start_game
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
View file @
4523dd9d
...
...
@@ -257,7 +257,7 @@ public class MyCard {
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
YGOStarter
.
startGame
(
activity
,
options
);
YGOStarter
.
startGame
(
activity
,
options
,
null
);
}
});
}
catch
(
Exception
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