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
342dca22
Commit
342dca22
authored
Jul 21, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
97596d70
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
11 deletions
+10
-11
libcore/android/android_tools.cpp
libcore/android/android_tools.cpp
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
+3
-3
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
+2
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
.../java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
+1
-2
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.
libcore/android/android_tools.cpp
View file @
342dca22
...
@@ -818,7 +818,7 @@ void OnShareFile(ANDROID_APP app, char* title, char* path){
...
@@ -818,7 +818,7 @@ void OnShareFile(ANDROID_APP app, char* title, char* path){
"shareFile"
,
"(Ljava/lang/String;Ljava/lang/String;)V"
);
"shareFile"
,
"(Ljava/lang/String;Ljava/lang/String;)V"
);
jstring
s_title
=
jni
->
NewStringUTF
(
title
);
jstring
s_title
=
jni
->
NewStringUTF
(
title
);
jstring
s_path
=
jni
->
NewStringUTF
(
path
);
jstring
s_path
=
jni
->
NewStringUTF
(
path
);
jni
->
CallVoidMethod
(
lNativeActivity
,
MethodGetAddr
,
s_title
,
s_path
;
jni
->
CallVoidMethod
(
lNativeActivity
,
MethodGetAddr
,
s_title
,
s_path
)
;
jni
->
ReleaseStringUTFChars
(
s_title
,
title
);
jni
->
ReleaseStringUTFChars
(
s_title
,
title
);
jni
->
ReleaseStringUTFChars
(
s_path
,
path
);
jni
->
ReleaseStringUTFChars
(
s_path
,
path
);
jni
->
DeleteLocalRef
(
ClassNativeActivity
);
jni
->
DeleteLocalRef
(
ClassNativeActivity
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
View file @
342dca22
...
@@ -57,7 +57,7 @@ public class GameUriManager {
...
@@ -57,7 +57,7 @@ public class GameUriManager {
options
.
mUserName
=
intent
.
getStringExtra
(
Constants
.
QUERY_USER
);
options
.
mUserName
=
intent
.
getStringExtra
(
Constants
.
QUERY_USER
);
options
.
mPort
=
intent
.
getIntExtra
(
Constants
.
QUERY_PORT
,
0
);
options
.
mPort
=
intent
.
getIntExtra
(
Constants
.
QUERY_PORT
,
0
);
options
.
mRoomName
=
intent
.
getStringExtra
(
Constants
.
QUERY_ROOM
);
options
.
mRoomName
=
intent
.
getStringExtra
(
Constants
.
QUERY_ROOM
);
YGOStarter
.
startGame
(
getActivity
(),
options
,
null
);
YGOStarter
.
startGame
(
getActivity
(),
options
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getActivity
(),
R
.
string
.
start_game_error
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getActivity
(),
R
.
string
.
start_game_error
,
Toast
.
LENGTH_SHORT
).
show
();
activity
.
finish
();
activity
.
finish
();
...
@@ -163,7 +163,7 @@ public class GameUriManager {
...
@@ -163,7 +163,7 @@ public class GameUriManager {
}
}
}
}
if
(!
ComponentUtils
.
isActivityRunning
(
getActivity
(),
new
ComponentName
(
getActivity
(),
YGOMobileActivity
.
class
)))
{
if
(!
ComponentUtils
.
isActivityRunning
(
getActivity
(),
new
ComponentName
(
getActivity
(),
YGOMobileActivity
.
class
)))
{
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-r"
+
yrp
.
getName
());
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-r"
,
yrp
.
getName
());
Toast
.
makeText
(
activity
,
""
+
yrp
.
getName
(),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
activity
,
""
+
yrp
.
getName
(),
Toast
.
LENGTH_LONG
).
show
();
}
}
}
}
...
@@ -243,7 +243,7 @@ public class GameUriManager {
...
@@ -243,7 +243,7 @@ public class GameUriManager {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
if
(!
ComponentUtils
.
isActivityRunning
(
activity
,
new
ComponentName
(
activity
,
YGOMobileActivity
.
class
)))
{
if
(!
ComponentUtils
.
isActivityRunning
(
activity
,
new
ComponentName
(
activity
,
YGOMobileActivity
.
class
)))
{
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-r "
+
yrp
.
getName
());
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-r "
,
yrp
.
getName
());
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
yrp_installed
),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
yrp_installed
),
Toast
.
LENGTH_LONG
).
show
();
}
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
View file @
342dca22
...
@@ -158,7 +158,7 @@ public class YGOStarter {
...
@@ -158,7 +158,7 @@ public class YGOStarter {
* @param args 例如(播放完退出游戏):-r 1111.yrp
* @param args 例如(播放完退出游戏):-r 1111.yrp
* 或者(播放完不退出游戏):-k -r 1111.yrp
* 或者(播放完不退出游戏):-k -r 1111.yrp
*/
*/
public
static
void
startGame
(
Activity
activity
,
YGOGameOptions
options
,
String
args
)
{
public
static
void
startGame
(
Activity
activity
,
YGOGameOptions
options
,
String
...
args
)
{
//如果距离上次加入游戏的时间大于1秒才处理
//如果距离上次加入游戏的时间大于1秒才处理
if
(
System
.
currentTimeMillis
()
-
lasttime
>=
1000
)
{
if
(
System
.
currentTimeMillis
()
-
lasttime
>=
1000
)
{
lasttime
=
System
.
currentTimeMillis
();
lasttime
=
System
.
currentTimeMillis
();
...
@@ -173,7 +173,7 @@ public class YGOStarter {
...
@@ -173,7 +173,7 @@ public class YGOStarter {
intent
.
putExtra
(
YGOGameOptions
.
YGO_GAME_OPTIONS_BUNDLE_TIME
,
System
.
currentTimeMillis
());
intent
.
putExtra
(
YGOGameOptions
.
YGO_GAME_OPTIONS_BUNDLE_TIME
,
System
.
currentTimeMillis
());
}
}
if
(
args
!=
null
)
{
if
(
args
!=
null
)
{
intent
.
putExtra
(
IrrlichtBridge
.
EXTRA_ARGV
,
args
.
split
(
" "
)
);
intent
.
putExtra
(
IrrlichtBridge
.
EXTRA_ARGV
,
args
);
}
}
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
Log
.
e
(
"YGOStarter"
,
"跳转前"
+
System
.
currentTimeMillis
());
Log
.
e
(
"YGOStarter"
,
"跳转前"
+
System
.
currentTimeMillis
());
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
View file @
342dca22
...
@@ -23,7 +23,7 @@ public class LogoActivity extends Activity {
...
@@ -23,7 +23,7 @@ public class LogoActivity extends Activity {
hideBottomUIMenu
();
hideBottomUIMenu
();
setContentView
(
R
.
layout
.
activity_logo
);
setContentView
(
R
.
layout
.
activity_logo
);
if
(
AppsSettings
.
get
().
isOnlyGame
())
{
if
(
AppsSettings
.
get
().
isOnlyGame
())
{
YGOStarter
.
startGame
(
this
,
null
,
null
);
YGOStarter
.
startGame
(
this
,
null
);
finish
();
finish
();
return
;
return
;
}
else
{
}
else
{
...
@@ -40,7 +40,6 @@ public class LogoActivity extends Activity {
...
@@ -40,7 +40,6 @@ public class LogoActivity extends Activity {
}
}
if
(!
isTaskRoot
())
{
if
(!
isTaskRoot
())
{
finish
();
finish
();
return
;
}
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
342dca22
...
@@ -473,7 +473,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
...
@@ -473,7 +473,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
options
.
mUserName
=
serverInfo
.
getPlayerName
();
options
.
mUserName
=
serverInfo
.
getPlayerName
();
options
.
mPort
=
serverInfo
.
getPort
();
options
.
mPort
=
serverInfo
.
getPort
();
options
.
mRoomName
=
name
;
options
.
mRoomName
=
name
;
YGOStarter
.
startGame
(
this
,
options
,
null
);
YGOStarter
.
startGame
(
this
,
options
);
}
}
protected
abstract
void
checkResourceDownload
(
ResCheckTask
.
ResCheckListener
listener
);
protected
abstract
void
checkResourceDownload
(
ResCheckTask
.
ResCheckListener
listener
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
342dca22
...
@@ -246,7 +246,7 @@ public class MainActivity extends HomeActivity {
...
@@ -246,7 +246,7 @@ public class MainActivity extends HomeActivity {
@Override
@Override
protected
void
openGame
()
{
protected
void
openGame
()
{
if
(
enableStart
)
{
if
(
enableStart
)
{
YGOStarter
.
startGame
(
this
,
null
,
null
);
YGOStarter
.
startGame
(
this
,
null
);
}
else
{
}
else
{
VUiKit
.
show
(
this
,
R
.
string
.
dont_start_game
);
VUiKit
.
show
(
this
,
R
.
string
.
dont_start_game
);
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
View file @
342dca22
...
@@ -257,7 +257,7 @@ public class MyCard {
...
@@ -257,7 +257,7 @@ public class MyCard {
activity
.
runOnUiThread
(
new
Runnable
()
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
YGOStarter
.
startGame
(
activity
,
options
,
null
);
YGOStarter
.
startGame
(
activity
,
options
);
}
}
});
});
}
catch
(
Exception
e
)
{
}
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