Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
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
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
nanahira
ygopro2
Commits
98996656
Commit
98996656
authored
Jan 18, 2019
by
Szefo09
Committed by
Unicorn
Jan 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
93be358a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
36 deletions
+39
-36
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+38
-35
Assets/StreamingAssets/ygocore.zip
Assets/StreamingAssets/ygocore.zip
+0
-0
Assets/StreamingAssets/ygocore.zip.meta
Assets/StreamingAssets/ygocore.zip.meta
+1
-1
No files found.
Assets/SibylSystem/Program.cs
View file @
98996656
...
...
@@ -283,46 +283,29 @@ public class Program : MonoBehaviour
//保持唤醒
Screen
.
sleepTimeout
=
SleepTimeout
.
NeverSleep
;
//创建资源目录
if
(!
Directory
.
Exists
(
"/storage/emulated/0/ygocore"
))
if
(!
Directory
.
Exists
(
"/storage/emulated/0/ygocore
/updates/version1.0.txt
"
))
{
string
filePath
=
Application
.
streamingAssetsPath
+
"/ygocore.zip"
;
var
www
=
new
WWW
(
filePath
);
while
(!
www
.
isDone
)
{
}
byte
[]
bytes
=
www
.
bytes
;
ExtractZipFile
(
bytes
,
"/storage/emulated/0/"
);
File
.
Create
(
"/storage/emulated/0/ygocore/.nomedia"
);
}
DirPaths
(
"/storage/emulated/0/ygocore/cdb/"
);
DirPaths
(
"/storage/emulated/0/ygocore/config/"
);
DirPaths
(
"/storage/emulated/0/ygocore/deck/"
);
DirPaths
(
"/storage/emulated/0/ygocore/expansions/pics/field/"
);
DirPaths
(
"/storage/emulated/0/ygocore/pack/"
);
DirPaths
(
"/storage/emulated/0/ygocore/pics/field/"
);
DirPaths
(
"/storage/emulated/0/ygocore/picture/cardIn8thEdition/"
);
DirPaths
(
"/storage/emulated/0/ygocore/replay/"
);
DirPaths
(
"/storage/emulated/0/ygocore/sound/"
);
DirPaths
(
"/storage/emulated/0/ygocore/textures/common/"
);
DirPaths
(
"/storage/emulated/0/ygocore/textures/face/"
);
DirPaths
(
"/storage/emulated/0/ygocore/textures/duel/healthBar/"
);
DirPaths
(
"/storage/emulated/0/ygocore/textures/duel/phase/"
);
DirPaths
(
"/storage/emulated/0/ygocore/textures/ui/"
);
DirPaths
(
"/storage/emulated/0/ygocore/updates/"
);
if
(!
File
.
Exists
(
"/storage/emulated/0/ygocore/.nomedia"
))
{
File
.
Create
(
"/storage/emulated/0/ygocore/.nomedia"
);
}
if
(!
File
.
Exists
(
"/storage/emulated/0/ygocore/expansions/.nomedia"
))
{
File
.
Create
(
"/storage/emulated/0/ygocore/expansions/.nomedia"
);
}
if
(!
File
.
Exists
(
"/storage/emulated/0/ygocore/picture/.nomedia"
))
{
File
.
Create
(
"/storage/emulated/0/ygocore/picture/.nomedia"
);
}
Environment
.
CurrentDirectory
=
"/storage/emulated/0/ygocore"
;
System
.
IO
.
Directory
.
SetCurrentDirectory
(
"/storage/emulated/0/ygocore"
);
#elif UNITY_IPHONE //iPhone
Environment
.
CurrentDirectory
=
Application
.
persistentDataPath
;
System
.
IO
.
Directory
.
SetCurrentDirectory
(
Application
.
persistentDataPath
);
if
(!
Directory
.
Exists
(
Application
.
persistentDataPath
+
"/ygocore/updates/version1.0.txt"
))
{
string
filePath
=
Application
.
streamingAssetsPath
+
"/ygocore.zip"
;
var
www
=
new
WWW
(
filePath
);
while
(!
www
.
isDone
)
{
}
byte
[]
bytes
=
www
.
bytes
;
ExtractZipFile
(
System
.
IO
.
File
.
ReadAllBytes
(
bytes
),
Application
.
persistentDataPath
+
"/"
);
}
Environment
.
CurrentDirectory
=
Application
.
persistentDataPath
+
"/ygocore"
;
System
.
IO
.
Directory
.
SetCurrentDirectory
(
Application
.
persistentDataPath
+
"/ygocore"
);
#endif
go
(
1
,
()
=>
{
...
...
@@ -335,6 +318,7 @@ public class Program : MonoBehaviour
});
go
(
300
,
()
=>
{
//UpdateClient();
InterString
.
initialize
(
"config/translation.conf"
);
//InterString.initialize("config" + AppLanguage.LanguageDir() + "/translation.conf"); //System Language
GameTextureManager
.
initialize
();
...
...
@@ -353,7 +337,6 @@ public class Program : MonoBehaviour
YGOSharp
.
BanlistManager
.
initialize
(
"lflist.conf"
);
FileInfo
[]
fileInfos
=
(
new
DirectoryInfo
(
"cdb"
)).
GetFiles
().
OrderByDescending
(
x
=>
x
.
Name
).
ToArray
();
//FileInfo[] fileInfos = (new DirectoryInfo("cdb" + AppLanguage.LanguageDir())).GetFiles().OrderByDescending(x => x.Name).ToArray();//System Language
for
(
int
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
{
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
...
...
@@ -369,8 +352,8 @@ public class Program : MonoBehaviour
if
(
Directory
.
Exists
(
"expansions"
))
//if (Directory.Exists("expansions" + AppLanguage.LanguageDir()))
{
fileInfos
=
(
new
DirectoryInfo
(
"expansions"
)).
GetFiles
().
OrderByDescending
(
x
=>
x
.
Name
).
ToArray
();
//fileInfos = (new DirectoryInfo("expansions" + AppLanguage.LanguageDir())).GetFiles()
.OrderByDescending(x => x.Name).ToArray()
;
fileInfos
=
(
new
DirectoryInfo
(
"expansions"
)).
GetFiles
().
OrderByDescending
(
x
=>
x
.
Name
).
ToArray
();
;
//fileInfos = (new DirectoryInfo("expansions" + AppLanguage.LanguageDir())).GetFiles();
for
(
int
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
{
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
...
...
@@ -455,9 +438,14 @@ public class Program : MonoBehaviour
{
try
{
WWW
w
=
new
WWW
(
"https://api.github.com/repos/szefo09/updateYGOPro2/contents/"
);
while
(!
w
.
isDone
)
{
if
(
Application
.
internetReachability
==
NetworkReachability
.
NotReachable
)
{
throw
new
Exception
(
"No Internet connection!"
);
}
}
List
<
ApiFile
>
toDownload
=
new
List
<
ApiFile
>();
List
<
ApiFile
>
apiFromGit
=
new
System
.
Web
.
Script
.
Serialization
.
JavaScriptSerializer
().
Deserialize
<
List
<
ApiFile
>>(
w
.
text
);
...
...
@@ -471,11 +459,26 @@ public class Program : MonoBehaviour
List
<
ApiFile
>
local
=
new
System
.
Web
.
Script
.
Serialization
.
JavaScriptSerializer
().
Deserialize
<
List
<
ApiFile
>>(
File
.
ReadAllText
(
"updates/SHAs.txt"
));
foreach
(
ApiFile
file
in
apiFromGit
)
{
if
(
file
.
sha
!=
local
.
First
(
x
=>
x
.
name
==
file
.
name
).
sha
)
if
(
file
.
sha
!=
local
.
First
OrDefault
(
x
=>
x
.
name
==
file
.
name
).
sha
)
{
toDownload
.
Add
(
file
);
}
}
foreach
(
ApiFile
f
in
local
)
{
if
(
f
.
name
!=
apiFromGit
.
FirstOrDefault
(
x
=>
x
.
name
==
f
.
name
).
name
)
{
if
(
File
.
Exists
(
"cdb/"
+
f
.
name
))
{
File
.
Delete
(
"cdb/"
+
f
.
name
);
}
if
(
File
.
Exists
(
"config/"
+
f
.
name
))
{
File
.
Delete
(
"config/"
+
f
.
name
);
}
}
}
}
HttpDldFile
httpDldFile
=
new
HttpDldFile
();
foreach
(
var
dl
in
toDownload
)
...
...
@@ -493,7 +496,7 @@ public class Program : MonoBehaviour
}
catch
(
Exception
e
)
{
Debug
.
Log
(
e
);
Debug
.
Log
(
e
.
ToString
()
);
}
}
...
...
Assets/StreamingAssets/ygocore.zip
View file @
98996656
No preview for this file type
Assets/StreamingAssets/ygocore.zip.meta
View file @
98996656
fileFormatVersion: 2
guid: 7551303a99745e14aa3ed8f9ab8a9b92
timeCreated: 1547
767378
timeCreated: 1547
843843
licenseType: Free
DefaultImporter:
userData:
...
...
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