Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
package net.pixvi.myrloader.center
|
||||
{
|
||||
public class MyrCenter
|
||||
{
|
||||
|
||||
public static const PLATFORM_PC:String = "PC";
|
||||
|
||||
public static const PLATFORM_IOS:String = "IOS";
|
||||
|
||||
public static const PLATFORM_ANDROID:String = "ANDROID";
|
||||
|
||||
public static const CHANNEL_DYD:String = "DYD";
|
||||
|
||||
public static const CHANNEL_BLBL:String = "BLBL";
|
||||
|
||||
public static const CHANNEL_MEIZU:String = "MEIZU";
|
||||
|
||||
public static const CHANNEL_TEST:String = "TEST";
|
||||
|
||||
public static const CHANNEL_JAPAN:String = "XDG";
|
||||
|
||||
public static const CHANNEL_LOCAL:String = "LOCAL";
|
||||
|
||||
public static const CHANNEL_CPG:String = "CPG";
|
||||
|
||||
public static var OBB_MODE:Boolean = false;
|
||||
|
||||
public static var obb_packageName:String;
|
||||
|
||||
public static var obb_mainVersion:String;
|
||||
|
||||
public static var obb_traceMode:Boolean = false;
|
||||
|
||||
public static var closeLoginSelectBack:Boolean = false;
|
||||
|
||||
public static var closeRealName:Boolean = false;
|
||||
|
||||
public static var startLogout:Boolean = false;
|
||||
|
||||
public static const LANG_CN:String = "CN";
|
||||
|
||||
public static const LANG_JP:String = "JP";
|
||||
|
||||
public static var platform:String;
|
||||
|
||||
public static var channel:String;
|
||||
|
||||
public static var lang:String;
|
||||
|
||||
public static var serverChannel:String;
|
||||
|
||||
public function MyrCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function isObbMode() : Boolean
|
||||
{
|
||||
if(platform == "ANDROID" && OBB_MODE == true && obb_mainVersion != "")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function hasLang() : Boolean
|
||||
{
|
||||
if(lang != null && lang != "" && lang != "CN")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package net.pixvi.myrloader.center
|
||||
{
|
||||
import flash.filesystem.File;
|
||||
import flash.utils.ByteArray;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.pse.file.FileTools;
|
||||
|
||||
public class MyrUpdateCenter extends Singleton
|
||||
{
|
||||
|
||||
public static var updateLocalSrcPrefix:String = "app-storage:/";
|
||||
|
||||
public static var updateServer:String = "http://resource.myrzx.cn/updateserver1/verFfcs/";
|
||||
|
||||
public var updateFiles:Object = {};
|
||||
|
||||
public var version:Number = 0;
|
||||
|
||||
public var buildVersion:Number = 0;
|
||||
|
||||
public var versionList:Array;
|
||||
|
||||
public var lastVersion:Number;
|
||||
|
||||
public var versionListFile:Object;
|
||||
|
||||
public function MyrUpdateCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getUpdateSrc(src:String) : String
|
||||
{
|
||||
if(src.charAt(0) == "/")
|
||||
{
|
||||
src = src.substr(1);
|
||||
}
|
||||
if(checkSrc(src))
|
||||
{
|
||||
return updateLocalSrcPrefix + src;
|
||||
}
|
||||
return src;
|
||||
}
|
||||
|
||||
public static function getStorageSrcIfExist(src:String) : String
|
||||
{
|
||||
if(File.applicationStorageDirectory.resolvePath(src).exists)
|
||||
{
|
||||
return File.applicationStorageDirectory.resolvePath(src).url;
|
||||
}
|
||||
return src;
|
||||
}
|
||||
|
||||
public static function checkSrc(src:String) : Boolean
|
||||
{
|
||||
return getIns().updateFiles[src] != null;
|
||||
}
|
||||
|
||||
public static function getStorageFileIfExist(src:String) : File
|
||||
{
|
||||
var file:File = File.applicationStorageDirectory.resolvePath(src);
|
||||
if(file.exists)
|
||||
{
|
||||
return file;
|
||||
}
|
||||
return File.applicationDirectory.resolvePath(src);
|
||||
}
|
||||
|
||||
public static function swfSrcToBytes(src:String) : ByteArray
|
||||
{
|
||||
var file:File = new File(src);
|
||||
return FileTools.readFileBytes(file);
|
||||
}
|
||||
|
||||
public static function getIns() : MyrUpdateCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(MyrUpdateCenter) as MyrUpdateCenter;
|
||||
}
|
||||
|
||||
public function getConfigSrcHackLib() : Object
|
||||
{
|
||||
var lib:Object = {};
|
||||
for(var key:String in updateFiles)
|
||||
{
|
||||
if(updateFiles[key].type != null && updateFiles[key].type == "config")
|
||||
{
|
||||
lib[key] = updateLocalSrcPrefix + updateFiles[key].src;
|
||||
}
|
||||
}
|
||||
return lib;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user