فهرست منبع

优化战斗流程

zouyong 5 سال پیش
کامیت
d62d9235ba
100فایلهای تغییر یافته به همراه10259 افزوده شده و 0 حذف شده
  1. 108 0
      tools/dealServerConfig.js
  2. 6 0
      tools/test.js
  3. 53 0
      tower_sanguo/.gitignore
  4. 7 0
      tower_sanguo/assets/MOKA.meta
  5. 7 0
      tower_sanguo/assets/MOKA/component.meta
  6. 43 0
      tower_sanguo/assets/MOKA/component/BaseUI.ts
  7. 9 0
      tower_sanguo/assets/MOKA/component/BaseUI.ts.meta
  8. 7 0
      tower_sanguo/assets/MOKA/data.meta
  9. 18 0
      tower_sanguo/assets/MOKA/data/Definition.ts
  10. 9 0
      tower_sanguo/assets/MOKA/data/Definition.ts.meta
  11. 18 0
      tower_sanguo/assets/MOKA/data/ViewZOrder.ts
  12. 9 0
      tower_sanguo/assets/MOKA/data/ViewZOrder.ts.meta
  13. 7 0
      tower_sanguo/assets/MOKA/hot.meta
  14. 14 0
      tower_sanguo/assets/MOKA/main.ts
  15. 9 0
      tower_sanguo/assets/MOKA/main.ts.meta
  16. 7 0
      tower_sanguo/assets/MOKA/manager.meta
  17. 23 0
      tower_sanguo/assets/MOKA/manager/ErrorManager.ts
  18. 9 0
      tower_sanguo/assets/MOKA/manager/ErrorManager.ts.meta
  19. 175 0
      tower_sanguo/assets/MOKA/manager/ResManager.ts
  20. 9 0
      tower_sanguo/assets/MOKA/manager/ResManager.ts.meta
  21. 60 0
      tower_sanguo/assets/MOKA/manager/SDKManager.ts
  22. 9 0
      tower_sanguo/assets/MOKA/manager/SDKManager.ts.meta
  23. 108 0
      tower_sanguo/assets/MOKA/manager/UIManager.ts
  24. 9 0
      tower_sanguo/assets/MOKA/manager/UIManager.ts.meta
  25. 7 0
      tower_sanguo/assets/MOKA/net.meta
  26. 116 0
      tower_sanguo/assets/MOKA/net/HttpManager.ts
  27. 9 0
      tower_sanguo/assets/MOKA/net/HttpManager.ts.meta
  28. 7 0
      tower_sanguo/assets/MOKA/util.meta
  29. 45 0
      tower_sanguo/assets/MOKA/util/GameUtil.ts
  30. 9 0
      tower_sanguo/assets/MOKA/util/GameUtil.ts.meta
  31. 11 0
      tower_sanguo/assets/MOKA/util/IPool.ts
  32. 9 0
      tower_sanguo/assets/MOKA/util/IPool.ts.meta
  33. 61 0
      tower_sanguo/assets/MOKA/util/LogUtil.ts
  34. 9 0
      tower_sanguo/assets/MOKA/util/LogUtil.ts.meta
  35. 25 0
      tower_sanguo/assets/MOKA/util/Random.ts
  36. 9 0
      tower_sanguo/assets/MOKA/util/Random.ts.meta
  37. 249 0
      tower_sanguo/assets/MOKA/util/Sciencen_M.ts
  38. 9 0
      tower_sanguo/assets/MOKA/util/Sciencen_M.ts.meta
  39. 17 0
      tower_sanguo/assets/MOKA/util/SingletonFactory.ts
  40. 9 0
      tower_sanguo/assets/MOKA/util/SingletonFactory.ts.meta
  41. 745 0
      tower_sanguo/assets/MOKA/util/Utils.ts
  42. 9 0
      tower_sanguo/assets/MOKA/util/Utils.ts.meta
  43. 701 0
      tower_sanguo/assets/MOKA/util/aes.js
  44. 9 0
      tower_sanguo/assets/MOKA/util/aes.js.meta
  45. 325 0
      tower_sanguo/assets/MOKA/util/hmacSha256.ts
  46. 9 0
      tower_sanguo/assets/MOKA/util/hmacSha256.ts.meta
  47. 7 0
      tower_sanguo/assets/MOKA/util/rsa.meta
  48. 87 0
      tower_sanguo/assets/MOKA/util/rsa/jsencrypt.d.ts
  49. 5 0
      tower_sanguo/assets/MOKA/util/rsa/jsencrypt.d.ts.meta
  50. 4353 0
      tower_sanguo/assets/MOKA/util/rsa/jsencrypt.js
  51. 9 0
      tower_sanguo/assets/MOKA/util/rsa/jsencrypt.js.meta
  52. 69 0
      tower_sanguo/assets/MOKA/util/util.ts
  53. 9 0
      tower_sanguo/assets/MOKA/util/util.ts.meta
  54. 7 0
      tower_sanguo/assets/resources.meta
  55. 7 0
      tower_sanguo/assets/resources/anim.meta
  56. 7 0
      tower_sanguo/assets/resources/data.meta
  57. 30 0
      tower_sanguo/assets/resources/data/AchieveCfg.json
  58. 5 0
      tower_sanguo/assets/resources/data/AchieveCfg.json.meta
  59. 550 0
      tower_sanguo/assets/resources/data/guide.json
  60. 5 0
      tower_sanguo/assets/resources/data/guide.json.meta
  61. 5 0
      tower_sanguo/assets/resources/data/mission.json
  62. 5 0
      tower_sanguo/assets/resources/data/mission.json.meta
  63. 3 0
      tower_sanguo/assets/resources/data/monster.json
  64. 5 0
      tower_sanguo/assets/resources/data/monster.json.meta
  65. 16 0
      tower_sanguo/assets/resources/data/resList.json
  66. 5 0
      tower_sanguo/assets/resources/data/resList.json.meta
  67. 7 0
      tower_sanguo/assets/resources/effect.meta
  68. 7 0
      tower_sanguo/assets/resources/module.meta
  69. 7 0
      tower_sanguo/assets/resources/module/fight.meta
  70. BIN
      tower_sanguo/assets/resources/module/fight/attack_normal.png
  71. 36 0
      tower_sanguo/assets/resources/module/fight/attack_normal.png.meta
  72. BIN
      tower_sanguo/assets/resources/module/fight/bg_fight.png
  73. 36 0
      tower_sanguo/assets/resources/module/fight/bg_fight.png.meta
  74. 775 0
      tower_sanguo/assets/resources/module/fight/fight.prefab
  75. 8 0
      tower_sanguo/assets/resources/module/fight/fight.prefab.meta
  76. BIN
      tower_sanguo/assets/resources/module/fight/monster_blood_1.png
  77. BIN
      tower_sanguo/assets/resources/module/fight/monster_blood_2.png
  78. BIN
      tower_sanguo/assets/resources/module/fight/monster_blood_3.png
  79. 7 0
      tower_sanguo/assets/resources/module/fight/prefab.meta
  80. 232 0
      tower_sanguo/assets/resources/module/fight/prefab/attack_normal.prefab
  81. 8 0
      tower_sanguo/assets/resources/module/fight/prefab/attack_normal.prefab.meta
  82. 145 0
      tower_sanguo/assets/resources/module/fight/prefab/bing_1.prefab
  83. 8 0
      tower_sanguo/assets/resources/module/fight/prefab/bing_1.prefab.meta
  84. 145 0
      tower_sanguo/assets/resources/module/fight/prefab/guanyu.prefab
  85. 8 0
      tower_sanguo/assets/resources/module/fight/prefab/guanyu.prefab.meta
  86. 7 0
      tower_sanguo/assets/resources/module/fight/spine.meta
  87. 7 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full.meta
  88. 7 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1.meta
  89. 264 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.atlas
  90. 5 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.atlas.meta
  91. 0 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.json
  92. 10 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.json.meta
  93. BIN
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.png
  94. 36 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.png.meta
  95. BIN
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton2.png
  96. 36 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton2.png.meta
  97. 7 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/2.meta
  98. 125 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/2/skeleton.atlas
  99. 5 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/2/skeleton.atlas.meta
  100. 0 0
      tower_sanguo/assets/resources/module/fight/spine/attack_full/2/skeleton.json

+ 108 - 0
tools/dealServerConfig.js

@@ -0,0 +1,108 @@
+/**
+ * 配置文件压缩为字符串
+ * 支持key-string,key-number,key-Array<string/number>
+ * 
+ */
+
+//配置示例:
+let testconfig =
+{
+    key1: 0,
+    key2: "111",
+    key3: [1, 2, 3],
+    key4: ['4', '5', '6'],
+    key5: [
+        {
+            subkey1: 1,
+            subkey2: '2',
+            subkey3: [1, 2, 3],
+            subkey4: ['4', '5', '6']
+        },
+        {
+            subkey1: 11,
+            subkey2: '22',
+            subkey3: [11, 22, 33],
+            subkey4: ['44', '55', '66']
+        },
+        {
+            subkey1: 111,
+            subkey2: '222',
+            subkey3: [111, 222, 333],
+            subkey4: ['444', '555', '666']
+        }
+    ]
+}
+
+
+var sign_arr = '?@#$%‘’';
+var sign_obj = '@#~^:¥£';
+var configNames = ['testconfig'];
+
+compress({ testconfig: testconfig });
+
+/**
+ * 压缩服务端配置数据,测试或服务器使用,支持key-string,key-number,key-Array<string/number>
+ * @param configs 所有配置
+ * @returns 压缩后的数据
+ */
+function compress(configs) {
+    for (let configkey in configs) {
+        let configdata = configs[configkey];
+        if (configNames.indexOf(configkey) != -1) {
+            console.log("压缩前数据:",configs);
+            configs[configkey] = getCompresssStr(configkey, configdata);
+            console.log("压缩后数据:",configs);
+        }
+    }
+}
+
+/**
+ * 遍历对象,组装成字符串
+ * @param key 
+ * @param value 
+ * @param signindex 
+ * @returns 
+ */
+function getCompresssStr(key, value, signindex = 0) {
+    let props = [];
+    if (value instanceof Array) {//数组类型压缩
+        let str = '';
+        for (let i = 0; i < value.length; i++) {
+            str += getCompresssStr(key, value[i], signindex + 1) + sign_arr[signindex];
+        }
+        return str.slice(0, str.length - 1);
+    }
+    else if (value instanceof Object) {//Object类型压缩
+        for (let i in value) {
+            props.push({ key: i, value: getCompresssStr(i, value[i], signindex + 1) });
+        }
+    }
+    else {//基础类型直接返回
+        return value;
+    }
+
+    //对象内数据按key的字母升序排列
+    props.sort((a, b) => {
+        let key1 = a.key;
+        let key2 = b.key;
+        let len = key1.length < key2.length ? key1.length : key2.length;
+        for (let i = 0; i < len; i++) {
+            if (key1.charCodeAt(i) < key2.charCodeAt(i)) {
+                return -1;
+            }
+            else if (key1.charCodeAt(i) > key2.charCodeAt(i)) {
+                return 1;
+            }
+        }
+    });
+
+    //转换成字符串
+    let str = '';
+    let sign = sign_obj.charAt(signindex);
+    for (let i = 0; i < props.length; i++) {
+        str += props[i].value + sign;
+    }
+    //去掉最后一个多余的分隔符
+    str = str.slice(0, str.length - 1);
+    return str;
+}

+ 6 - 0
tools/test.js

@@ -0,0 +1,6 @@
+
+
+let a = {}
+console.log(typeof a);
+
+

+ 53 - 0
tower_sanguo/.gitignore

@@ -0,0 +1,53 @@
+#/////////////////////////////////////////////////////////////////////////////
+# Fireball Projects
+#/////////////////////////////////////////////////////////////////////////////
+
+/library/
+/temp/
+/local/
+/build/
+
+#/////////////////////////////////////////////////////////////////////////////
+# npm files
+#/////////////////////////////////////////////////////////////////////////////
+
+npm-debug.log
+node_modules/
+
+#/////////////////////////////////////////////////////////////////////////////
+# Logs and databases
+#/////////////////////////////////////////////////////////////////////////////
+
+*.log
+*.sql
+*.sqlite
+
+#/////////////////////////////////////////////////////////////////////////////
+# files for debugger
+#/////////////////////////////////////////////////////////////////////////////
+
+*.sln
+*.csproj
+*.pidb
+*.unityproj
+*.suo
+
+#/////////////////////////////////////////////////////////////////////////////
+# OS generated files
+#/////////////////////////////////////////////////////////////////////////////
+
+.DS_Store
+ehthumbs.db
+Thumbs.db
+
+#/////////////////////////////////////////////////////////////////////////////
+# WebStorm files
+#/////////////////////////////////////////////////////////////////////////////
+
+.idea/
+
+#//////////////////////////
+# VS Code files
+#//////////////////////////
+
+.vscode/

+ 7 - 0
tower_sanguo/assets/MOKA.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "c93c0271-9cde-4f97-a02b-9cd1e9d211df",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/component.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "03f7a91e-e1ff-447e-828b-2547806abbd6",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 43 - 0
tower_sanguo/assets/MOKA/component/BaseUI.ts

@@ -0,0 +1,43 @@
+export interface UIClass<T extends BaseUI> {
+    new(): T;
+    getPrefabUrl(): string;
+    getName(): string;
+}
+
+const { ccclass } = cc._decorator;
+@ccclass
+export default abstract class BaseUI extends cc.Component {
+    protected static prefabUrl;
+    protected static className;
+
+    protected ui:cc.Component;
+
+    /**
+     * 得到prefab的路径,相对于resources目录
+     */
+    public static getPrefabUrl(): string {
+        return this.prefabUrl;
+    }
+
+    /**
+     * 类名,用于给UI命名
+     */
+    public static getName(): string {
+        return this.className;
+    }
+
+    private _tag: any;
+    public get tag(): any {
+        return this._tag;
+    }
+    public set tag(value: any) {
+        this._tag = value;
+    }
+
+    close(){
+        if(this.node.parent){
+            this.node.parent.removeChild(this.node);
+        }
+        this.node.removeAllChildren();
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/component/BaseUI.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "83be2d60-5317-4e3d-a691-1936ec94e446",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/data.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "15359918-c01b-4e38-b885-ec5f3169d17e",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 18 - 0
tower_sanguo/assets/MOKA/data/Definition.ts

@@ -0,0 +1,18 @@
+export class Definition {
+
+
+
+}
+export enum ERROR_DEAL {
+    REQUEST = 0,    //向错误平台发送日志
+    POP = 1,    //弹出错误窗
+    
+}
+
+export enum RESTYPE{
+    JSON = 'json',
+    ATLAS = 'atlas',
+    PREFAB = 'prefab',
+    MP3 = 'mp3',
+    WAV = 'wav',
+}

+ 9 - 0
tower_sanguo/assets/MOKA/data/Definition.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "f4d1346a-f858-47e5-95de-427bd66cb329",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 18 - 0
tower_sanguo/assets/MOKA/data/ViewZOrder.ts

@@ -0,0 +1,18 @@
+export class ViewZorder {
+    /**场景层 */
+    public static readonly Scene = 20;
+    /**顶部和底部菜单栏层级 */
+    public static readonly MenuPanel = 80;
+    /**UI层 */
+    public static readonly UI = 100;
+    /**对话框层 */
+    public static readonly Dialog = 200;
+    /**提示层 */
+    public static readonly Tips = 300;
+    /**引导层 */
+    public static readonly Guide = 400;
+    /**通知层 */
+    public static readonly Notice = 500;
+    /**loading层 */
+    public static readonly Loading = 600;
+}

+ 9 - 0
tower_sanguo/assets/MOKA/data/ViewZOrder.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "2e5052b6-5ba5-477d-b370-e9d92c4892f5",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/hot.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "317d165b-ffb0-4a04-94f9-4c5c4ecc1de5",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 14 - 0
tower_sanguo/assets/MOKA/main.ts

@@ -0,0 +1,14 @@
+import GameController from "../scripts/GameController";
+
+const { ccclass, property } = cc._decorator;
+
+@ccclass
+export default class main extends cc.Component {
+    @property({
+        type: cc.Asset,
+    })
+    mainfestUrl: cc.Asset = null;
+    start() {
+        GameController.init();
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/main.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "bc426803-a064-4778-887f-0d23217559c2",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/manager.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "e1e09fe9-b248-49b7-992e-02a2cb1c1c97",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 23 - 0
tower_sanguo/assets/MOKA/manager/ErrorManager.ts

@@ -0,0 +1,23 @@
+
+
+/*
+* 错误管理器
+* zyong 2021.3.11
+*/
+
+import { ERROR_DEAL } from "../data/Definition";
+
+export default class ErrorManager {
+    constructor() {
+    }
+
+    dealError(url, type = ERROR_DEAL.REQUEST) {
+        console.log("error:", url);
+
+        switch (type) {
+            case ERROR_DEAL.REQUEST:
+
+                break;
+        }
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/manager/ErrorManager.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "011e4ea9-d4a8-4d11-95f3-be18ee3cc5fd",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 175 - 0
tower_sanguo/assets/MOKA/manager/ResManager.ts

@@ -0,0 +1,175 @@
+
+
+/*
+* 资源加载管理器
+* zyong 2021.3.11
+*/
+
+import GameController from "../../scripts/GameController";
+import { Definition, ERROR_DEAL, RESTYPE } from "../data/Definition";
+
+
+export default class ResManager {
+    constructor() {
+    }
+
+
+    /**
+     * 加载json文件
+     * @param vo 
+     * @param completeCallback 
+     * @param retrytimes 加载失败后重新加载的次数
+     */
+    loadJson(vo, completeCallback, retrytimes = 3) {
+        var url = vo.url + vo.name;
+        this.loadRes(url, cc.JsonAsset, completeCallback, retrytimes);
+    }
+
+    /**
+     * 加载atlas文件
+     * @param vo 
+     * @param completeCallback 
+     * @param retrytimes 加载失败后重新加载的次数
+     */
+    loadAtlas(vo, completeCallback, retrytimes = 3) {
+        var url = vo.url + vo.name;
+        this.loadRes(url, cc.SpriteAtlas, completeCallback, retrytimes);
+    }
+
+    /**
+     * 加载prefab
+     * @param vo 
+     * @param completeCallback 
+     * @param retrytimes 加载失败后重新加载的次数
+     */
+    loadPrefab(vo, completeCallback, retrytimes = 3) {
+        var url = vo.url + vo.name;
+        this.loadRes(url, cc.Prefab, completeCallback, retrytimes);
+    }
+
+    /**
+     * 加载音效文件
+     * @param vo 
+     * @param completeCallback 
+     * @param retrytimes 加载失败后重新加载的次数
+     */
+    loadAudio(vo, completeCallback, retrytimes = 3) {
+        var url = vo.url + vo.name;
+        this.loadRes(url, cc.AudioClip, completeCallback, retrytimes);
+    }
+
+    /**
+     * 加载其他资源
+     * @param vo 
+     * @param completeCallback 
+     * @param retrytimes 加载失败后重新加载的次数
+     */
+    loadAsset(vo, completeCallback, retrytimes = 3) {
+        var url = vo.url + vo.name;
+        this.loadRes(url, null, completeCallback, retrytimes);
+    }
+
+    /**
+     * 加载资源
+     * @param url "resources/"下路径,不需要后缀名
+     * @param type cc.Asset
+     * @param completeCallback 
+     * @param retrytimes 加载失败后重新加载的次数
+     * @param time 当前加载次数
+     */
+    loadRes(url, type, completeCallback, retrytimes = 3, time = 0) {
+        cc.loader.loadRes(url, type, (error: Error, resource: any) => {
+            if (error) {
+                if (time < retrytimes) {
+                    this.loadRes(url, type, completeCallback, time + 1, retrytimes)
+                }
+                else {
+                    GameController.errorM.dealError(url, ERROR_DEAL.REQUEST);
+                }
+            }
+            else {
+                completeCallback();
+            }
+        });
+    }
+
+    private groupLoadArr;
+    private groupLoadComCb;
+    private groupLoadPrgCb;
+    private groupLoadTatol;
+
+    /**
+     * 按序加载资源
+     * @param arr 加载数组
+     * @param completeCallback 完成回调
+     * @param progressCallback 进度回调
+     */
+    loadGroup(arr: Array<any>, completeCallback, progressCallback): void {
+        this.groupLoadArr = arr;
+        this.groupLoadComCb = completeCallback;
+        this.groupLoadPrgCb = progressCallback;
+        this.groupLoadTatol = arr.length;
+        this.startLoadGroup();
+    }
+    private startLoadGroup(): void {
+        this.groupLoadPrgCb(this.groupLoadTatol - this.groupLoadArr.length, this.groupLoadTatol);
+
+        if (this.groupLoadArr.length <= 0) {
+            this.groupLoadComCb();
+            return;
+        }
+        var vo = this.groupLoadArr.shift();
+        switch (vo.type) {
+            case RESTYPE.JSON:
+                this.loadJson(vo, this.startLoadGroup.bind(this));
+                break;
+            case RESTYPE.ATLAS:
+                this.loadAtlas(vo, this.startLoadGroup.bind(this));
+                break;
+            case RESTYPE.PREFAB:
+                this.loadPrefab(vo, this.startLoadGroup.bind(this));
+                break;
+            case RESTYPE.MP3:
+            case RESTYPE.WAV:
+                this.loadAudio(vo, this.startLoadGroup.bind(this));
+                break;
+            default:
+                this.loadAsset(vo, this.startLoadGroup.bind(this));
+                break
+        }
+    }
+
+    /**
+     * 获取资源
+     * @param url
+     * @param type
+     *  */
+    getRes(url, type) {
+        return cc.loader.getRes(url, type);
+    }
+
+    /**
+     * 释放资源
+     * @param url
+     * @param type
+     *  */
+    release(url, type) {
+        cc.loader.releaseRes(url, type);
+    }
+
+    /**
+     * 释放资源
+     * @param url
+     * @param type
+     *  */
+    releaseDir(dir, type) {
+        cc.loader.releaseResDir(dir, type);
+    }
+
+    /**
+     * 释放资源
+     *  */
+    releaseAll() {
+        cc.loader.releaseAll();
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/manager/ResManager.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "d37a86c0-ce29-4efb-afe9-435e7955158d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 60 - 0
tower_sanguo/assets/MOKA/manager/SDKManager.ts

@@ -0,0 +1,60 @@
+
+import AndroidSDK from "../../scripts/sdk/android/AndroidSDK";
+import MokaWxSDK from "../../scripts/sdk/wx/MokaWxSDK";
+
+export default class SDKManager {
+    constructor() {
+    }
+
+
+    private sdk:any;
+
+    init() {
+        if (cc.sys.platform == cc.sys.WECHAT_GAME) {
+            this.sdk = new MokaWxSDK();
+        }
+        else{
+            this.sdk = new AndroidSDK();
+        }
+        this.sdk.init();
+    }
+
+    /**
+     * 开始登录
+     */
+    login(){
+        this.sdk.init();
+    }
+
+    /**
+     * 主动分享
+     */
+    shareAppMessage(){
+        this.sdk.shareAppMessage();
+    }
+
+    /**
+     * 打开互推游戏中的某一个
+     * @param i 互推id
+     */
+    openCommendApp(i) {
+        this.sdk.openCommendApp(i);
+    }
+
+    /** 
+     * 发送事件
+     * @param eventID 事件ID
+     * @param des 事件描述
+     * @param tarEventID 数数属性事件, ''不向数数发送事件
+     */
+    sendEvent(eventID: string, des: string, tarEventID: string = '') {
+        this.sdk.sendEvent(eventID,des,tarEventID);
+    }
+
+    /**
+     * 
+     */
+    setUserID() {
+        this.sdk.setUserID();
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/manager/SDKManager.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "07fb78c9-8d70-4623-8ccb-60f971e7c410",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 108 - 0
tower_sanguo/assets/MOKA/manager/UIManager.ts

@@ -0,0 +1,108 @@
+import GameController from "../../scripts/GameController";
+import BaseUI, { UIClass } from "../component/BaseUI";
+import { ERROR_DEAL } from "../data/Definition";
+import { ViewZorder } from "../data/ViewZOrder";
+
+
+export default class UIManager {
+    constructor() {
+    }
+
+    private list_ui: BaseUI[] = [];
+
+    /**
+     * 打开UI
+     * @param uiClass 
+     * @param zOrder 
+     * @param callback 打开完毕回调函数
+     * @param onProgress 打开过程进度函数
+     * @param parent UI的父节点
+     * @param args 传入到UI的参数
+     */
+    openUI<T extends BaseUI>(uiClass: UIClass<T>, callback?: Function, zOrder: number = ViewZorder.UI, onProgress?: Function, parent?: cc.Node, ...args: any[]) {
+        if (this.getUI(uiClass)) {
+            console.error(`UI: ${uiClass.getName()} is already exist...`);
+            return;
+        }
+        
+        cc.loader.loadRes(uiClass.getPrefabUrl(), cc.Prefab, (completedCount: number, totalCount: number, item: any) => {
+            onProgress && onProgress(completedCount, totalCount, item);
+        }, (error, prefab) => {
+            if (error) {
+                GameController.errorM.dealError(uiClass.getPrefabUrl(), ERROR_DEAL.REQUEST);
+                return;
+            }
+            if (this.getUI(uiClass)) {
+                console.error(`UI: ${uiClass.getName()} is already exist...`);
+                return;
+            }
+
+            let uiNode: cc.Node = cc.instantiate(prefab);
+            let ui = uiNode.getComponent(uiClass) as BaseUI;
+
+            //如果没有绑定脚本
+            if (!ui) {
+                ui = uiNode.addComponent(uiClass);
+            }
+            
+            if (ui.node.getComponent(cc.Widget) == null) {// 穿透问题
+                ui.node.width = cc.winSize.width;
+                ui.node.height = cc.winSize.height;
+            }
+
+            ui.node.x = cc.winSize.width / 2;
+            ui.node.y = cc.winSize.height / 2;
+
+            if (!parent) {
+                let uiRoot = cc.director.getScene();
+                if (!uiRoot) {
+                    GameController.errorM.dealError(`打开 ${uiClass.getPrefabUrl()}时场景不存在`, ERROR_DEAL.REQUEST);
+                    return;
+                }
+                parent = uiRoot;
+            }
+
+            parent.addChild(uiNode);
+            uiNode.zIndex = zOrder;            
+            this.list_ui.push(ui);
+            ui.tag = uiClass;
+
+            callback && callback(ui);
+        });
+    }
+
+    /**
+     * 打开UI
+     * @param uiClass 
+     * @returns 
+     */
+    getUI<T extends BaseUI>(uiClass: UIClass<T>): T {
+        for (let i = 0; i < this.list_ui.length; ++i) {
+            if (this.list_ui[i].tag === uiClass) {
+                return this.list_ui[i] as T;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 关闭UI(该UIClass需场景内唯一)
+     * @param uiClass 
+     * @returns 
+     */
+    closeUI<T extends BaseUI>(uiClass: UIClass<T>) {
+        for (let i = 0; i < this.list_ui.length; ++i) {
+            if (this.list_ui[i].tag === uiClass) {
+                var ui  = this.list_ui[i]
+                this.list_ui.splice(i, 1);
+                if (cc.isValid(ui.node)) {
+                    ui.close();
+                    ui.destroy();
+                }
+                return;
+            }
+        }
+    }
+
+    
+}

+ 9 - 0
tower_sanguo/assets/MOKA/manager/UIManager.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "a1e2be2f-73a5-455f-b6f3-14aefcc0526f",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/net.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "02fee8a3-a388-4a78-b554-f1c53a0c35a0",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 116 - 0
tower_sanguo/assets/MOKA/net/HttpManager.ts

@@ -0,0 +1,116 @@
+import GameController from "../../scripts/GameController";
+import { ERROR_DEAL } from "../data/Definition";
+import { Utils } from "../util/Utils";
+import { HTTPTYPE } from "../../scripts/net/HttpCommand";
+
+
+export default class HttpManager {
+    constructor() {
+    }
+
+
+    sendData(url: HTTPTYPE, data: any, callback: any = null, errorPop = true, async = true) {
+        let encode = '';
+        let dataN = null;
+        data.timestamp = Math.floor(new Date().getTime() * 0.001)
+        data.appVersion = GameController.commonData.appVersion
+        data.tfChannel = GameController.commonData.tf_channel
+        data.versioncfg = GameController.commonData.version
+        encode = Utils.Encrypt(JSON.stringify(data), GameController.commonData.session_key, GameController.commonData.appid)
+        dataN = {
+            "uin": GameController.commonData.uin,
+            "encrypt": encode
+        }
+        let self = this;
+        let checkData = (response) => {
+            if (response.errcode != 0) {
+                GameController.errorM.dealError(url, ERROR_DEAL.POP);
+            }
+            else {
+                response = self.checkData(response);
+                callback && callback(response);
+            }
+        };
+        this.sendRequest(url, 'POST', JSON.stringify(dataN), checkData, false, errorPop, async);
+    }
+
+    /**
+     * 
+     * @param url 请求头
+     * @param methond 'GET' || 'POST' 
+     * @param data 数据
+     * @param callback 回调
+     * @param isRsa 是否加密
+     * @param errorPop 请求失败时是否弹窗
+     * @param async 是否异步请求
+     * @param params 回传参数
+     */
+    sendRequest(url, methond: string = 'POST', data: string = null, callback: any = null, isRsa: boolean = true, errorPop = true, async = true, params = null) {
+        let requesttimes = 0;
+        let httpRequest = new XMLHttpRequest();
+        let send = () => {
+            httpRequest.open(methond, GameController.http.serverUrl + GameController.http.isTry + url, async);
+            httpRequest.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
+            if (isRsa) {
+                data = Utils.RSAEncrypt(data)
+            }
+            httpRequest.send(data);
+        };
+
+        // httpRequest.timeout = 30000
+        httpRequest.onreadystatechange = function () {
+            if (httpRequest.readyState === 4) {
+                if (httpRequest.status === 200) {
+                    var responseStr = httpRequest.responseText;
+                    let response = JSON.parse(responseStr);
+                    callback && callback(response,params);
+                    if (response.errcode != 0) {
+                        if (errorPop) {
+                            // EffectNode.instance.PlayTip(response.errmsg)
+                        }
+                    }
+                }
+                else {
+                    GameController.errorM.dealError("httpStatusError:" + url, ERROR_DEAL.REQUEST);
+                }
+            }
+        }
+
+        httpRequest.ontimeout = function (e) {
+            requesttimes++;
+            if (requesttimes >= 3) {
+                GameController.errorM.dealError("httpConnectError:" + url, ERROR_DEAL.REQUEST);
+            }
+            else {
+                send();
+            }
+        };
+        httpRequest.onerror = function (e) {
+            GameController.errorM.dealError("httpOnError:" + url, ERROR_DEAL.REQUEST);
+        };
+
+        send();
+    }
+
+    /** 检测用明文还是密文
+     * @param response 返回消息
+     * @param forceData true 明文  false 有密文优先密文,没密文情况下用明文
+     */
+    checkData(response, forceData = false) {
+        let data = null
+        if (forceData) {
+            data = response.data;
+        }
+        else {
+            if (response.encrypt) {
+                data = Utils.Decrypt(response.encrypt, GameController.commonData.session_key, GameController.commonData.appid);
+                data = JSON.parse(data);
+            }
+            else if (response.data) {
+                data = response.data;
+            }
+        }
+        response.data = data;
+        return response;
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/net/HttpManager.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "644c8a79-db98-4613-9c52-2bc63579d2eb",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/util.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "9d35559a-e129-45c6-996b-2d25946d025d",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 45 - 0
tower_sanguo/assets/MOKA/util/GameUtil.ts

@@ -0,0 +1,45 @@
+
+export default class GameUtil {
+
+    /**
+     * 根据坐标获取面向角度
+     * @param crtX 
+     * @param crtY 
+     * @param tarX 
+     * @param tarY 
+     * @returns 
+     */
+    static getDirection(crtX, crtY, tarX, tarY): number {
+        var hudu: number;
+        var x: number = Math.abs(tarX - crtX);
+        var y: number = Math.abs(tarY - crtY);
+        var angle: number;//与同方向的x轴或y轴的夹角
+        if (x > y)//x轴方向移动
+        {
+            hudu = Math.atan2(y, x);
+            angle = hudu * 180 / Math.PI;
+        }
+        else if (x < y) {
+            hudu = Math.atan2(x, y);
+            angle = hudu * 180 / Math.PI;
+        }
+        else {
+            angle = 45;
+        }
+
+        return angle;
+    }
+
+    /** */
+    static localConvertWorldPointARCenter(node: cc.Node) {
+        let o1 = cc.view.getVisibleSize();
+        let o2 = node.convertToWorldSpaceAR(cc.v2(0, 0));
+        o2.x = o2.x - o1.width / 2;
+        o2.y = o2.y - o1.height / 2;
+        return o2;
+    }
+
+    static localConvertWorldPointARLeftBottom(node: cc.Node) {
+        return node.convertToWorldSpaceAR(cc.v2(0, 0));
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/GameUtil.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "121bf6a3-8234-46d1-ab50-c5c4a2f8e0d2",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 11 - 0
tower_sanguo/assets/MOKA/util/IPool.ts

@@ -0,0 +1,11 @@
+/**
+ *
+ * @author zouyong
+ * @function 对象池接口
+ *
+ */
+ interface IPool {
+	reset():void;
+
+	clear():void;
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/IPool.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "4a5ad377-4854-476c-a714-1ad7bd5c9ad3",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 61 - 0
tower_sanguo/assets/MOKA/util/LogUtil.ts

@@ -0,0 +1,61 @@
+// Learn TypeScript:
+//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
+// Learn Attribute:
+//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
+// Learn life-cycle callbacks:
+//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
+
+const { ccclass, property } = cc._decorator;
+
+export default class LogUtil {
+
+    private static openLog = true
+    private static Tag = "xiyouLog "
+    public static logV(tag: string, obj: any, floor: number = 0) {
+        // if(!this.openLog){
+        //     return
+        // }
+
+        // if (typeof obj == 'string' || typeof obj == 'number' || typeof obj == 'boolean') {
+        //     console.log("carLog " + tag + " : " + obj)
+        // } else {
+        //     console.log("carLog " + tag + " : ")
+        //     console.log(obj)
+        // }
+        if (!this.openLog) {
+            return
+        }
+        if (obj == null || obj == undefined) {
+            console.log(this.getSpaceStr(floor) + this.Tag + " " + obj)
+            return
+        }
+        if (typeof obj === "number" || typeof obj === "string" || typeof obj === "boolean") {
+            console.log(this.getSpaceStr(floor) + this.Tag + tag + " " + obj)
+        } else {
+            for (const key of Object.keys(obj)) {
+                if (obj.hasOwnProperty(key)) {
+                    if (typeof obj[key] === "object") {
+                        console.log(this.getSpaceStr(floor) + this.Tag + tag + " " + key + " : ")
+                        this.logV(tag, obj[key], floor + 1)
+                    } else {
+                        console.log(this.getSpaceStr(floor) + this.Tag + tag + " " + key + " : " + obj[key])
+                    }
+
+                }
+            }
+        }
+    }
+
+    public static getSpaceStr(loop: number): string {
+        let str = ""
+        if (loop > 0) {
+            for (let i = 0; i < loop; i++) {
+                str += "      "
+            }
+            return str
+        }
+        return str
+    }
+
+    // update (dt) {}
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/LogUtil.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "54101317-e80c-4082-b455-5ed6b0ecbd98",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 25 - 0
tower_sanguo/assets/MOKA/util/Random.ts

@@ -0,0 +1,25 @@
+export default class Random
+{
+
+    public static Range(min: number, max: number, isInt: boolean = true): number
+    {
+        //return min + Math.ceil(Math.random() * 1000) % (max - min);         //不包含最大值
+        let del: number = max - min;
+        if (del > 0)
+        {
+            let val: number = min + Math.random() * 0xffffff % del
+            if (isInt)
+            {
+                return Math.floor(val);
+            }
+            return val
+        }
+        return min;
+    }
+
+    public static GetBool():boolean
+    {
+        let temp=Random.Range(0,2);
+        return temp==1?true:false;
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/Random.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "1a36333a-eec7-4b71-bc90-02bd44c87895",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 249 - 0
tower_sanguo/assets/MOKA/util/Sciencen_M.ts

@@ -0,0 +1,249 @@
+import LogUtil from "./LogUtil";
+
+export default class Sciencen_M {
+    private count = { 4: "万", 8: "亿", 12: "兆", 16: "万兆", 20: "亿兆", 24: "兆兆", 28: "万兆兆", 32: "亿兆兆", 36: "兆兆兆" }
+    private static _me: Sciencen_M;
+    constructor() {
+
+    }
+    public static get instance(): Sciencen_M {
+        if (this._me == null) {
+            this._me = new Sciencen_M();
+        }
+        return this._me;
+    }
+    /**
+     * 超大数值加法运算  忽略小数部分
+     **/
+    addition = (a: string, b: string): string => {
+        var res: any = '',
+            temp: any = 0;
+        let a1 = a.split('.')[0].split('');
+        let b1 = b.split('.')[0].split('');
+        while (a1.length || b1.length || temp) {
+            temp += ~~a1.pop() + ~~b1.pop();
+            res = (temp % 10) + res;
+            temp = temp > 9;
+        }
+        return res.replace(/^0+/, '');
+    }
+
+    /**
+     * 超大数值减法运算  忽略小数部分
+     **/
+    subtraction = (a: any, b: any): string => {
+        a = a.split('.')[0].split('');
+        b = b.split('.')[0].split('');
+        var aMaxb = a.length > b.length;
+        if (a.length == b.length) {
+            for (var i = 0, len = a.length; i < len; i++) {
+                if (a[i] == b[i]) continue;
+                aMaxb = a[i] > b[i];
+                break;
+            }
+        }
+        if (!aMaxb) a = [b, b = a][0];
+        var result = '';
+        while (a.length) {
+            var temp = parseInt(a.pop()) - parseInt(b.pop() || 0);
+            if (temp >= 0) result = temp + result;
+            else {
+                result = temp + 10 + result;
+                a[a.length - 1]--;
+            }
+        }
+        result = (aMaxb ? '' : '-') + result.replace(/^0*/g, '');
+        if (result == '-') {
+            result = '0'
+        }
+
+        return result
+    }
+
+    /**
+     * 超大数值高位对比  忽略小数部分
+     */
+    ContrastNumber = (a: any, b: any): boolean => {
+        a = a.split('.')[0].split('');
+        b = b.split('.')[0].split('');
+        var aMaxb = a.length > b.length;
+        if (a.length == b.length) {
+            for (var i = 0, len = a.length; i < len; i++) {
+                if (a[i] == b[i]) continue;
+                aMaxb = a[i] > b[i];
+                break;
+            }
+        }
+        if (!aMaxb) a = [b, b = a][0];
+        var result = '';
+        while (a.length) {
+            var temp = parseInt(a.pop()) - parseInt(b.pop() || 0);
+            if (temp >= 0) result = temp + result;
+            else {
+                result = temp + 10 + result;
+                a[a.length - 1]--;
+            }
+        }
+        if (a === b) return true;
+        return Boolean(aMaxb);
+    }
+
+    /**
+     * 数值乘法
+     */
+    private accMuls = (a, b) => {
+        let arra = a.split('').reverse(),
+            arrb = b.split('').reverse(),
+            lena = arra.length,
+            lenb = arrb.length,
+            result: any = Array(lena + lenb + 1).join('0').split('');
+        arra.map((itema, indexa) => {
+            arrb.map((itemb, indexb) => {
+                result[indexa + indexb] = +result[indexa + indexb] + itema * itemb;
+            });
+        });
+        result.map((item, index) => {
+            if (item >= 10) {
+                result[index + 1] = ~~result[index + 1] + ~~(result[index] / 10);
+                result[index] %= 10;
+            }
+        });
+        return result.reverse().join('').replace(/^0+/, '');
+    }
+
+    /**
+     * 超大数值乘法
+     */
+    accMul = (arg1: string, arg2: string) => {
+        var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
+        try { m += s1.split(".")[1].length } catch (e) { }
+        try { m += s2.split(".")[1].length } catch (e) { }
+        let targe = this.accMuls(s1.replace(".", ""), s2.replace(".", ""));
+        return this.accDiv(targe, Math.pow(10, m).toString())
+    }
+
+    /** 科学技术法转为数值字符串形式 */
+    toNonExponential = (num: number) => {
+        LogUtil.logV('toNonExponential  ', num.toLocaleString())
+        let result = ''
+        let str = num.toString()
+        LogUtil.logV('toNonExponential  str ', str)
+        if (str.indexOf('e') != -1) {
+            let m = str.split('e')
+            let n = m[0].split('.')
+            let len = parseInt(m[1].slice(1))
+            let z = ''
+            if (m[1][0] == '+') {
+                if (n[1]) {
+                    len = len - n[1].length
+                    for (var i = 0; i < len; i++) {
+                        z += '0'
+                    }
+                    result = n[0] + n[1] + z
+                }
+                else {
+                    for (var i = 0; i < len; i++) {
+                        z += '0'
+                    }
+                    result = n[0] + z
+                }
+            }
+            else if (m[1][0] == '-') {
+                for (var i = 0; i < len - 1; i++) {
+                    z += '0'
+                }
+
+                if (n[1]) {
+                    result = '0.' + z + n[0] + n[1]
+                }
+                else {
+                    result = '0.' + z + n[0]
+                }
+            }
+        }
+        else {
+            result = str
+        }
+        LogUtil.logV('toNonExponential  result ', result)
+        // return num.toLocaleString().replace(/[,]/g, '')
+        return result
+    }
+
+    /**
+     *  超大数值除法运算
+     */
+    accDiv(arg1: string, arg2: string): string {
+
+        var t1 = 0, t2 = 0, t3 = 0, r1, r2;
+
+        try { t1 = arg1.toString().split(".")[1].length } catch (e) { }
+
+        try { t2 = arg2.toString().split(".")[1].length } catch (e) { }
+
+        r1 = Number(arg1.toString().replace(".", ""))
+
+        r2 = Number(arg2.toString().replace(".", ""))
+
+        if (r2 == 0)
+            return '0';
+
+        var result = String(r1 / r2);
+
+        try { t3 = result.toString().split(".")[1].length } catch (e) { }
+
+        var index = t2 - t1 - t3;
+
+        if (index < 0) {
+            result = result.replace(".", "");
+
+            while (result.length <= Math.abs(index)) {
+                result = '0' + result;
+            }
+
+            var start = result.substring(0, result.length + index);
+            var end = result.substring(result.length + index, result.length);
+
+            result = start + '.' + end;
+
+            return this.toNonExponential(Number(result));
+        }
+        else if (index > 0) {
+            result = result.replace(".", "");
+            let i = 1;
+            while (i <= Math.abs(index)) {
+                result += '0';
+                i++;
+            }
+            return this.toNonExponential(Number(result));
+        }
+        else return this.toNonExponential(Number(result.replace(".", "")));
+    }
+
+    /**
+     * 数值格式化
+     */
+    format = (value: string, showDeci: boolean = true) => {
+        var a = value.split('.')[0];
+        var b;
+        for (let i in this.count) {
+            let ii = Number(i);
+            if (a.length - 1 >= ii) {
+                if (showDeci) {
+                    let deci = a.slice(a.length - ii, a.length - ii + 1)
+                    if (Number(deci) >= 1) {
+                        b = a.slice(0, a.length - ii) + "." + deci + this.count[ii];
+                    }
+                    else {
+                        b = a.slice(0, a.length - ii) + this.count[ii];
+                    }
+                }
+                else {
+                    b = a.slice(0, a.length - ii) + this.count[ii];
+                }
+            }
+        };
+        if (!b) return a;
+        return b;
+    }
+
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/Sciencen_M.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "4b9d1a66-60a3-4629-8dfa-577ec4ccca96",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 17 - 0
tower_sanguo/assets/MOKA/util/SingletonFactory.ts

@@ -0,0 +1,17 @@
+
+/**
+ * 单例工厂
+ */
+export class SingletonFactory {
+
+    private static instances: Map<{ new() }, Object> = new Map<{ new() }, Object>();
+
+    public static getInstance<T>(c: { new(): T }): T {
+        if (!SingletonFactory.instances.has(c)) {
+            let obj = new c();
+            SingletonFactory.instances.set(c, obj);
+            return obj;
+        }
+        return <T>SingletonFactory.instances.get(c);
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/SingletonFactory.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "eeef1c45-9761-4d50-832d-b67d23a94e8f",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 745 - 0
tower_sanguo/assets/MOKA/util/Utils.ts

@@ -0,0 +1,745 @@
+import * as CryptoJS from "./aes.js"
+import { hmacSha256 } from "./hmacSha256"
+
+/**
+ * 工具类
+ */
+export class Utils {
+
+    public constructor() {
+    }
+
+    /**
+     * 打乱数组
+     * @param arr 要打乱的数组
+     * @returns 打乱后的数组
+     */
+    static Shuffle<T>(arr: Array<T>): Array<T> {
+        var len = arr.length;
+        for (var i = len - 1; i >= 0; i--) {
+            var j = Math.floor(Math.random() * len);
+            var temp = arr[i];
+            arr[i] = arr[j];
+            arr[j] = temp;
+        }
+
+        return arr;
+    }
+
+    /**
+     * 获取固定长度字符串  用于太长名字截断
+     * @param str 原字符串
+     * @param len 取字符长度
+     * @returns 返回的字符串
+     */
+    public static cutstr(str: string, len: number): string {
+        var str_length = 0;
+        var str_len = 0;
+        let str_cut = "";
+        str_len = str.length;
+        for (var i = 0; i < str_len; i++) {
+            let a = str.charAt(i);
+            str_length++;
+            if (escape(a).length > 4) {
+                //中文字符的长度经编码之后大于4
+                str_length++;
+            }
+            str_cut = str_cut.concat(a);
+            if (str_length >= len) {
+                str_cut = str_cut.concat("...");
+                return str_cut;
+            }
+        }
+        //如果给定字符串小于指定长度,则返回源字符串;
+        if (str_length < len) {
+            return str;
+        }
+    }
+
+    /**
+     * 取一个区间内随机整数
+     * @param n 开始位置
+     * @param m 结束位置
+     * @returns 返回的随机整数
+     */
+    public static rnd(n, m): number {
+        var random = Math.floor(Math.random() * (m - n + 1) + n);
+        return random;
+    }
+
+    static _hasOwnProperty = Object.prototype.hasOwnProperty;
+    /**
+     * 一个对象是否有prop属性
+     * @param obj 对象
+     * @param prop 属性
+     * @returns 返回是否有
+     */
+    static has(obj: any, prop: any) {
+        return Utils._hasOwnProperty.call(obj, prop);
+    }
+
+    /**
+     * 对比两个对象的大小
+     * @param a 对象a
+     * @param b 对象b
+     * @returns 返回值 a < b : -1, a == b : 0, a > b : 1
+     */
+    static defaultCompare<T>(a: T, b: T): number {
+        if (a < b) {
+            return -1;
+        } else if (a === b) {
+            return 0;
+        } else {
+            return 1;
+        }
+    }
+
+    /**
+     * 将一个对象转为字符串
+     * @param item 传入对象
+     * @returns 返回值 字符串
+     */
+    static defaultToString(item: any): string {
+        if (item === null) {
+            return 'COLLECTION_NULL';
+        } else if (Utils.isUndefined(item)) {
+            return 'COLLECTION_UNDEFINED';
+        } else if (Utils.isString(item)) {
+            return '$s ' + item;
+        } else {
+            return '$o ' + item.toString();
+        }
+    }
+
+    /**
+    * 将所有属性用字符串格式拼接起来
+    * @param item 要拼接属性的对象
+    * @param join 拼接字符
+    * @returns 返回值
+    */
+    static makeString<T>(item: T, join: string = ','): string {
+        if (item === null) {
+            return 'COLLECTION_NULL';
+        } else if (Utils.isUndefined(item)) {
+            return 'COLLECTION_UNDEFINED';
+        } else if (Utils.isString(item)) {
+            return item.toString();
+        } else {
+            let toret = '{';
+            let first = true;
+            for (const prop in item) {
+                if (Utils.has(item, prop)) {
+                    if (first) {
+                        first = false;
+                    } else {
+                        toret = toret + join;
+                    }
+                    toret = toret + prop + ':' + (<any>item)[prop];
+                }
+            }
+            return toret + '}';
+        }
+    }
+
+    /**
+     * 检查func是否是一个函数
+     * @param func 传入的参数
+     * @returns 返回值 bool
+     */
+    static isFunction(func: any): boolean {
+        return (typeof func) === 'function';
+    }
+
+    /**
+     * 检查obj是否是undefined
+     * @param obj 传入参数
+     * @returns 返回值 bool
+     */
+    static isUndefined(obj: any): boolean {
+        return (typeof obj) === 'undefined';
+    }
+
+    /**
+     * 检查一个对象是否是字符串
+     * @param obj 要检查的对象
+     * @param 返回值 true : 是, false : 不是
+     */
+    static isString(obj: any): boolean {
+        return Object.prototype.toString.call(obj) === '[object String]';
+    }
+
+    /** 计算两点之间距离 */
+    static dis(x1, y1, x2, y2): number {
+        return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
+    }
+
+    /** 每角度对应弧度 */
+    static radian: number = Math.PI / 180;
+    /**设置数组显示 科学计数法 */
+    static strShow(num: number): string {
+        num = Math.floor(num);
+
+        //最大数值保护
+        if (num >= 18446744073700000000) {
+            num = 18446744073700000000
+        }
+
+        let str = String(num);
+        let str1 = str
+        let len = str.length;
+        let len1 = 0
+        // console.log('strShow  ', str)
+
+
+        if (len > 3 && len < 6) {
+            str1 = str
+            len1 = str1.length
+            str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+        }
+        else if (len >= 6 && len < 10) {
+            str1 = str.substr(0, len - 4)
+            len1 = str1.length
+            if (len1 > 3) {
+                str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+            }
+            str1 += '万'
+            // str = str.substr(0, len - 3) + 'K';
+        } else if (len >= 10 && len < 14) {
+            str1 = str.substr(0, len - 8)
+            len1 = str1.length
+            if (len1 > 3) {
+                str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+            }
+            str1 += '亿'
+
+            // str = str.substr(0, len - 6) + 'B';
+        } else if (len >= 14 && len < 18) {
+            str1 = str.substr(0, len - 12)
+            len1 = str1.length
+            if (len1 > 3) {
+                str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+            }
+            str1 += '兆'
+
+            // str = str.substr(0, len - 9) + 'KB';
+        } else if (len >= 18 && len < 22) {
+            str1 = str.substr(0, len - 16)
+            len1 = str1.length
+            if (len1 > 3) {
+                str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+            }
+            str1 += '万兆'
+
+            // str = str.substr(0, len - 12) + 'MB';
+        }
+        // else if (len >= 18 && len < 21) {
+        //     str1 = str.substr(0, len - 15)
+        //     len1 = str1.length
+        //     if (len1 > 3) {
+        //         str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+        //     }
+        //     str1 += 'GB'
+
+        //     // str = str.substr(0, len - 15) + 'GB';
+        // } else if (len >= 21 && len < 24) {
+        //     str1 = str.substr(0, len - 18)
+        //     len1 = str1.length
+        //     if (len1 > 3) {
+        //         str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+        //     }
+        //     str1 += 'TB'
+
+        //     // str = str.substr(0, len - 18) + 'TB';
+        // } else if (len >= 24 && len < 27) {
+        //     str1 = str.substr(0, len - 21)
+        //     len1 = str1.length
+        //     if (len1 > 3) {
+        //         str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+        //     }
+        //     str1 += 'AB'
+
+        //     // str = str.substr(0, len - 18) + 'TB';
+        // } else if (len >= 27 && len < 30) {
+        //     str1 = str.substr(0, len - 24)
+        //     len1 = str1.length
+        //     if (len1 > 3) {
+        //         str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+        //     }
+        //     str1 += 'BB'
+
+        //     // str = str.substr(0, len - 18) + 'TB';
+        // } else if (len >= 30 && len < 33) {
+        //     str1 = str.substr(0, len - 27)
+        //     len1 = str1.length
+        //     if (len1 > 3) {
+        //         str1 = str1.substr(0, len1 - 3) + ',' + str1.substr(len1 - 3)
+        //     }
+        //     str1 += 'CB'
+
+        //     // str = str.substr(0, len - 18) + 'TB';
+        // }
+        //console.log("STR:" + str1);
+        return str1;
+    }
+
+
+    /**
+     * 倒计时转换为时间格式(h:m:s) ,可自定义
+     * @param t 秒
+     * @param f 格式
+     */
+    public static ParseTime2Format(t: number, f: string = "h:m:s"): string {
+        var d: number = Math.floor(t / 24 / 3600);
+        var h: number = Math.floor((t / 3600) % 24);
+        var m: number = Math.floor((t % 3600) / 60);
+        var s: number = (t % 3600) % 60;
+
+        function parse_format(t: number): string {
+            var s: string = t.toString();
+            if (t < 10) {
+                s = "0" + t;
+            }
+            return s;
+        }
+        if (f.indexOf("d") != -1) {
+            f = f.replace(/d/g, parse_format(d));
+        }
+        else {
+            h += d * 24;
+        }
+        if (f.indexOf("h") != -1) {
+            f = f.replace(/h/g, parse_format(h));
+        } else {
+            m += h * 60;
+        }
+        if (f.indexOf("m") != -1) {
+            f = f.replace(/m/g, parse_format(m));
+        } else {
+            if (f.indexOf("h") != -1) {
+                s += m * 60;
+            } else {
+                s = t;
+            }
+        }
+        if (f.indexOf("s") != -1) {
+            f = f.replace(/s/g, parse_format(s));
+        }
+        return f;
+    }
+
+    // 随机生成32位字符串
+    static randomString(len = 32) {
+        let $chars =
+            'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
+        let maxPos = $chars.length
+        let pwd = ''
+        for (let i = 0; i < len; i++) {
+            pwd += $chars.charAt(Math.floor(Math.random() * maxPos))
+        }
+        return pwd
+    }
+
+    //说明:
+    //  1.如果加密解密涉及到前端和后端,则这里的key要保持和后端的key一致
+    //  2.AES的算法模式有好几种(ECB,CBC,CFB,OFB),所以也要和后端保持一致
+    //  3.AES的补码方式有两种(PKS5,PKS7),所以也要和后端保持一致
+    //  4.AES的密钥长度有三种(128,192,256,默认是128),所以也要和后端保持一致
+    //  5.AES的加密结果编码方式有两种(base64和十六进制),具体怎么选择由自己定,但是加密和解密的编码方式要统一
+    //十六位十六进制数作为秘钥
+    // private static key = fun_aes.CryptoJS.enc.Utf8.parse("3454345434543454");
+    //十六位十六进制数作为秘钥偏移量
+    // private static iv = fun_aes.CryptoJS.enc.Utf8.parse('6666666666666666');
+
+    /**aes加密
+     * @param state true 存包长 false /r/n
+    */
+    static Encrypt(word, tkey, appid, state = true) {
+        let tiv = tkey.substr(0, 16)
+
+        // n = Base64.Instance.encode(n)
+        //明文拼接
+        let newStr = ''
+        if (state) {
+            // let n = this.pack(word.length)
+            // newStr = tiv + n + word + appid
+            newStr = tiv + word + appid
+            // console.log('明文拼接  ', word.length, "   n   ", n)
+        }
+        else {
+            newStr = tiv + word + '\r\n' + appid
+        }
+
+        //加密后
+        let key = CryptoJS.enc.Utf8.parse(tkey);
+        let iv = CryptoJS.enc.Utf8.parse(tiv);
+
+        newStr = CryptoJS.enc.Utf8.parse(newStr);
+
+        var encrypted = CryptoJS.AES.encrypt(newStr, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
+        encrypted = encrypted.toString()
+        // console.log('加密后  ', encrypted)
+        let mac = hmacSha256.Instance.hex_hmac_sha256(tkey, encrypted)
+
+        // console.log('-----------------------------  ')
+        // console.log('key  ', tkey)
+        // console.log('iv  ', tiv)
+        // console.log('mac ', mac)
+        // console.log('encode  ', encrypted)
+        let newStrTwo = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(tiv + encrypted + mac));
+        // console.log('最终密文      ', newStrTwo)
+        return newStrTwo
+    }
+    /** aes解密
+    * @param state true 存包长 false /r/n
+    */
+    static Decrypt(word, tkey, appid, state = true) {
+        let en = CryptoJS.enc.Base64.parse(word).toString(CryptoJS.enc.Utf8);
+        let newStrOne = en.substr(16)
+        let temp = newStrOne.substr(0, newStrOne.length - 64)
+        let de = temp
+
+        let key = CryptoJS.enc.Utf8.parse(tkey);
+        let iv = CryptoJS.enc.Utf8.parse(tkey.substr(0, 16));
+
+        var decrypt = CryptoJS.AES.decrypt(de, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
+        var decryptedStr = CryptoJS.enc.Utf8.stringify(decrypt)
+        decryptedStr = decryptedStr.toString()
+
+        // console.log('decryptedStr   ', decryptedStr)
+        let newStrThree = ''
+        if (state) {
+            newStrThree = decryptedStr.slice(16).replace(new RegExp("(.*)" + appid), '$1')
+        }
+        else {
+            newStrThree = decryptedStr.slice(16).split('\r\n')[0]
+        }
+        return newStrThree
+    }
+
+    /** for php pack( N , length ) */
+    static pack(len: number) {
+        var buf: ArrayBuffer = new ArrayBuffer(4);
+        var dataView = new DataView(buf);
+        dataView.setUint32(0, len)
+        // console.log('dataView  ', dataView)
+        let str2 = this.ab2str(buf)
+
+        // let utf8decoder = new TextDecoder();
+        // let str2 = utf8decoder.decode(buf)
+        // console.log('str2  ', str2)
+
+        // let utf8encoder = new TextEncoder();
+        // let str3 = utf8encoder.encode(str2)
+        // console.log("str3:", str3)
+
+        // let str4 = utf8decoder.decode(str3)
+        // console.log('str4  ', str4)
+
+        // let aa = fun_aes.CryptoJS.enc.Utf8.parse(str2)
+        // console.log('aa  ', aa)
+        return str2
+    }
+
+    static Utf8ArrayToStr(array) {
+        var out, i, len, c;
+        var char2, char3;
+
+        out = "";
+        len = array.length;
+        i = 0;
+        while (i < len) {
+            c = array[i++];
+            switch (c >> 4) {
+                case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
+                    // 0xxxxxxx
+                    out += String.fromCharCode(c);
+                    break;
+                case 12: case 13:
+                    // 110x xxxx   10xx xxxx
+                    char2 = array[i++];
+                    out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
+                    break;
+                case 14:
+                    // 1110 xxxx  10xx xxxx  10xx xxxx
+                    char2 = array[i++];
+                    char3 = array[i++];
+                    out += String.fromCharCode(((c & 0x0F) << 12) |
+                        ((char2 & 0x3F) << 6) |
+                        ((char3 & 0x3F) << 0));
+                    break;
+            }
+        }
+
+        return out;
+    }
+
+    //UTF-16转UTF-8
+    static utf16ToUtf8(s) {
+        if (!s) {
+            return;
+        }
+
+        var i, code, ret = [], len = s.length;
+        for (i = 0; i < len; i++) {
+            code = s.charCodeAt(i);
+            if (code > 0x0 && code <= 0x7f) {
+                //单字节
+                //UTF-16 0000 - 007F
+                //UTF-8  0xxxxxxx
+                ret.push(s.charAt(i));
+            } else if (code >= 0x80 && code <= 0x7ff) {
+                //双字节
+                //UTF-16 0080 - 07FF
+                //UTF-8  110xxxxx 10xxxxxx
+                ret.push(
+                    //110xxxxx
+                    String.fromCharCode(0xc0 | ((code >> 6) & 0x1f)),
+                    //10xxxxxx
+                    String.fromCharCode(0x80 | (code & 0x3f))
+                );
+            } else if (code >= 0x800 && code <= 0xffff) {
+                //三字节
+                //UTF-16 0800 - FFFF
+                //UTF-8  1110xxxx 10xxxxxx 10xxxxxx
+                ret.push(
+                    //1110xxxx
+                    String.fromCharCode(0xe0 | ((code >> 12) & 0xf)),
+                    //10xxxxxx
+                    String.fromCharCode(0x80 | ((code >> 6) & 0x3f)),
+                    //10xxxxxx
+                    String.fromCharCode(0x80 | (code & 0x3f))
+                );
+            }
+        }
+
+        return ret.join('');
+    }
+    //UTF-8转UTF-16
+    static utf8ToUtf16(s) {
+        if (!s) {
+            return;
+        }
+
+        var i, codes, bytes, ret = [], len = s.length;
+        for (i = 0; i < len; i++) {
+            codes = [];
+            codes.push(s.charCodeAt(i));
+            if (((codes[0] >> 7) & 0xff) == 0x0) {
+                //单字节  0xxxxxxx
+                ret.push(s.charAt(i));
+            } else if (((codes[0] >> 5) & 0xff) == 0x6) {
+                //双字节  110xxxxx 10xxxxxx
+                codes.push(s.charCodeAt(++i));
+                bytes = [];
+                bytes.push(codes[0] & 0x1f);
+                bytes.push(codes[1] & 0x3f);
+                ret.push(String.fromCharCode((bytes[0] << 6) | bytes[1]));
+            } else if (((codes[0] >> 4) & 0xff) == 0xe) {
+                //三字节  1110xxxx 10xxxxxx 10xxxxxx
+                codes.push(s.charCodeAt(++i));
+                codes.push(s.charCodeAt(++i));
+                bytes = [];
+                bytes.push((codes[0] << 4) | ((codes[1] >> 2) & 0xf));
+                bytes.push(((codes[1] & 0x3) << 6) | (codes[2] & 0x3f));
+                ret.push(String.fromCharCode((bytes[0] << 8) | bytes[1]));
+            }
+        }
+        return ret.join('');
+    }
+
+    // ArrayBuffer转为字符串,参数为ArrayBuffer对象
+    static ab2str(buf: ArrayBuffer) {
+        return String.fromCharCode.apply(null, new Uint8Array(buf));
+    }
+
+
+    static Uint8ArrayToString(fileData) {
+        var dataString = "";
+        for (var i = 0; i < fileData.length; i++) {
+            dataString += String.fromCharCode(fileData[i]);
+        }
+
+        return dataString
+    }
+
+    static stringToUint8Array(str) {
+        var arr = [];
+        for (var i = 0, j = str.length; i < j; ++i) {
+            arr.push(str.charCodeAt(i));
+        }
+
+        var tmpUint8Array = new Uint8Array(arr);
+        return tmpUint8Array
+    }
+
+    // 字符串转为ArrayBuffer对象,参数为字符串
+    static str2ab(str) {
+        var buf = new ArrayBuffer(str.length); // 每个字符占用2个字节
+        var bufView = new Uint8Array(buf);
+        for (var i = 0, strLen = str.length; i < strLen; i++) {
+            bufView[i] = str.charCodeAt(i);
+        }
+        return buf;
+    }
+
+    private static options = {
+        default_key_size: 2048,
+        default_public_exponent: new Uint8Array([0x01, 0x00, 0x01])
+    }
+
+    /*rsa加密*/
+    static RSAEncrypt(word) {
+        // console.log(window['JSEncrypt'])
+        let jsb = new window['JSEncrypt'](this.options)
+
+        //公钥
+        var publicString = '-----BEGIN PUBLIC KEY-----\n' +
+            'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuwz5V8wt525dMS+A9wOd\n' +
+            'NAjvKgxdyoXYuZSlAJEXLhvJlaXwFCKEsUg/qBBeo4nrRnwaFAjG7ItqbCWR9Ozv\n' +
+            '6oY5tMYQnFFK82XkMGbKm1gG0z9vYKhcNYgHZHi+QKAw4tLLWXWO/QBTGelEXptD\n' +
+            'azlNmdM+8wHOknTcMuIyjc9Yo5qCoNsCJpA465vnREiBezBbKB3rSw+LmrRcZcFk\n' +
+            's8hmGtjpabcQ8sCxco7mRzVh6/DomNWfNm7hUP6shrrJirwjQtaS51grlScj8KhN\n' +
+            'h+kBoiI4Ad0Xz0GHasK5hAMf3sXDsN61r0An8KTfa/nsYSJDwogPIKkeKAsmw9Df\n' +
+            'EQIDAQAB\n' +
+            '-----END PUBLIC KEY-----'
+        jsb.setPublicKey(publicString)
+        // 加密内容
+        let encrypted = jsb.encrypt(word)
+        return encrypted
+    }
+
+    /*rsa解密*/
+    // static RSADecrypt(word) {
+    //     // console.log(window['JSEncrypt'])
+    //     let jsb = new JSEncrypt(this.options)
+
+    //     //私钥
+    //     var privateString = '-----BEGIN RSA PRIVATE KEY-----\n' +
+    //         'MIIEowIBAAKCAQEAuwz5V8wt525dMS+A9wOdNAjvKgxdyoXYuZSlAJEXLhvJlaXw\n' +
+    //         'FCKEsUg/qBBeo4nrRnwaFAjG7ItqbCWR9Ozv6oY5tMYQnFFK82XkMGbKm1gG0z9v\n' +
+    //         'YKhcNYgHZHi+QKAw4tLLWXWO/QBTGelEXptDazlNmdM+8wHOknTcMuIyjc9Yo5qC\n' +
+    //         'oNsCJpA465vnREiBezBbKB3rSw+LmrRcZcFks8hmGtjpabcQ8sCxco7mRzVh6/Do\n' +
+    //         'mNWfNm7hUP6shrrJirwjQtaS51grlScj8KhNh+kBoiI4Ad0Xz0GHasK5hAMf3sXD\n' +
+    //         'sN61r0An8KTfa/nsYSJDwogPIKkeKAsmw9DfEQIDAQABAoIBAFonN6pkY5+O5uXE\n' +
+    //         '8pCbslIZGESY7z+kYT+Y8CokxBpaFD/HWb4qoO/dVakIMsT5vWcce2k6jb4GuAVl\n' +
+    //         '2kJFTKEpjnidmfXtjIVhj6jwciiLNcbtZR4eJ0s5w+5d77ywOL+qP45fhcpVNLhh\n' +
+    //         'YK2EgesVFFzWnxl6vniCUHtJ4HnOKHJCnLNP8Jv7v8yWqRhdPv+OSnXc/f8M5Nq4\n' +
+    //         'zXIjZIf84sQdI9MAZ4IUv3yUnhQIGCX/ilLiOb+u8Z02DnImpwrSurm4SWOl/W7F\n' +
+    //         'jz1LHonOnFNvoICwJUlwmSHVbSxOG4dHSxs45dSHizCxIbPyHNW0sF/u5EHz2cmw\n' +
+    //         'ZIrtmh0CgYEA91DZBmRS8f6ELIPTozOd9c9OOiW0Mn0njG2Hf59tRkUNcAVnrdT6\n' +
+    //         '1v0ziD1tnprBCQr7NKzJiU3ds4qR/Vfza2F9M894CIX3HZLZomrP+Kr0xqeogxfy\n' +
+    //         'IVQ3n6aCIR2lKG2zBuxJJCp3UhGjS1NOOvcVqK9F+0Py6LHRG7SAoMsCgYEAwZ5l\n' +
+    //         'Q2x/V9vDf3KMsQf/5noaPrxgoTH9py4JgCwK6ab9M8BtAsAZ4xs6RUd6XEMeGsv4\n' +
+    //         'rLKKZhR0vMNnec/wHb3tNEFMihKsGkgCrycl4sJQIJsNX30bungrrC2XZUEAqN9g\n' +
+    //         '1IbDKAiq6l+0YQVC+742FZ6t7IgjrgV/lj7g0BMCgYEAkSeZiT/e0vvAFeR1lecY\n' +
+    //         'wgofbs9sWOnOCYTLr2MiHskunt39QTCs3PwVf9QV/63yuF0CnaMAUp8qDVO6Zch2\n' +
+    //         'LUM12e/eEpqWNHxZUhOA5wFn0yTaKb8nNNqaHxD6dXdR1U21cs3CDAEEsV16yx4k\n' +
+    //         '30TgKHZfC5+Q9XRQOAOUL0sCgYBcq/u78cphuwYvkhxU/4c0QW0eafu2K79ErXxO\n' +
+    //         'pMX0X8EBbDDBCEFbukSBtFyUnGtkWAyGXE5x3YiicMSuQSCkm6tVP4vq6lUFn0Hp\n' +
+    //         'o8s2ZdsEQDJ+adtDvRDqMEguZpZyPbiTAI2YM83asEQdy+7rn3czkeedNuwc9vTC\n' +
+    //         'bQYdkQKBgAqApiDmh84iMQUv5DQ2ks4Ddv/jpuYp/wELTN59n+IvP7BfdkOVBcYR\n' +
+    //         'Z1MZNo9fAIdF700ijKQKKgR1r5iOHiBo4A4DybxN3FHyS348BDbuh/dg2Z6307iS\n' +
+    //         'cNCq6ajhNeTtMy2E14DEdinp/7l2o87OpAR2cGRFBEi+f2RRQ2p0\n' +
+    //         '-----END RSA PRIVATE KEY-----'
+    //     jsb.setPrivateKey(privateString)
+    //     // 解密内容
+    //     let encrypted = jsb.decrypt(word)
+    //     return encrypted
+    // }
+
+    static getLocalTime(nS) {
+        return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' ');
+    }
+
+    /** 遍历打印obj属性值 
+     * @param name  名称
+     * @param obj   要遍历的对象
+    */
+    static logObject(name, obj) {
+        let description = ''
+        for (var i in obj) {
+            var property = obj[i];
+            description += i + " = " + property + "\n";
+        }
+        console.log(name + ' \n' + description)
+    }
+
+    /** 版本对比
+     */
+    static versionCompareHandle(versionA, versionB) {
+        console.log("JS Custom Version Compare: version A is " + versionA + ', version B is ' + versionB);
+        var vA = versionA.split('.');
+        var vB = versionB.split('.');
+        for (var i = 0; i < vA.length; ++i) {
+            var a = parseInt(vA[i]);
+            var b = parseInt(vB[i] || 0);
+            if (a === b) {
+                continue;
+            }
+            else {
+                return a - b;
+            }
+        }
+        if (vB.length > vA.length) {
+            return -1;
+        }
+        else {
+            return 0;
+        }
+    }
+
+    /** 是否有apk安装包 */
+    static checkHasApk(fileName) {
+        var fullPath = jsb.fileUtils.getWritablePath() + fileName
+
+        if (jsb.fileUtils.isFileExist(fullPath)) {
+            return fullPath
+        }
+        else {
+            return ''
+        }
+    }
+
+    /** 下载文件
+     * @param url 下载地址
+     * @param fileName 存储文件名称
+     * @param successCb 成功回调
+     * @param failCb 失败回调
+     * @param progressCb 下载进度回调
+     */
+    static downFile2Local(url, fileName, successCb, failCb, progressCb): any {
+        var fullPath = jsb.fileUtils.getWritablePath() + fileName
+        // showModelLoadingDialog();//显示加载中模态框
+        if (jsb) {
+            var downloader = new jsb.Downloader();
+            downloader.setOnFileTaskSuccess(function () {
+                // removeModelLoadingDialog();//删除加载中模态框
+                console.log("DownLoadM setOnFileTaskSuccess", "")
+                if (successCb) {
+                    console.log("DownLoadM result... ", jsb.fileUtils.isFileExist(fullPath))
+                    console.log("DownLoadM setOnFileTaskSuccess fullPath...", fullPath)
+                    successCb(fullPath);
+                    // AdM.installApp()
+                }
+            });
+            downloader.setOnTaskError(function (task: any, errorCode: number, errorCodeInternal: number, errorStr: string) {
+                // removeModelLoadingDialog();
+                // showTips("文件下载失败!!!");
+                console.log("DownLoadM setOnTaskError", errorCode + " ; " + errorCodeInternal + " ; " + errorStr)
+                if (failCb) {
+                    failCb(fullPath);
+                }
+            });
+            downloader.setOnTaskProgress(function (task: any, bytesReceived: number, totalBytesReceived: number, totalBytesExpected: number) {
+                // removeModelLoadingDialog();
+                // showTips("文件下载失败!!!");
+                console.log("DownLoadM", bytesReceived + " ; " + totalBytesReceived + " ; " + totalBytesExpected)
+                if (progressCb) {
+                    progressCb(bytesReceived, totalBytesReceived, totalBytesExpected)
+                }
+            });
+            downloader.createDownloadFileTask(url, fullPath);//创建下载任务
+            return downloader
+        }
+    }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/Utils.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "40cdda51-40be-475b-a258-2f14bc854ad5",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 701 - 0
tower_sanguo/assets/MOKA/util/aes.js

@@ -0,0 +1,701 @@
+/**
+ * [description] CryptoJS v3.1.2 
+ * [description] zhuangzhudada sort out 
+ */
+var CryptoJS = CryptoJS || function(u, p) {
+  var d = {},
+      l = d.lib = {},
+      s = function() {},
+      t = l.Base = {
+          extend: function(a) {
+              s.prototype = this;
+              var c = new s;
+              a && c.mixIn(a);
+              c.hasOwnProperty("init") || (c.init = function() {
+                  c.$super.init.apply(this, arguments)
+              });
+              c.init.prototype = c;
+              c.$super = this;
+              return c
+          },
+          create: function() {
+              var a = this.extend();
+              a.init.apply(a, arguments);
+              return a
+          },
+          init: function() {},
+          mixIn: function(a) {
+              for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]);
+              a.hasOwnProperty("toString") && (this.toString = a.toString)
+          },
+          clone: function() {
+              return this.init.prototype.extend(this)
+          }
+      },
+      r = l.WordArray = t.extend({
+          init: function(a, c) {
+              a = this.words = a || [];
+              this.sigBytes = c != p ? c : 4 * a.length
+          },
+          toString: function(a) {
+              return (a || v).stringify(this)
+          },
+          concat: function(a) {
+              var c = this.words,
+                  e = a.words,
+                  j = this.sigBytes;
+              a = a.sigBytes;
+              this.clamp();
+              if (j % 4)
+                  for (var k = 0; k < a; k++) c[j + k >>> 2] |= (e[k >>> 2] >>> 24 - 8 * (k % 4) & 255) << 24 - 8 * ((j + k) % 4);
+              else if (65535 < e.length)
+                  for (k = 0; k < a; k += 4) c[j + k >>> 2] = e[k >>> 2];
+              else c.push.apply(c, e);
+              this.sigBytes += a;
+              return this
+          },
+          clamp: function() {
+              var a = this.words,
+                  c = this.sigBytes;
+              a[c >>> 2] &= 4294967295 <<
+                  32 - 8 * (c % 4);
+              a.length = u.ceil(c / 4)
+          },
+          clone: function() {
+              var a = t.clone.call(this);
+              a.words = this.words.slice(0);
+              return a
+          },
+          random: function(a) {
+              for (var c = [], e = 0; e < a; e += 4) c.push(4294967296 * u.random() | 0);
+              return new r.init(c, a)
+          }
+      }),
+      w = d.enc = {},
+      v = w.Hex = {
+          stringify: function(a) {
+              var c = a.words;
+              a = a.sigBytes;
+              for (var e = [], j = 0; j < a; j++) {
+                  var k = c[j >>> 2] >>> 24 - 8 * (j % 4) & 255;
+                  e.push((k >>> 4).toString(16));
+                  e.push((k & 15).toString(16))
+              }
+              return e.join("")
+          },
+          parse: function(a) {
+              for (var c = a.length, e = [], j = 0; j < c; j += 2) e[j >>> 3] |= parseInt(a.substr(j,
+                  2), 16) << 24 - 4 * (j % 8);
+              return new r.init(e, c / 2)
+          }
+      },
+      b = w.Latin1 = {
+          stringify: function(a) {
+              var c = a.words;
+              a = a.sigBytes;
+              for (var e = [], j = 0; j < a; j++) e.push(String.fromCharCode(c[j >>> 2] >>> 24 - 8 * (j % 4) & 255));
+              return e.join("")
+          },
+          parse: function(a) {
+              for (var c = a.length, e = [], j = 0; j < c; j++) e[j >>> 2] |= (a.charCodeAt(j) & 255) << 24 - 8 * (j % 4);
+              return new r.init(e, c)
+          }
+      },
+      x = w.Utf8 = {
+          stringify: function(a) {
+              try {
+                  return decodeURIComponent(escape(b.stringify(a)))
+              } catch (c) {
+                  throw Error("Malformed UTF-8 data");
+              }
+          },
+          parse: function(a) {
+              return b.parse(unescape(encodeURIComponent(a)))
+          }
+      },
+      q = l.BufferedBlockAlgorithm = t.extend({
+          reset: function() {
+              this._data = new r.init;
+              this._nDataBytes = 0
+          },
+          _append: function(a) {
+              "string" == typeof a && (a = x.parse(a));
+              this._data.concat(a);
+              this._nDataBytes += a.sigBytes
+          },
+          _process: function(a) {
+              var c = this._data,
+                  e = c.words,
+                  j = c.sigBytes,
+                  k = this.blockSize,
+                  b = j / (4 * k),
+                  b = a ? u.ceil(b) : u.max((b | 0) - this._minBufferSize, 0);
+              a = b * k;
+              j = u.min(4 * a, j);
+              if (a) {
+                  for (var q = 0; q < a; q += k) this._doProcessBlock(e, q);
+                  q = e.splice(0, a);
+                  c.sigBytes -= j
+              }
+              return new r.init(q, j)
+          },
+          clone: function() {
+              var a = t.clone.call(this);
+              a._data = this._data.clone();
+              return a
+          },
+          _minBufferSize: 0
+      });
+  l.Hasher = q.extend({
+      cfg: t.extend(),
+      init: function(a) {
+          this.cfg = this.cfg.extend(a);
+          this.reset()
+      },
+      reset: function() {
+          q.reset.call(this);
+          this._doReset()
+      },
+      update: function(a) {
+          this._append(a);
+          this._process();
+          return this
+      },
+      finalize: function(a) {
+          a && this._append(a);
+          return this._doFinalize()
+      },
+      blockSize: 16,
+      _createHelper: function(a) {
+          return function(b, e) {
+              return (new a.init(e)).finalize(b)
+          }
+      },
+      _createHmacHelper: function(a) {
+          return function(b, e) {
+              return (new n.HMAC.init(a,
+                  e)).finalize(b)
+          }
+      }
+  });
+  var n = d.algo = {};
+  return d
+}(Math);
+(function() {
+  var u = CryptoJS,
+      p = u.lib.WordArray;
+  u.enc.Base64 = {
+      stringify: function(d) {
+          var l = d.words,
+              p = d.sigBytes,
+              t = this._map;
+          d.clamp();
+          d = [];
+          for (var r = 0; r < p; r += 3)
+              for (var w = (l[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 16 | (l[r + 1 >>> 2] >>> 24 - 8 * ((r + 1) % 4) & 255) << 8 | l[r + 2 >>> 2] >>> 24 - 8 * ((r + 2) % 4) & 255, v = 0; 4 > v && r + 0.75 * v < p; v++) d.push(t.charAt(w >>> 6 * (3 - v) & 63));
+          if (l = t.charAt(64))
+              for (; d.length % 4;) d.push(l);
+          return d.join("")
+      },
+      parse: function(d) {
+          var l = d.length,
+              s = this._map,
+              t = s.charAt(64);
+          t && (t = d.indexOf(t), -1 != t && (l = t));
+          for (var t = [], r = 0, w = 0; w <
+              l; w++)
+              if (w % 4) {
+                  var v = s.indexOf(d.charAt(w - 1)) << 2 * (w % 4),
+                      b = s.indexOf(d.charAt(w)) >>> 6 - 2 * (w % 4);
+                  t[r >>> 2] |= (v | b) << 24 - 8 * (r % 4);
+                  r++
+              }
+          return p.create(t, r)
+      },
+      _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
+  }
+})();
+(function(u) {
+  function p(b, n, a, c, e, j, k) {
+      b = b + (n & a | ~n & c) + e + k;
+      return (b << j | b >>> 32 - j) + n
+  }
+
+  function d(b, n, a, c, e, j, k) {
+      b = b + (n & c | a & ~c) + e + k;
+      return (b << j | b >>> 32 - j) + n
+  }
+
+  function l(b, n, a, c, e, j, k) {
+      b = b + (n ^ a ^ c) + e + k;
+      return (b << j | b >>> 32 - j) + n
+  }
+
+  function s(b, n, a, c, e, j, k) {
+      b = b + (a ^ (n | ~c)) + e + k;
+      return (b << j | b >>> 32 - j) + n
+  }
+  for (var t = CryptoJS, r = t.lib, w = r.WordArray, v = r.Hasher, r = t.algo, b = [], x = 0; 64 > x; x++) b[x] = 4294967296 * u.abs(u.sin(x + 1)) | 0;
+  r = r.MD5 = v.extend({
+      _doReset: function() {
+          this._hash = new w.init([1732584193, 4023233417, 2562383102, 271733878])
+      },
+      _doProcessBlock: function(q, n) {
+          for (var a = 0; 16 > a; a++) {
+              var c = n + a,
+                  e = q[c];
+              q[c] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360
+          }
+          var a = this._hash.words,
+              c = q[n + 0],
+              e = q[n + 1],
+              j = q[n + 2],
+              k = q[n + 3],
+              z = q[n + 4],
+              r = q[n + 5],
+              t = q[n + 6],
+              w = q[n + 7],
+              v = q[n + 8],
+              A = q[n + 9],
+              B = q[n + 10],
+              C = q[n + 11],
+              u = q[n + 12],
+              D = q[n + 13],
+              E = q[n + 14],
+              x = q[n + 15],
+              f = a[0],
+              m = a[1],
+              g = a[2],
+              h = a[3],
+              f = p(f, m, g, h, c, 7, b[0]),
+              h = p(h, f, m, g, e, 12, b[1]),
+              g = p(g, h, f, m, j, 17, b[2]),
+              m = p(m, g, h, f, k, 22, b[3]),
+              f = p(f, m, g, h, z, 7, b[4]),
+              h = p(h, f, m, g, r, 12, b[5]),
+              g = p(g, h, f, m, t, 17, b[6]),
+              m = p(m, g, h, f, w, 22, b[7]),
+              f = p(f, m, g, h, v, 7, b[8]),
+              h = p(h, f, m, g, A, 12, b[9]),
+              g = p(g, h, f, m, B, 17, b[10]),
+              m = p(m, g, h, f, C, 22, b[11]),
+              f = p(f, m, g, h, u, 7, b[12]),
+              h = p(h, f, m, g, D, 12, b[13]),
+              g = p(g, h, f, m, E, 17, b[14]),
+              m = p(m, g, h, f, x, 22, b[15]),
+              f = d(f, m, g, h, e, 5, b[16]),
+              h = d(h, f, m, g, t, 9, b[17]),
+              g = d(g, h, f, m, C, 14, b[18]),
+              m = d(m, g, h, f, c, 20, b[19]),
+              f = d(f, m, g, h, r, 5, b[20]),
+              h = d(h, f, m, g, B, 9, b[21]),
+              g = d(g, h, f, m, x, 14, b[22]),
+              m = d(m, g, h, f, z, 20, b[23]),
+              f = d(f, m, g, h, A, 5, b[24]),
+              h = d(h, f, m, g, E, 9, b[25]),
+              g = d(g, h, f, m, k, 14, b[26]),
+              m = d(m, g, h, f, v, 20, b[27]),
+              f = d(f, m, g, h, D, 5, b[28]),
+              h = d(h, f,
+                  m, g, j, 9, b[29]),
+              g = d(g, h, f, m, w, 14, b[30]),
+              m = d(m, g, h, f, u, 20, b[31]),
+              f = l(f, m, g, h, r, 4, b[32]),
+              h = l(h, f, m, g, v, 11, b[33]),
+              g = l(g, h, f, m, C, 16, b[34]),
+              m = l(m, g, h, f, E, 23, b[35]),
+              f = l(f, m, g, h, e, 4, b[36]),
+              h = l(h, f, m, g, z, 11, b[37]),
+              g = l(g, h, f, m, w, 16, b[38]),
+              m = l(m, g, h, f, B, 23, b[39]),
+              f = l(f, m, g, h, D, 4, b[40]),
+              h = l(h, f, m, g, c, 11, b[41]),
+              g = l(g, h, f, m, k, 16, b[42]),
+              m = l(m, g, h, f, t, 23, b[43]),
+              f = l(f, m, g, h, A, 4, b[44]),
+              h = l(h, f, m, g, u, 11, b[45]),
+              g = l(g, h, f, m, x, 16, b[46]),
+              m = l(m, g, h, f, j, 23, b[47]),
+              f = s(f, m, g, h, c, 6, b[48]),
+              h = s(h, f, m, g, w, 10, b[49]),
+              g = s(g, h, f, m,
+                  E, 15, b[50]),
+              m = s(m, g, h, f, r, 21, b[51]),
+              f = s(f, m, g, h, u, 6, b[52]),
+              h = s(h, f, m, g, k, 10, b[53]),
+              g = s(g, h, f, m, B, 15, b[54]),
+              m = s(m, g, h, f, e, 21, b[55]),
+              f = s(f, m, g, h, v, 6, b[56]),
+              h = s(h, f, m, g, x, 10, b[57]),
+              g = s(g, h, f, m, t, 15, b[58]),
+              m = s(m, g, h, f, D, 21, b[59]),
+              f = s(f, m, g, h, z, 6, b[60]),
+              h = s(h, f, m, g, C, 10, b[61]),
+              g = s(g, h, f, m, j, 15, b[62]),
+              m = s(m, g, h, f, A, 21, b[63]);
+          a[0] = a[0] + f | 0;
+          a[1] = a[1] + m | 0;
+          a[2] = a[2] + g | 0;
+          a[3] = a[3] + h | 0
+      },
+      _doFinalize: function() {
+          var b = this._data,
+              n = b.words,
+              a = 8 * this._nDataBytes,
+              c = 8 * b.sigBytes;
+          n[c >>> 5] |= 128 << 24 - c % 32;
+          var e = u.floor(a /
+              4294967296);
+          n[(c + 64 >>> 9 << 4) + 15] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360;
+          n[(c + 64 >>> 9 << 4) + 14] = (a << 8 | a >>> 24) & 16711935 | (a << 24 | a >>> 8) & 4278255360;
+          b.sigBytes = 4 * (n.length + 1);
+          this._process();
+          b = this._hash;
+          n = b.words;
+          for (a = 0; 4 > a; a++) c = n[a], n[a] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360;
+          return b
+      },
+      clone: function() {
+          var b = v.clone.call(this);
+          b._hash = this._hash.clone();
+          return b
+      }
+  });
+  t.MD5 = v._createHelper(r);
+  t.HmacMD5 = v._createHmacHelper(r)
+})(Math);
+(function() {
+  var u = CryptoJS,
+      p = u.lib,
+      d = p.Base,
+      l = p.WordArray,
+      p = u.algo,
+      s = p.EvpKDF = d.extend({
+          cfg: d.extend({
+              keySize: 4,
+              hasher: p.MD5,
+              iterations: 1
+          }),
+          init: function(d) {
+              this.cfg = this.cfg.extend(d)
+          },
+          compute: function(d, r) {
+              for (var p = this.cfg, s = p.hasher.create(), b = l.create(), u = b.words, q = p.keySize, p = p.iterations; u.length < q;) {
+                  n && s.update(n);
+                  var n = s.update(d).finalize(r);
+                  s.reset();
+                  for (var a = 1; a < p; a++) n = s.finalize(n), s.reset();
+                  b.concat(n)
+              }
+              b.sigBytes = 4 * q;
+              return b
+          }
+      });
+  u.EvpKDF = function(d, l, p) {
+      return s.create(p).compute(d,
+          l)
+  }
+})();
+CryptoJS.lib.Cipher || function(u) {
+  var p = CryptoJS,
+      d = p.lib,
+      l = d.Base,
+      s = d.WordArray,
+      t = d.BufferedBlockAlgorithm,
+      r = p.enc.Base64,
+      w = p.algo.EvpKDF,
+      v = d.Cipher = t.extend({
+          cfg: l.extend(),
+          createEncryptor: function(e, a) {
+              return this.create(this._ENC_XFORM_MODE, e, a)
+          },
+          createDecryptor: function(e, a) {
+              return this.create(this._DEC_XFORM_MODE, e, a)
+          },
+          init: function(e, a, b) {
+              this.cfg = this.cfg.extend(b);
+              this._xformMode = e;
+              this._key = a;
+              this.reset()
+          },
+          reset: function() {
+              t.reset.call(this);
+              this._doReset()
+          },
+          process: function(e) {
+              this._append(e);
+              return this._process()
+          },
+          finalize: function(e) {
+              e && this._append(e);
+              return this._doFinalize()
+          },
+          keySize: 4,
+          ivSize: 4,
+          _ENC_XFORM_MODE: 1,
+          _DEC_XFORM_MODE: 2,
+          _createHelper: function(e) {
+              return {
+                  encrypt: function(b, k, d) {
+                      return ("string" == typeof k ? c : a).encrypt(e, b, k, d)
+                  },
+                  decrypt: function(b, k, d) {
+                      return ("string" == typeof k ? c : a).decrypt(e, b, k, d)
+                  }
+              }
+          }
+      });
+  d.StreamCipher = v.extend({
+      _doFinalize: function() {
+          return this._process(!0)
+      },
+      blockSize: 1
+  });
+  var b = p.mode = {},
+      x = function(e, a, b) {
+          var c = this._iv;
+          c ? this._iv = u : c = this._prevBlock;
+          for (var d = 0; d < b; d++) e[a + d] ^=
+              c[d]
+      },
+      q = (d.BlockCipherMode = l.extend({
+          createEncryptor: function(e, a) {
+              return this.Encryptor.create(e, a)
+          },
+          createDecryptor: function(e, a) {
+              return this.Decryptor.create(e, a)
+          },
+          init: function(e, a) {
+              this._cipher = e;
+              this._iv = a
+          }
+      })).extend();
+  q.Encryptor = q.extend({
+      processBlock: function(e, a) {
+          var b = this._cipher,
+              c = b.blockSize;
+          x.call(this, e, a, c);
+          b.encryptBlock(e, a);
+          this._prevBlock = e.slice(a, a + c)
+      }
+  });
+  q.Decryptor = q.extend({
+      processBlock: function(e, a) {
+          var b = this._cipher,
+              c = b.blockSize,
+              d = e.slice(a, a + c);
+          b.decryptBlock(e, a);
+          x.call(this,
+              e, a, c);
+          this._prevBlock = d
+      }
+  });
+  b = b.CBC = q;
+  q = (p.pad = {}).Pkcs7 = {
+      pad: function(a, b) {
+          for (var c = 4 * b, c = c - a.sigBytes % c, d = c << 24 | c << 16 | c << 8 | c, l = [], n = 0; n < c; n += 4) l.push(d);
+          c = s.create(l, c);
+          a.concat(c)
+      },
+      unpad: function(a) {
+          a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255
+      }
+  };
+  d.BlockCipher = v.extend({
+      cfg: v.cfg.extend({
+          mode: b,
+          padding: q
+      }),
+      reset: function() {
+          v.reset.call(this);
+          var a = this.cfg,
+              b = a.iv,
+              a = a.mode;
+          if (this._xformMode == this._ENC_XFORM_MODE) var c = a.createEncryptor;
+          else c = a.createDecryptor, this._minBufferSize = 1;
+          this._mode = c.call(a,
+              this, b && b.words)
+      },
+      _doProcessBlock: function(a, b) {
+          this._mode.processBlock(a, b)
+      },
+      _doFinalize: function() {
+          var a = this.cfg.padding;
+          if (this._xformMode == this._ENC_XFORM_MODE) {
+              a.pad(this._data, this.blockSize);
+              var b = this._process(!0)
+          } else b = this._process(!0), a.unpad(b);
+          return b
+      },
+      blockSize: 4
+  });
+  var n = d.CipherParams = l.extend({
+          init: function(a) {
+              this.mixIn(a)
+          },
+          toString: function(a) {
+              return (a || this.formatter).stringify(this)
+          }
+      }),
+      b = (p.format = {}).OpenSSL = {
+          stringify: function(a) {
+              var b = a.ciphertext;
+              a = a.salt;
+              return (a ? s.create([1398893684,
+                  1701076831
+              ]).concat(a).concat(b) : b).toString(r)
+          },
+          parse: function(a) {
+              a = r.parse(a);
+              var b = a.words;
+              if (1398893684 == b[0] && 1701076831 == b[1]) {
+                  var c = s.create(b.slice(2, 4));
+                  b.splice(0, 4);
+                  a.sigBytes -= 16
+              }
+              return n.create({
+                  ciphertext: a,
+                  salt: c
+              })
+          }
+      },
+      a = d.SerializableCipher = l.extend({
+          cfg: l.extend({
+              format: b
+          }),
+          encrypt: function(a, b, c, d) {
+              d = this.cfg.extend(d);
+              var l = a.createEncryptor(c, d);
+              b = l.finalize(b);
+              l = l.cfg;
+              return n.create({
+                  ciphertext: b,
+                  key: c,
+                  iv: l.iv,
+                  algorithm: a,
+                  mode: l.mode,
+                  padding: l.padding,
+                  blockSize: a.blockSize,
+                  formatter: d.format
+              })
+          },
+          decrypt: function(a, b, c, d) {
+              d = this.cfg.extend(d);
+              b = this._parse(b, d.format);
+              return a.createDecryptor(c, d).finalize(b.ciphertext)
+          },
+          _parse: function(a, b) {
+              return "string" == typeof a ? b.parse(a, this) : a
+          }
+      }),
+      p = (p.kdf = {}).OpenSSL = {
+          execute: function(a, b, c, d) {
+              d || (d = s.random(8));
+              a = w.create({
+                  keySize: b + c
+              }).compute(a, d);
+              c = s.create(a.words.slice(b), 4 * c);
+              a.sigBytes = 4 * b;
+              return n.create({
+                  key: a,
+                  iv: c,
+                  salt: d
+              })
+          }
+      },
+      c = d.PasswordBasedCipher = a.extend({
+          cfg: a.cfg.extend({
+              kdf: p
+          }),
+          encrypt: function(b, c, d, l) {
+              l = this.cfg.extend(l);
+              d = l.kdf.execute(d,
+                  b.keySize, b.ivSize);
+              l.iv = d.iv;
+              b = a.encrypt.call(this, b, c, d.key, l);
+              b.mixIn(d);
+              return b
+          },
+          decrypt: function(b, c, d, l) {
+              l = this.cfg.extend(l);
+              c = this._parse(c, l.format);
+              d = l.kdf.execute(d, b.keySize, b.ivSize, c.salt);
+              l.iv = d.iv;
+              return a.decrypt.call(this, b, c, d.key, l)
+          }
+      })
+}();
+(function() {
+  for (var u = CryptoJS, p = u.lib.BlockCipher, d = u.algo, l = [], s = [], t = [], r = [], w = [], v = [], b = [], x = [], q = [], n = [], a = [], c = 0; 256 > c; c++) a[c] = 128 > c ? c << 1 : c << 1 ^ 283;
+  for (var e = 0, j = 0, c = 0; 256 > c; c++) {
+      var k = j ^ j << 1 ^ j << 2 ^ j << 3 ^ j << 4,
+          k = k >>> 8 ^ k & 255 ^ 99;
+      l[e] = k;
+      s[k] = e;
+      var z = a[e],
+          F = a[z],
+          G = a[F],
+          y = 257 * a[k] ^ 16843008 * k;
+      t[e] = y << 24 | y >>> 8;
+      r[e] = y << 16 | y >>> 16;
+      w[e] = y << 8 | y >>> 24;
+      v[e] = y;
+      y = 16843009 * G ^ 65537 * F ^ 257 * z ^ 16843008 * e;
+      b[k] = y << 24 | y >>> 8;
+      x[k] = y << 16 | y >>> 16;
+      q[k] = y << 8 | y >>> 24;
+      n[k] = y;
+      e ? (e = z ^ a[a[a[G ^ z]]], j ^= a[a[j]]) : e = j = 1
+  }
+  var H = [0, 1, 2, 4, 8,
+          16, 32, 64, 128, 27, 54
+      ],
+      d = d.AES = p.extend({
+          _doReset: function() {
+              for (var a = this._key, c = a.words, d = a.sigBytes / 4, a = 4 * ((this._nRounds = d + 6) + 1), e = this._keySchedule = [], j = 0; j < a; j++)
+                  if (j < d) e[j] = c[j];
+                  else {
+                      var k = e[j - 1];
+                      j % d ? 6 < d && 4 == j % d && (k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255]) : (k = k << 8 | k >>> 24, k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255], k ^= H[j / d | 0] << 24);
+                      e[j] = e[j - d] ^ k
+                  }
+              c = this._invKeySchedule = [];
+              for (d = 0; d < a; d++) j = a - d, k = d % 4 ? e[j] : e[j - 4], c[d] = 4 > d || 4 >= j ? k : b[l[k >>> 24]] ^ x[l[k >>> 16 & 255]] ^ q[l[k >>>
+                  8 & 255]] ^ n[l[k & 255]]
+          },
+          encryptBlock: function(a, b) {
+              this._doCryptBlock(a, b, this._keySchedule, t, r, w, v, l)
+          },
+          decryptBlock: function(a, c) {
+              var d = a[c + 1];
+              a[c + 1] = a[c + 3];
+              a[c + 3] = d;
+              this._doCryptBlock(a, c, this._invKeySchedule, b, x, q, n, s);
+              d = a[c + 1];
+              a[c + 1] = a[c + 3];
+              a[c + 3] = d
+          },
+          _doCryptBlock: function(a, b, c, d, e, j, l, f) {
+              for (var m = this._nRounds, g = a[b] ^ c[0], h = a[b + 1] ^ c[1], k = a[b + 2] ^ c[2], n = a[b + 3] ^ c[3], p = 4, r = 1; r < m; r++) var q = d[g >>> 24] ^ e[h >>> 16 & 255] ^ j[k >>> 8 & 255] ^ l[n & 255] ^ c[p++],
+                  s = d[h >>> 24] ^ e[k >>> 16 & 255] ^ j[n >>> 8 & 255] ^ l[g & 255] ^ c[p++],
+                  t =
+                  d[k >>> 24] ^ e[n >>> 16 & 255] ^ j[g >>> 8 & 255] ^ l[h & 255] ^ c[p++],
+                  n = d[n >>> 24] ^ e[g >>> 16 & 255] ^ j[h >>> 8 & 255] ^ l[k & 255] ^ c[p++],
+                  g = q,
+                  h = s,
+                  k = t;
+              q = (f[g >>> 24] << 24 | f[h >>> 16 & 255] << 16 | f[k >>> 8 & 255] << 8 | f[n & 255]) ^ c[p++];
+              s = (f[h >>> 24] << 24 | f[k >>> 16 & 255] << 16 | f[n >>> 8 & 255] << 8 | f[g & 255]) ^ c[p++];
+              t = (f[k >>> 24] << 24 | f[n >>> 16 & 255] << 16 | f[g >>> 8 & 255] << 8 | f[h & 255]) ^ c[p++];
+              n = (f[n >>> 24] << 24 | f[g >>> 16 & 255] << 16 | f[h >>> 8 & 255] << 8 | f[k & 255]) ^ c[p++];
+              a[b] = q;
+              a[b + 1] = s;
+              a[b + 2] = t;
+              a[b + 3] = n
+          },
+          keySize: 8
+      });
+  u.AES = p._createHelper(d)
+})();
+
+module.exports = CryptoJS

+ 9 - 0
tower_sanguo/assets/MOKA/util/aes.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "2d8f592c-531a-4b6e-a815-5640bccaa555",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 325 - 0
tower_sanguo/assets/MOKA/util/hmacSha256.ts

@@ -0,0 +1,325 @@
+/*
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
+ * in FIPS 180-2
+ * Version 2.2 Copyright Angel Marin, Paul Johnston 2000 - 2009.
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for details.
+ * Also http://anmar.eu.org/projects/jssha2/
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+
+export class hmacSha256 {
+      constructor() {
+
+      }
+
+      private static instance: hmacSha256 = null
+      static get Instance(): hmacSha256 {
+            if (!this.instance) {
+                  this.instance = new hmacSha256()
+            }
+            return this.instance
+      }
+
+      private hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase    */
+      private b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance  */
+
+      /*
+       * These are the functions you'll usually want to call
+       * They take string arguments and return either hex or base-64 encoded strings
+       */
+      hex_sha256(s) { return this.rstr2hex(this.rstr_sha256(this.str2rstr_utf8(s))); }
+      b64_sha256(s) { return this.rstr2b64(this.rstr_sha256(this.str2rstr_utf8(s))); }
+      any_sha256(s, e) { return this.rstr2any(this.rstr_sha256(this.str2rstr_utf8(s)), e); }
+      hex_hmac_sha256(k, d) { return this.rstr2hex(this.rstr_hmac_sha256(this.str2rstr_utf8(k), this.str2rstr_utf8(d))); }
+      b64_hmac_sha256(k, d) { return this.rstr2b64(this.rstr_hmac_sha256(this.str2rstr_utf8(k), this.str2rstr_utf8(d))); }
+      any_hmac_sha256(k, d, e) { return this.rstr2any(this.rstr_hmac_sha256(this.str2rstr_utf8(k), this.str2rstr_utf8(d)), e); }
+
+      /*
+       * Perform a simple self-test to see if the VM is working
+       */
+      sha256_vm_test() {
+            return this.hex_sha256("abc").toLowerCase() ==
+                  "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad";
+      }
+
+      /*
+       * Calculate the sha256 of a raw string
+       */
+      rstr_sha256(s) {
+            return this.binb2rstr(this.binb_sha256(this.rstr2binb(s), s.length * 8));
+      }
+
+      /*
+       * Calculate the HMAC-sha256 of a key and some data (raw strings)
+       */
+      rstr_hmac_sha256(key, data) {
+            var bkey = this.rstr2binb(key);
+            if (bkey.length > 16) bkey = this.binb_sha256(bkey, key.length * 8);
+
+            var ipad = Array(16), opad = Array(16);
+            for (var i = 0; i < 16; i++) {
+                  ipad[i] = bkey[i] ^ 0x36363636;
+                  opad[i] = bkey[i] ^ 0x5C5C5C5C;
+            }
+
+            var hash = this.binb_sha256(ipad.concat(this.rstr2binb(data)), 512 + data.length * 8);
+            return this.binb2rstr(this.binb_sha256(opad.concat(hash), 512 + 256));
+      }
+
+      /*
+       * Convert a raw string to a hex string
+       */
+      rstr2hex(input) {
+            try { this.hexcase } catch (e) { this.hexcase = 0; }
+            var hex_tab = this.hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+            var output = "";
+            var x;
+            for (var i = 0; i < input.length; i++) {
+                  x = input.charCodeAt(i);
+                  output += hex_tab.charAt((x >>> 4) & 0x0F)
+                        + hex_tab.charAt(x & 0x0F);
+            }
+            return output;
+      }
+
+      /*
+       * Convert a raw string to a base-64 string
+       */
+      rstr2b64(input) {
+            try { this.b64pad } catch (e) { this.b64pad = ''; }
+            var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+            var output = "";
+            var len = input.length;
+            for (var i = 0; i < len; i += 3) {
+                  var triplet = (input.charCodeAt(i) << 16)
+                        | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0)
+                        | (i + 2 < len ? input.charCodeAt(i + 2) : 0);
+                  for (var j = 0; j < 4; j++) {
+                        if (i * 8 + j * 6 > input.length * 8) output += this.b64pad;
+                        else output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F);
+                  }
+            }
+            return output;
+      }
+
+      /*
+       * Convert a raw string to an arbitrary string encoding
+       */
+      rstr2any(input, encoding) {
+            var divisor = encoding.length;
+            var remainders = Array();
+            var i, q, x, quotient;
+
+            /* Convert to an array of 16-bit big-endian values, forming the dividend */
+            var dividend = Array(Math.ceil(input.length / 2));
+            for (i = 0; i < dividend.length; i++) {
+                  dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
+            }
+
+            /*
+             * Repeatedly perform a long division. The binary array forms the dividend,
+             * the length of the encoding is the divisor. Once computed, the quotient
+             * forms the dividend for the next step. We stop when the dividend is zero.
+             * All remainders are stored for later use.
+             */
+            while (dividend.length > 0) {
+                  quotient = Array();
+                  x = 0;
+                  for (i = 0; i < dividend.length; i++) {
+                        x = (x << 16) + dividend[i];
+                        q = Math.floor(x / divisor);
+                        x -= q * divisor;
+                        if (quotient.length > 0 || q > 0)
+                              quotient[quotient.length] = q;
+                  }
+                  remainders[remainders.length] = x;
+                  dividend = quotient;
+            }
+
+            /* Convert the remainders to the output string */
+            var output = "";
+            for (i = remainders.length - 1; i >= 0; i--)
+                  output += encoding.charAt(remainders[i]);
+
+            /* Append leading zero equivalents */
+            var full_length = Math.ceil(input.length * 8 /
+                  (Math.log(encoding.length) / Math.log(2)))
+            for (i = output.length; i < full_length; i++)
+                  output = encoding[0] + output;
+
+            return output;
+      }
+
+      /*
+       * Encode a string as utf-8.
+       * For efficiency, this assumes the input is valid utf-16.
+       */
+      str2rstr_utf8(input) {
+            var output = "";
+            var i = -1;
+            var x, y;
+
+            while (++i < input.length) {
+                  /* Decode utf-16 surrogate pairs */
+                  x = input.charCodeAt(i);
+                  y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
+                  if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) {
+                        x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
+                        i++;
+                  }
+
+                  /* Encode output as utf-8 */
+                  if (x <= 0x7F)
+                        output += String.fromCharCode(x);
+                  else if (x <= 0x7FF)
+                        output += String.fromCharCode(0xC0 | ((x >>> 6) & 0x1F),
+                              0x80 | (x & 0x3F));
+                  else if (x <= 0xFFFF)
+                        output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
+                              0x80 | ((x >>> 6) & 0x3F),
+                              0x80 | (x & 0x3F));
+                  else if (x <= 0x1FFFFF)
+                        output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
+                              0x80 | ((x >>> 12) & 0x3F),
+                              0x80 | ((x >>> 6) & 0x3F),
+                              0x80 | (x & 0x3F));
+            }
+            return output;
+      }
+
+      /*
+       * Encode a string as utf-16
+       */
+      str2rstr_utf16le(input) {
+            var output = "";
+            for (var i = 0; i < input.length; i++)
+                  output += String.fromCharCode(input.charCodeAt(i) & 0xFF,
+                        (input.charCodeAt(i) >>> 8) & 0xFF);
+            return output;
+      }
+
+      str2rstr_utf16be(input) {
+            var output = "";
+            for (var i = 0; i < input.length; i++)
+                  output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
+                        input.charCodeAt(i) & 0xFF);
+            return output;
+      }
+
+      /*
+       * Convert a raw string to an array of big-endian words
+       * Characters >255 have their high-byte silently ignored.
+       */
+      rstr2binb(input) {
+            var output = Array(input.length >> 2);
+            for (var i = 0; i < output.length; i++)
+                  output[i] = 0;
+            for (var i = 0; i < input.length * 8; i += 8)
+                  output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);
+            return output;
+      }
+
+      /*
+       * Convert an array of big-endian words to a string
+       */
+      binb2rstr(input) {
+            var output = "";
+            for (var i = 0; i < input.length * 32; i += 8)
+                  output += String.fromCharCode((input[i >> 5] >>> (24 - i % 32)) & 0xFF);
+            return output;
+      }
+
+      /*
+       * Main sha256 function, with its support functions
+       */
+      sha256_S(X, n) { return (X >>> n) | (X << (32 - n)); }
+      sha256_R(X, n) { return (X >>> n); }
+      sha256_Ch(x, y, z) { return ((x & y) ^ ((~x) & z)); }
+      sha256_Maj(x, y, z) { return ((x & y) ^ (x & z) ^ (y & z)); }
+      sha256_Sigma0256(x) { return (this.sha256_S(x, 2) ^ this.sha256_S(x, 13) ^ this.sha256_S(x, 22)); }
+      sha256_Sigma1256(x) { return (this.sha256_S(x, 6) ^ this.sha256_S(x, 11) ^ this.sha256_S(x, 25)); }
+      sha256_Gamma0256(x) { return (this.sha256_S(x, 7) ^ this.sha256_S(x, 18) ^ this.sha256_R(x, 3)); }
+      sha256_Gamma1256(x) { return (this.sha256_S(x, 17) ^ this.sha256_S(x, 19) ^ this.sha256_R(x, 10)); }
+      sha256_Sigma0512(x) { return (this.sha256_S(x, 28) ^ this.sha256_S(x, 34) ^ this.sha256_S(x, 39)); }
+      sha256_Sigma1512(x) { return (this.sha256_S(x, 14) ^ this.sha256_S(x, 18) ^ this.sha256_S(x, 41)); }
+      sha256_Gamma0512(x) { return (this.sha256_S(x, 1) ^ this.sha256_S(x, 8) ^ this.sha256_R(x, 7)); }
+      sha256_Gamma1512(x) { return (this.sha256_S(x, 19) ^ this.sha256_S(x, 61) ^ this.sha256_R(x, 6)); }
+
+      private sha256_K = new Array
+            (
+                  1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993,
+                  -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987,
+                  1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522,
+                  264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986,
+                  -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585,
+                  113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291,
+                  1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885,
+                  -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344,
+                  430227734, 506948616, 659060556, 883997877, 958139571, 1322822218,
+                  1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872,
+                  -1866530822, -1538233109, -1090935817, -965641998
+            );
+
+      binb_sha256(m, l) {
+            var HASH = new Array(1779033703, -1150833019, 1013904242, -1521486534,
+                  1359893119, -1694144372, 528734635, 1541459225);
+            var W = new Array(64);
+            var a, b, c, d, e, f, g, h;
+            var i, j, T1, T2;
+
+            /* append padding */
+            m[l >> 5] |= 0x80 << (24 - l % 32);
+            m[((l + 64 >> 9) << 4) + 15] = l;
+
+            for (i = 0; i < m.length; i += 16) {
+                  a = HASH[0];
+                  b = HASH[1];
+                  c = HASH[2];
+                  d = HASH[3];
+                  e = HASH[4];
+                  f = HASH[5];
+                  g = HASH[6];
+                  h = HASH[7];
+
+                  for (j = 0; j < 64; j++) {
+                        if (j < 16) W[j] = m[j + i];
+                        else W[j] = this.safe_add(this.safe_add(this.safe_add(this.sha256_Gamma1256(W[j - 2]), W[j - 7]),
+                              this.sha256_Gamma0256(W[j - 15])), W[j - 16]);
+
+                        T1 = this.safe_add(this.safe_add(this.safe_add(this.safe_add(h, this.sha256_Sigma1256(e)), this.sha256_Ch(e, f, g)),
+                              this.sha256_K[j]), W[j]);
+                        T2 = this.safe_add(this.sha256_Sigma0256(a), this.sha256_Maj(a, b, c));
+                        h = g;
+                        g = f;
+                        f = e;
+                        e = this.safe_add(d, T1);
+                        d = c;
+                        c = b;
+                        b = a;
+                        a = this.safe_add(T1, T2);
+                  }
+
+                  HASH[0] = this.safe_add(a, HASH[0]);
+                  HASH[1] = this.safe_add(b, HASH[1]);
+                  HASH[2] = this.safe_add(c, HASH[2]);
+                  HASH[3] = this.safe_add(d, HASH[3]);
+                  HASH[4] = this.safe_add(e, HASH[4]);
+                  HASH[5] = this.safe_add(f, HASH[5]);
+                  HASH[6] = this.safe_add(g, HASH[6]);
+                  HASH[7] = this.safe_add(h, HASH[7]);
+            }
+            return HASH;
+      }
+
+      safe_add(x, y) {
+            var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+            var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+            return (msw << 16) | (lsw & 0xFFFF);
+      }
+}

+ 9 - 0
tower_sanguo/assets/MOKA/util/hmacSha256.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "eef35328-1dc8-46d4-97d0-49368325546c",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/MOKA/util/rsa.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "8101db82-a764-4d7d-bea2-f345f265c5d1",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 87 - 0
tower_sanguo/assets/MOKA/util/rsa/jsencrypt.d.ts

@@ -0,0 +1,87 @@
+declare class JSEncrypt{
+
+  constructor(options?);
+  /**
+   * Method to set the rsa key parameter (one method is enough to set both the public
+   * and the private key, since the private key contains the public key paramenters)
+   * Log a warning if logs are enabled
+   * @param {Object|string} key the pem encoded string or an object (with or without header/footer)
+   * @public
+   */
+  setKey(key: string);
+  /**
+   * Proxy method for setKey, for api compatibility
+   * @see setKey
+   * @public
+   */
+  setPrivateKey(privkey: string);
+  /**
+   * Proxy method for setKey, for api compatibility
+   * @see setKey
+   * @public
+   */
+  setPublicKey(pubkey: string);
+
+  /**
+   * Proxy method for RSAKey object's decrypt, decrypt the string using the private
+   * components of the rsa key object. Note that if the object was not set will be created
+   * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
+   * @param {string} string base64 encoded crypted string to decrypt
+   * @return {string} the decrypted string
+   * @public
+   */
+  decrypt(string): string|false;
+
+/**
+ * Proxy method for RSAKey object's encrypt, encrypt the string using the public
+ * components of the rsa key object. Note that if the object was not set will be created
+ * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
+ * @param {string} string the string to encrypt
+ * @return {string} the encrypted string encoded in base64
+ * @public
+ */
+  encrypt(string) :string|false;
+
+/**
+ * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
+ * will be created and returned
+ * @param {callback} [cb] the callback to be called if we want the key to be generated
+ * in an async fashion
+ * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
+ * @public
+ */
+getKey(cb);
+
+/**
+ * Returns the pem encoded representation of the private key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the private key WITH header and footer
+ * @public
+ */
+getPrivateKey();
+
+/**
+ * Returns the pem encoded representation of the private key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the private key WITHOUT header and footer
+ * @public
+ */
+getPrivateKeyB64();
+
+/**
+ * Returns the pem encoded representation of the public key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the public key WITH header and footer
+ * @public
+ */
+getPublicKey();
+
+/**
+ * Returns the pem encoded representation of the public key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the public key WITHOUT header and footer
+ * @public
+ */
+getPublicKeyB64();
+
+}

+ 5 - 0
tower_sanguo/assets/MOKA/util/rsa/jsencrypt.d.ts.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "2.0.0",
+  "uuid": "1b3ea26c-37e7-4b10-85ff-258565c822cc",
+  "subMetas": {}
+}

+ 4353 - 0
tower_sanguo/assets/MOKA/util/rsa/jsencrypt.js

@@ -0,0 +1,4353 @@
+/*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */
+(function (root, factory) {
+  if (typeof define === 'function' && define.amd) {
+    // AMD
+    define(['exports'], factory);
+  } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
+    // Node, CommonJS-like
+    factory(module.exports);
+  } else {
+    factory(root);
+  }
+})(this, function (exports) {
+  // Copyright (c) 2005  Tom Wu
+// All Rights Reserved.
+// See "LICENSE" for details.
+
+// Basic JavaScript BN library - subset useful for RSA encryption.
+
+// Bits per digit
+var dbits;
+
+// JavaScript engine analysis
+var canary = 0xdeadbeefcafe;
+var j_lm = ((canary&0xffffff)==0xefcafe);
+
+// (public) Constructor
+function BigInteger(a,b,c) {
+  if(a != null)
+    if("number" == typeof a) this.fromNumber(a,b,c);
+    else if(b == null && "string" != typeof a) this.fromString(a,256);
+    else this.fromString(a,b);
+}
+
+// return new, unset BigInteger
+function nbi() { return new BigInteger(null); }
+
+// am: Compute w_j += (x*this_i), propagate carries,
+// c is initial carry, returns final carry.
+// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
+// We need to select the fastest one that works in this environment.
+
+// am1: use a single mult and divide to get the high bits,
+// max digit bits should be 26 because
+// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
+function am1(i,x,w,j,c,n) {
+  while(--n >= 0) {
+    var v = x*this[i++]+w[j]+c;
+    c = Math.floor(v/0x4000000);
+    w[j++] = v&0x3ffffff;
+  }
+  return c;
+}
+// am2 avoids a big mult-and-extract completely.
+// Max digit bits should be <= 30 because we do bitwise ops
+// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
+function am2(i,x,w,j,c,n) {
+  var xl = x&0x7fff, xh = x>>15;
+  while(--n >= 0) {
+    var l = this[i]&0x7fff;
+    var h = this[i++]>>15;
+    var m = xh*l+h*xl;
+    l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
+    c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
+    w[j++] = l&0x3fffffff;
+  }
+  return c;
+}
+// Alternately, set max digit bits to 28 since some
+// browsers slow down when dealing with 32-bit numbers.
+function am3(i,x,w,j,c,n) {
+  var xl = x&0x3fff, xh = x>>14;
+  while(--n >= 0) {
+    var l = this[i]&0x3fff;
+    var h = this[i++]>>14;
+    var m = xh*l+h*xl;
+    l = xl*l+((m&0x3fff)<<14)+w[j]+c;
+    c = (l>>28)+(m>>14)+xh*h;
+    w[j++] = l&0xfffffff;
+  }
+  return c;
+}
+if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
+  BigInteger.prototype.am = am2;
+  dbits = 30;
+}
+else if(j_lm && (navigator.appName != "Netscape")) {
+  BigInteger.prototype.am = am1;
+  dbits = 26;
+}
+else { // Mozilla/Netscape seems to prefer am3
+  BigInteger.prototype.am = am3;
+  dbits = 28;
+}
+
+BigInteger.prototype.DB = dbits;
+BigInteger.prototype.DM = ((1<<dbits)-1);
+BigInteger.prototype.DV = (1<<dbits);
+
+var BI_FP = 52;
+BigInteger.prototype.FV = Math.pow(2,BI_FP);
+BigInteger.prototype.F1 = BI_FP-dbits;
+BigInteger.prototype.F2 = 2*dbits-BI_FP;
+
+// Digit conversions
+var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
+var BI_RC = new Array();
+var rr,vv;
+rr = "0".charCodeAt(0);
+for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
+rr = "a".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+rr = "A".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+
+function int2char(n) { return BI_RM.charAt(n); }
+function intAt(s,i) {
+  var c = BI_RC[s.charCodeAt(i)];
+  return (c==null)?-1:c;
+}
+
+// (protected) copy this to r
+function bnpCopyTo(r) {
+  for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
+  r.t = this.t;
+  r.s = this.s;
+}
+
+// (protected) set from integer value x, -DV <= x < DV
+function bnpFromInt(x) {
+  this.t = 1;
+  this.s = (x<0)?-1:0;
+  if(x > 0) this[0] = x;
+  else if(x < -1) this[0] = x+this.DV;
+  else this.t = 0;
+}
+
+// return bigint initialized to value
+function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
+
+// (protected) set from string and radix
+function bnpFromString(s,b) {
+  var k;
+  if(b == 16) k = 4;
+  else if(b == 8) k = 3;
+  else if(b == 256) k = 8; // byte array
+  else if(b == 2) k = 1;
+  else if(b == 32) k = 5;
+  else if(b == 4) k = 2;
+  else { this.fromRadix(s,b); return; }
+  this.t = 0;
+  this.s = 0;
+  var i = s.length, mi = false, sh = 0;
+  while(--i >= 0) {
+    var x = (k==8)?s[i]&0xff:intAt(s,i);
+    if(x < 0) {
+      if(s.charAt(i) == "-") mi = true;
+      continue;
+    }
+    mi = false;
+    if(sh == 0)
+      this[this.t++] = x;
+    else if(sh+k > this.DB) {
+      this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
+      this[this.t++] = (x>>(this.DB-sh));
+    }
+    else
+      this[this.t-1] |= x<<sh;
+    sh += k;
+    if(sh >= this.DB) sh -= this.DB;
+  }
+  if(k == 8 && (s[0]&0x80) != 0) {
+    this.s = -1;
+    if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
+  }
+  this.clamp();
+  if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) clamp off excess high words
+function bnpClamp() {
+  var c = this.s&this.DM;
+  while(this.t > 0 && this[this.t-1] == c) --this.t;
+}
+
+// (public) return string representation in given radix
+function bnToString(b) {
+  if(this.s < 0) return "-"+this.negate().toString(b);
+  var k;
+  if(b == 16) k = 4;
+  else if(b == 8) k = 3;
+  else if(b == 2) k = 1;
+  else if(b == 32) k = 5;
+  else if(b == 4) k = 2;
+  else return this.toRadix(b);
+  var km = (1<<k)-1, d, m = false, r = "", i = this.t;
+  var p = this.DB-(i*this.DB)%k;
+  if(i-- > 0) {
+    if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
+    while(i >= 0) {
+      if(p < k) {
+        d = (this[i]&((1<<p)-1))<<(k-p);
+        d |= this[--i]>>(p+=this.DB-k);
+      }
+      else {
+        d = (this[i]>>(p-=k))&km;
+        if(p <= 0) { p += this.DB; --i; }
+      }
+      if(d > 0) m = true;
+      if(m) r += int2char(d);
+    }
+  }
+  return m?r:"0";
+}
+
+// (public) -this
+function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
+
+// (public) |this|
+function bnAbs() { return (this.s<0)?this.negate():this; }
+
+// (public) return + if this > a, - if this < a, 0 if equal
+function bnCompareTo(a) {
+  var r = this.s-a.s;
+  if(r != 0) return r;
+  var i = this.t;
+  r = i-a.t;
+  if(r != 0) return (this.s<0)?-r:r;
+  while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
+  return 0;
+}
+
+// returns bit length of the integer x
+function nbits(x) {
+  var r = 1, t;
+  if((t=x>>>16) != 0) { x = t; r += 16; }
+  if((t=x>>8) != 0) { x = t; r += 8; }
+  if((t=x>>4) != 0) { x = t; r += 4; }
+  if((t=x>>2) != 0) { x = t; r += 2; }
+  if((t=x>>1) != 0) { x = t; r += 1; }
+  return r;
+}
+
+// (public) return the number of bits in "this"
+function bnBitLength() {
+  if(this.t <= 0) return 0;
+  return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
+}
+
+// (protected) r = this << n*DB
+function bnpDLShiftTo(n,r) {
+  var i;
+  for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
+  for(i = n-1; i >= 0; --i) r[i] = 0;
+  r.t = this.t+n;
+  r.s = this.s;
+}
+
+// (protected) r = this >> n*DB
+function bnpDRShiftTo(n,r) {
+  for(var i = n; i < this.t; ++i) r[i-n] = this[i];
+  r.t = Math.max(this.t-n,0);
+  r.s = this.s;
+}
+
+// (protected) r = this << n
+function bnpLShiftTo(n,r) {
+  var bs = n%this.DB;
+  var cbs = this.DB-bs;
+  var bm = (1<<cbs)-1;
+  var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
+  for(i = this.t-1; i >= 0; --i) {
+    r[i+ds+1] = (this[i]>>cbs)|c;
+    c = (this[i]&bm)<<bs;
+  }
+  for(i = ds-1; i >= 0; --i) r[i] = 0;
+  r[ds] = c;
+  r.t = this.t+ds+1;
+  r.s = this.s;
+  r.clamp();
+}
+
+// (protected) r = this >> n
+function bnpRShiftTo(n,r) {
+  r.s = this.s;
+  var ds = Math.floor(n/this.DB);
+  if(ds >= this.t) { r.t = 0; return; }
+  var bs = n%this.DB;
+  var cbs = this.DB-bs;
+  var bm = (1<<bs)-1;
+  r[0] = this[ds]>>bs;
+  for(var i = ds+1; i < this.t; ++i) {
+    r[i-ds-1] |= (this[i]&bm)<<cbs;
+    r[i-ds] = this[i]>>bs;
+  }
+  if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
+  r.t = this.t-ds;
+  r.clamp();
+}
+
+// (protected) r = this - a
+function bnpSubTo(a,r) {
+  var i = 0, c = 0, m = Math.min(a.t,this.t);
+  while(i < m) {
+    c += this[i]-a[i];
+    r[i++] = c&this.DM;
+    c >>= this.DB;
+  }
+  if(a.t < this.t) {
+    c -= a.s;
+    while(i < this.t) {
+      c += this[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c += this.s;
+  }
+  else {
+    c += this.s;
+    while(i < a.t) {
+      c -= a[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c -= a.s;
+  }
+  r.s = (c<0)?-1:0;
+  if(c < -1) r[i++] = this.DV+c;
+  else if(c > 0) r[i++] = c;
+  r.t = i;
+  r.clamp();
+}
+
+// (protected) r = this * a, r != this,a (HAC 14.12)
+// "this" should be the larger one if appropriate.
+function bnpMultiplyTo(a,r) {
+  var x = this.abs(), y = a.abs();
+  var i = x.t;
+  r.t = i+y.t;
+  while(--i >= 0) r[i] = 0;
+  for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
+  r.s = 0;
+  r.clamp();
+  if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
+}
+
+// (protected) r = this^2, r != this (HAC 14.16)
+function bnpSquareTo(r) {
+  var x = this.abs();
+  var i = r.t = 2*x.t;
+  while(--i >= 0) r[i] = 0;
+  for(i = 0; i < x.t-1; ++i) {
+    var c = x.am(i,x[i],r,2*i,0,1);
+    if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
+      r[i+x.t] -= x.DV;
+      r[i+x.t+1] = 1;
+    }
+  }
+  if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
+  r.s = 0;
+  r.clamp();
+}
+
+// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
+// r != q, this != m.  q or r may be null.
+function bnpDivRemTo(m,q,r) {
+  var pm = m.abs();
+  if(pm.t <= 0) return;
+  var pt = this.abs();
+  if(pt.t < pm.t) {
+    if(q != null) q.fromInt(0);
+    if(r != null) this.copyTo(r);
+    return;
+  }
+  if(r == null) r = nbi();
+  var y = nbi(), ts = this.s, ms = m.s;
+  var nsh = this.DB-nbits(pm[pm.t-1]);	// normalize modulus
+  if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
+  else { pm.copyTo(y); pt.copyTo(r); }
+  var ys = y.t;
+  var y0 = y[ys-1];
+  if(y0 == 0) return;
+  var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
+  var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
+  var i = r.t, j = i-ys, t = (q==null)?nbi():q;
+  y.dlShiftTo(j,t);
+  if(r.compareTo(t) >= 0) {
+    r[r.t++] = 1;
+    r.subTo(t,r);
+  }
+  BigInteger.ONE.dlShiftTo(ys,t);
+  t.subTo(y,y);	// "negative" y so we can replace sub with am later
+  while(y.t < ys) y[y.t++] = 0;
+  while(--j >= 0) {
+    // Estimate quotient digit
+    var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
+    if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {	// Try it out
+      y.dlShiftTo(j,t);
+      r.subTo(t,r);
+      while(r[i] < --qd) r.subTo(t,r);
+    }
+  }
+  if(q != null) {
+    r.drShiftTo(ys,q);
+    if(ts != ms) BigInteger.ZERO.subTo(q,q);
+  }
+  r.t = ys;
+  r.clamp();
+  if(nsh > 0) r.rShiftTo(nsh,r);	// Denormalize remainder
+  if(ts < 0) BigInteger.ZERO.subTo(r,r);
+}
+
+// (public) this mod a
+function bnMod(a) {
+  var r = nbi();
+  this.abs().divRemTo(a,null,r);
+  if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
+  return r;
+}
+
+// Modular reduction using "classic" algorithm
+function Classic(m) { this.m = m; }
+function cConvert(x) {
+  if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
+  else return x;
+}
+function cRevert(x) { return x; }
+function cReduce(x) { x.divRemTo(this.m,null,x); }
+function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+Classic.prototype.convert = cConvert;
+Classic.prototype.revert = cRevert;
+Classic.prototype.reduce = cReduce;
+Classic.prototype.mulTo = cMulTo;
+Classic.prototype.sqrTo = cSqrTo;
+
+// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
+// justification:
+//         xy == 1 (mod m)
+//         xy =  1+km
+//   xy(2-xy) = (1+km)(1-km)
+// x[y(2-xy)] = 1-k^2m^2
+// x[y(2-xy)] == 1 (mod m^2)
+// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
+// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
+// JS multiply "overflows" differently from C/C++, so care is needed here.
+function bnpInvDigit() {
+  if(this.t < 1) return 0;
+  var x = this[0];
+  if((x&1) == 0) return 0;
+  var y = x&3;		// y == 1/x mod 2^2
+  y = (y*(2-(x&0xf)*y))&0xf;	// y == 1/x mod 2^4
+  y = (y*(2-(x&0xff)*y))&0xff;	// y == 1/x mod 2^8
+  y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;	// y == 1/x mod 2^16
+  // last step - calculate inverse mod DV directly;
+  // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
+  y = (y*(2-x*y%this.DV))%this.DV;		// y == 1/x mod 2^dbits
+  // we really want the negative inverse, and -DV < y < DV
+  return (y>0)?this.DV-y:-y;
+}
+
+// Montgomery reduction
+function Montgomery(m) {
+  this.m = m;
+  this.mp = m.invDigit();
+  this.mpl = this.mp&0x7fff;
+  this.mph = this.mp>>15;
+  this.um = (1<<(m.DB-15))-1;
+  this.mt2 = 2*m.t;
+}
+
+// xR mod m
+function montConvert(x) {
+  var r = nbi();
+  x.abs().dlShiftTo(this.m.t,r);
+  r.divRemTo(this.m,null,r);
+  if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
+  return r;
+}
+
+// x/R mod m
+function montRevert(x) {
+  var r = nbi();
+  x.copyTo(r);
+  this.reduce(r);
+  return r;
+}
+
+// x = x/R mod m (HAC 14.32)
+function montReduce(x) {
+  while(x.t <= this.mt2)	// pad x so am has enough room later
+    x[x.t++] = 0;
+  for(var i = 0; i < this.m.t; ++i) {
+    // faster way of calculating u0 = x[i]*mp mod DV
+    var j = x[i]&0x7fff;
+    var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
+    // use am to combine the multiply-shift-add into one call
+    j = i+this.m.t;
+    x[j] += this.m.am(0,u0,x,i,0,this.m.t);
+    // propagate carry
+    while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
+  }
+  x.clamp();
+  x.drShiftTo(this.m.t,x);
+  if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = "x^2/R mod m"; x != r
+function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = "xy/R mod m"; x,y != r
+function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Montgomery.prototype.convert = montConvert;
+Montgomery.prototype.revert = montRevert;
+Montgomery.prototype.reduce = montReduce;
+Montgomery.prototype.mulTo = montMulTo;
+Montgomery.prototype.sqrTo = montSqrTo;
+
+// (protected) true iff this is even
+function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
+
+// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
+function bnpExp(e,z) {
+  if(e > 0xffffffff || e < 1) return BigInteger.ONE;
+  var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
+  g.copyTo(r);
+  while(--i >= 0) {
+    z.sqrTo(r,r2);
+    if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
+    else { var t = r; r = r2; r2 = t; }
+  }
+  return z.revert(r);
+}
+
+// (public) this^e % m, 0 <= e < 2^32
+function bnModPowInt(e,m) {
+  var z;
+  if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
+  return this.exp(e,z);
+}
+
+// protected
+BigInteger.prototype.copyTo = bnpCopyTo;
+BigInteger.prototype.fromInt = bnpFromInt;
+BigInteger.prototype.fromString = bnpFromString;
+BigInteger.prototype.clamp = bnpClamp;
+BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
+BigInteger.prototype.drShiftTo = bnpDRShiftTo;
+BigInteger.prototype.lShiftTo = bnpLShiftTo;
+BigInteger.prototype.rShiftTo = bnpRShiftTo;
+BigInteger.prototype.subTo = bnpSubTo;
+BigInteger.prototype.multiplyTo = bnpMultiplyTo;
+BigInteger.prototype.squareTo = bnpSquareTo;
+BigInteger.prototype.divRemTo = bnpDivRemTo;
+BigInteger.prototype.invDigit = bnpInvDigit;
+BigInteger.prototype.isEven = bnpIsEven;
+BigInteger.prototype.exp = bnpExp;
+
+// public
+BigInteger.prototype.toString = bnToString;
+BigInteger.prototype.negate = bnNegate;
+BigInteger.prototype.abs = bnAbs;
+BigInteger.prototype.compareTo = bnCompareTo;
+BigInteger.prototype.bitLength = bnBitLength;
+BigInteger.prototype.mod = bnMod;
+BigInteger.prototype.modPowInt = bnModPowInt;
+
+// "constants"
+BigInteger.ZERO = nbv(0);
+BigInteger.ONE = nbv(1);
+
+// Copyright (c) 2005-2009  Tom Wu
+// All Rights Reserved.
+// See "LICENSE" for details.
+
+// Extended JavaScript BN functions, required for RSA private ops.
+
+// Version 1.1: new BigInteger("0", 10) returns "proper" zero
+// Version 1.2: square() API, isProbablePrime fix
+
+// (public)
+function bnClone() { var r = nbi(); this.copyTo(r); return r; }
+
+// (public) return value as integer
+function bnIntValue() {
+  if(this.s < 0) {
+    if(this.t == 1) return this[0]-this.DV;
+    else if(this.t == 0) return -1;
+  }
+  else if(this.t == 1) return this[0];
+  else if(this.t == 0) return 0;
+  // assumes 16 < DB < 32
+  return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
+}
+
+// (public) return value as byte
+function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
+
+// (public) return value as short (assumes DB>=16)
+function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
+
+// (protected) return x s.t. r^x < DV
+function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
+
+// (public) 0 if this == 0, 1 if this > 0
+function bnSigNum() {
+  if(this.s < 0) return -1;
+  else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
+  else return 1;
+}
+
+// (protected) convert to radix string
+function bnpToRadix(b) {
+  if(b == null) b = 10;
+  if(this.signum() == 0 || b < 2 || b > 36) return "0";
+  var cs = this.chunkSize(b);
+  var a = Math.pow(b,cs);
+  var d = nbv(a), y = nbi(), z = nbi(), r = "";
+  this.divRemTo(d,y,z);
+  while(y.signum() > 0) {
+    r = (a+z.intValue()).toString(b).substr(1) + r;
+    y.divRemTo(d,y,z);
+  }
+  return z.intValue().toString(b) + r;
+}
+
+// (protected) convert from radix string
+function bnpFromRadix(s,b) {
+  this.fromInt(0);
+  if(b == null) b = 10;
+  var cs = this.chunkSize(b);
+  var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
+  for(var i = 0; i < s.length; ++i) {
+    var x = intAt(s,i);
+    if(x < 0) {
+      if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
+      continue;
+    }
+    w = b*w+x;
+    if(++j >= cs) {
+      this.dMultiply(d);
+      this.dAddOffset(w,0);
+      j = 0;
+      w = 0;
+    }
+  }
+  if(j > 0) {
+    this.dMultiply(Math.pow(b,j));
+    this.dAddOffset(w,0);
+  }
+  if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) alternate constructor
+function bnpFromNumber(a,b,c) {
+  if("number" == typeof b) {
+    // new BigInteger(int,int,RNG)
+    if(a < 2) this.fromInt(1);
+    else {
+      this.fromNumber(a,c);
+      if(!this.testBit(a-1))	// force MSB set
+        this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+      if(this.isEven()) this.dAddOffset(1,0); // force odd
+      while(!this.isProbablePrime(b)) {
+        this.dAddOffset(2,0);
+        if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
+      }
+    }
+  }
+  else {
+    // new BigInteger(int,RNG)
+    var x = new Array(), t = a&7;
+    x.length = (a>>3)+1;
+    b.nextBytes(x);
+    if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
+    this.fromString(x,256);
+  }
+}
+
+// (public) convert to bigendian byte array
+function bnToByteArray() {
+  var i = this.t, r = new Array();
+  r[0] = this.s;
+  var p = this.DB-(i*this.DB)%8, d, k = 0;
+  if(i-- > 0) {
+    if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)
+      r[k++] = d|(this.s<<(this.DB-p));
+    while(i >= 0) {
+      if(p < 8) {
+        d = (this[i]&((1<<p)-1))<<(8-p);
+        d |= this[--i]>>(p+=this.DB-8);
+      }
+      else {
+        d = (this[i]>>(p-=8))&0xff;
+        if(p <= 0) { p += this.DB; --i; }
+      }
+      if((d&0x80) != 0) d |= -256;
+      if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
+      if(k > 0 || d != this.s) r[k++] = d;
+    }
+  }
+  return r;
+}
+
+function bnEquals(a) { return(this.compareTo(a)==0); }
+function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
+function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
+
+// (protected) r = this op a (bitwise)
+function bnpBitwiseTo(a,op,r) {
+  var i, f, m = Math.min(a.t,this.t);
+  for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);
+  if(a.t < this.t) {
+    f = a.s&this.DM;
+    for(i = m; i < this.t; ++i) r[i] = op(this[i],f);
+    r.t = this.t;
+  }
+  else {
+    f = this.s&this.DM;
+    for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
+    r.t = a.t;
+  }
+  r.s = op(this.s,a.s);
+  r.clamp();
+}
+
+// (public) this & a
+function op_and(x,y) { return x&y; }
+function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
+
+// (public) this | a
+function op_or(x,y) { return x|y; }
+function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
+
+// (public) this ^ a
+function op_xor(x,y) { return x^y; }
+function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
+
+// (public) this & ~a
+function op_andnot(x,y) { return x&~y; }
+function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
+
+// (public) ~this
+function bnNot() {
+  var r = nbi();
+  for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
+  r.t = this.t;
+  r.s = ~this.s;
+  return r;
+}
+
+// (public) this << n
+function bnShiftLeft(n) {
+  var r = nbi();
+  if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
+  return r;
+}
+
+// (public) this >> n
+function bnShiftRight(n) {
+  var r = nbi();
+  if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
+  return r;
+}
+
+// return index of lowest 1-bit in x, x < 2^31
+function lbit(x) {
+  if(x == 0) return -1;
+  var r = 0;
+  if((x&0xffff) == 0) { x >>= 16; r += 16; }
+  if((x&0xff) == 0) { x >>= 8; r += 8; }
+  if((x&0xf) == 0) { x >>= 4; r += 4; }
+  if((x&3) == 0) { x >>= 2; r += 2; }
+  if((x&1) == 0) ++r;
+  return r;
+}
+
+// (public) returns index of lowest 1-bit (or -1 if none)
+function bnGetLowestSetBit() {
+  for(var i = 0; i < this.t; ++i)
+    if(this[i] != 0) return i*this.DB+lbit(this[i]);
+  if(this.s < 0) return this.t*this.DB;
+  return -1;
+}
+
+// return number of 1 bits in x
+function cbit(x) {
+  var r = 0;
+  while(x != 0) { x &= x-1; ++r; }
+  return r;
+}
+
+// (public) return number of set bits
+function bnBitCount() {
+  var r = 0, x = this.s&this.DM;
+  for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
+  return r;
+}
+
+// (public) true iff nth bit is set
+function bnTestBit(n) {
+  var j = Math.floor(n/this.DB);
+  if(j >= this.t) return(this.s!=0);
+  return((this[j]&(1<<(n%this.DB)))!=0);
+}
+
+// (protected) this op (1<<n)
+function bnpChangeBit(n,op) {
+  var r = BigInteger.ONE.shiftLeft(n);
+  this.bitwiseTo(r,op,r);
+  return r;
+}
+
+// (public) this | (1<<n)
+function bnSetBit(n) { return this.changeBit(n,op_or); }
+
+// (public) this & ~(1<<n)
+function bnClearBit(n) { return this.changeBit(n,op_andnot); }
+
+// (public) this ^ (1<<n)
+function bnFlipBit(n) { return this.changeBit(n,op_xor); }
+
+// (protected) r = this + a
+function bnpAddTo(a,r) {
+  var i = 0, c = 0, m = Math.min(a.t,this.t);
+  while(i < m) {
+    c += this[i]+a[i];
+    r[i++] = c&this.DM;
+    c >>= this.DB;
+  }
+  if(a.t < this.t) {
+    c += a.s;
+    while(i < this.t) {
+      c += this[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c += this.s;
+  }
+  else {
+    c += this.s;
+    while(i < a.t) {
+      c += a[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c += a.s;
+  }
+  r.s = (c<0)?-1:0;
+  if(c > 0) r[i++] = c;
+  else if(c < -1) r[i++] = this.DV+c;
+  r.t = i;
+  r.clamp();
+}
+
+// (public) this + a
+function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
+
+// (public) this - a
+function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
+
+// (public) this * a
+function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
+
+// (public) this^2
+function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
+
+// (public) this / a
+function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
+
+// (public) this % a
+function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
+
+// (public) [this/a,this%a]
+function bnDivideAndRemainder(a) {
+  var q = nbi(), r = nbi();
+  this.divRemTo(a,q,r);
+  return new Array(q,r);
+}
+
+// (protected) this *= n, this >= 0, 1 < n < DV
+function bnpDMultiply(n) {
+  this[this.t] = this.am(0,n-1,this,0,0,this.t);
+  ++this.t;
+  this.clamp();
+}
+
+// (protected) this += n << w words, this >= 0
+function bnpDAddOffset(n,w) {
+  if(n == 0) return;
+  while(this.t <= w) this[this.t++] = 0;
+  this[w] += n;
+  while(this[w] >= this.DV) {
+    this[w] -= this.DV;
+    if(++w >= this.t) this[this.t++] = 0;
+    ++this[w];
+  }
+}
+
+// A "null" reducer
+function NullExp() {}
+function nNop(x) { return x; }
+function nMulTo(x,y,r) { x.multiplyTo(y,r); }
+function nSqrTo(x,r) { x.squareTo(r); }
+
+NullExp.prototype.convert = nNop;
+NullExp.prototype.revert = nNop;
+NullExp.prototype.mulTo = nMulTo;
+NullExp.prototype.sqrTo = nSqrTo;
+
+// (public) this^e
+function bnPow(e) { return this.exp(e,new NullExp()); }
+
+// (protected) r = lower n words of "this * a", a.t <= n
+// "this" should be the larger one if appropriate.
+function bnpMultiplyLowerTo(a,n,r) {
+  var i = Math.min(this.t+a.t,n);
+  r.s = 0; // assumes a,this >= 0
+  r.t = i;
+  while(i > 0) r[--i] = 0;
+  var j;
+  for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
+  for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
+  r.clamp();
+}
+
+// (protected) r = "this * a" without lower n words, n > 0
+// "this" should be the larger one if appropriate.
+function bnpMultiplyUpperTo(a,n,r) {
+  --n;
+  var i = r.t = this.t+a.t-n;
+  r.s = 0; // assumes a,this >= 0
+  while(--i >= 0) r[i] = 0;
+  for(i = Math.max(n-this.t,0); i < a.t; ++i)
+    r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
+  r.clamp();
+  r.drShiftTo(1,r);
+}
+
+// Barrett modular reduction
+function Barrett(m) {
+  // setup Barrett
+  this.r2 = nbi();
+  this.q3 = nbi();
+  BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
+  this.mu = this.r2.divide(m);
+  this.m = m;
+}
+
+function barrettConvert(x) {
+  if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
+  else if(x.compareTo(this.m) < 0) return x;
+  else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
+}
+
+function barrettRevert(x) { return x; }
+
+// x = x mod m (HAC 14.42)
+function barrettReduce(x) {
+  x.drShiftTo(this.m.t-1,this.r2);
+  if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
+  this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
+  this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
+  while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
+  x.subTo(this.r2,x);
+  while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = x^2 mod m; x != r
+function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = x*y mod m; x,y != r
+function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Barrett.prototype.convert = barrettConvert;
+Barrett.prototype.revert = barrettRevert;
+Barrett.prototype.reduce = barrettReduce;
+Barrett.prototype.mulTo = barrettMulTo;
+Barrett.prototype.sqrTo = barrettSqrTo;
+
+// (public) this^e % m (HAC 14.85)
+function bnModPow(e,m) {
+  var i = e.bitLength(), k, r = nbv(1), z;
+  if(i <= 0) return r;
+  else if(i < 18) k = 1;
+  else if(i < 48) k = 3;
+  else if(i < 144) k = 4;
+  else if(i < 768) k = 5;
+  else k = 6;
+  if(i < 8)
+    z = new Classic(m);
+  else if(m.isEven())
+    z = new Barrett(m);
+  else
+    z = new Montgomery(m);
+
+  // precomputation
+  var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
+  g[1] = z.convert(this);
+  if(k > 1) {
+    var g2 = nbi();
+    z.sqrTo(g[1],g2);
+    while(n <= km) {
+      g[n] = nbi();
+      z.mulTo(g2,g[n-2],g[n]);
+      n += 2;
+    }
+  }
+
+  var j = e.t-1, w, is1 = true, r2 = nbi(), t;
+  i = nbits(e[j])-1;
+  while(j >= 0) {
+    if(i >= k1) w = (e[j]>>(i-k1))&km;
+    else {
+      w = (e[j]&((1<<(i+1))-1))<<(k1-i);
+      if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
+    }
+
+    n = k;
+    while((w&1) == 0) { w >>= 1; --n; }
+    if((i -= n) < 0) { i += this.DB; --j; }
+    if(is1) {	// ret == 1, don't bother squaring or multiplying it
+      g[w].copyTo(r);
+      is1 = false;
+    }
+    else {
+      while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
+      if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
+      z.mulTo(r2,g[w],r);
+    }
+
+    while(j >= 0 && (e[j]&(1<<i)) == 0) {
+      z.sqrTo(r,r2); t = r; r = r2; r2 = t;
+      if(--i < 0) { i = this.DB-1; --j; }
+    }
+  }
+  return z.revert(r);
+}
+
+// (public) gcd(this,a) (HAC 14.54)
+function bnGCD(a) {
+  var x = (this.s<0)?this.negate():this.clone();
+  var y = (a.s<0)?a.negate():a.clone();
+  if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
+  var i = x.getLowestSetBit(), g = y.getLowestSetBit();
+  if(g < 0) return x;
+  if(i < g) g = i;
+  if(g > 0) {
+    x.rShiftTo(g,x);
+    y.rShiftTo(g,y);
+  }
+  while(x.signum() > 0) {
+    if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
+    if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
+    if(x.compareTo(y) >= 0) {
+      x.subTo(y,x);
+      x.rShiftTo(1,x);
+    }
+    else {
+      y.subTo(x,y);
+      y.rShiftTo(1,y);
+    }
+  }
+  if(g > 0) y.lShiftTo(g,y);
+  return y;
+}
+
+// (protected) this % n, n < 2^26
+function bnpModInt(n) {
+  if(n <= 0) return 0;
+  var d = this.DV%n, r = (this.s<0)?n-1:0;
+  if(this.t > 0)
+    if(d == 0) r = this[0]%n;
+    else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
+  return r;
+}
+
+// (public) 1/this % m (HAC 14.61)
+function bnModInverse(m) {
+  var ac = m.isEven();
+  if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
+  var u = m.clone(), v = this.clone();
+  var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
+  while(u.signum() != 0) {
+    while(u.isEven()) {
+      u.rShiftTo(1,u);
+      if(ac) {
+        if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
+        a.rShiftTo(1,a);
+      }
+      else if(!b.isEven()) b.subTo(m,b);
+      b.rShiftTo(1,b);
+    }
+    while(v.isEven()) {
+      v.rShiftTo(1,v);
+      if(ac) {
+        if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
+        c.rShiftTo(1,c);
+      }
+      else if(!d.isEven()) d.subTo(m,d);
+      d.rShiftTo(1,d);
+    }
+    if(u.compareTo(v) >= 0) {
+      u.subTo(v,u);
+      if(ac) a.subTo(c,a);
+      b.subTo(d,b);
+    }
+    else {
+      v.subTo(u,v);
+      if(ac) c.subTo(a,c);
+      d.subTo(b,d);
+    }
+  }
+  if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
+  if(d.compareTo(m) >= 0) return d.subtract(m);
+  if(d.signum() < 0) d.addTo(m,d); else return d;
+  if(d.signum() < 0) return d.add(m); else return d;
+}
+
+var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
+var lplim = (1<<26)/lowprimes[lowprimes.length-1];
+
+// (public) test primality with certainty >= 1-.5^t
+function bnIsProbablePrime(t) {
+  var i, x = this.abs();
+  if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {
+    for(i = 0; i < lowprimes.length; ++i)
+      if(x[0] == lowprimes[i]) return true;
+    return false;
+  }
+  if(x.isEven()) return false;
+  i = 1;
+  while(i < lowprimes.length) {
+    var m = lowprimes[i], j = i+1;
+    while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
+    m = x.modInt(m);
+    while(i < j) if(m%lowprimes[i++] == 0) return false;
+  }
+  return x.millerRabin(t);
+}
+
+// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
+function bnpMillerRabin(t) {
+  var n1 = this.subtract(BigInteger.ONE);
+  var k = n1.getLowestSetBit();
+  if(k <= 0) return false;
+  var r = n1.shiftRight(k);
+  t = (t+1)>>1;
+  if(t > lowprimes.length) t = lowprimes.length;
+  var a = nbi();
+  for(var i = 0; i < t; ++i) {
+    //Pick bases at random, instead of starting at 2
+    a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);
+    var y = a.modPow(r,this);
+    if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
+      var j = 1;
+      while(j++ < k && y.compareTo(n1) != 0) {
+        y = y.modPowInt(2,this);
+        if(y.compareTo(BigInteger.ONE) == 0) return false;
+      }
+      if(y.compareTo(n1) != 0) return false;
+    }
+  }
+  return true;
+}
+
+// protected
+BigInteger.prototype.chunkSize = bnpChunkSize;
+BigInteger.prototype.toRadix = bnpToRadix;
+BigInteger.prototype.fromRadix = bnpFromRadix;
+BigInteger.prototype.fromNumber = bnpFromNumber;
+BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
+BigInteger.prototype.changeBit = bnpChangeBit;
+BigInteger.prototype.addTo = bnpAddTo;
+BigInteger.prototype.dMultiply = bnpDMultiply;
+BigInteger.prototype.dAddOffset = bnpDAddOffset;
+BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
+BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
+BigInteger.prototype.modInt = bnpModInt;
+BigInteger.prototype.millerRabin = bnpMillerRabin;
+
+// public
+BigInteger.prototype.clone = bnClone;
+BigInteger.prototype.intValue = bnIntValue;
+BigInteger.prototype.byteValue = bnByteValue;
+BigInteger.prototype.shortValue = bnShortValue;
+BigInteger.prototype.signum = bnSigNum;
+BigInteger.prototype.toByteArray = bnToByteArray;
+BigInteger.prototype.equals = bnEquals;
+BigInteger.prototype.min = bnMin;
+BigInteger.prototype.max = bnMax;
+BigInteger.prototype.and = bnAnd;
+BigInteger.prototype.or = bnOr;
+BigInteger.prototype.xor = bnXor;
+BigInteger.prototype.andNot = bnAndNot;
+BigInteger.prototype.not = bnNot;
+BigInteger.prototype.shiftLeft = bnShiftLeft;
+BigInteger.prototype.shiftRight = bnShiftRight;
+BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
+BigInteger.prototype.bitCount = bnBitCount;
+BigInteger.prototype.testBit = bnTestBit;
+BigInteger.prototype.setBit = bnSetBit;
+BigInteger.prototype.clearBit = bnClearBit;
+BigInteger.prototype.flipBit = bnFlipBit;
+BigInteger.prototype.add = bnAdd;
+BigInteger.prototype.subtract = bnSubtract;
+BigInteger.prototype.multiply = bnMultiply;
+BigInteger.prototype.divide = bnDivide;
+BigInteger.prototype.remainder = bnRemainder;
+BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
+BigInteger.prototype.modPow = bnModPow;
+BigInteger.prototype.modInverse = bnModInverse;
+BigInteger.prototype.pow = bnPow;
+BigInteger.prototype.gcd = bnGCD;
+BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
+
+// JSBN-specific extension
+BigInteger.prototype.square = bnSquare;
+
+// BigInteger interfaces not implemented in jsbn:
+
+// BigInteger(int signum, byte[] magnitude)
+// double doubleValue()
+// float floatValue()
+// int hashCode()
+// long longValue()
+// static BigInteger valueOf(long val)
+
+// prng4.js - uses Arcfour as a PRNG
+
+function Arcfour() {
+  this.i = 0;
+  this.j = 0;
+  this.S = new Array();
+}
+
+// Initialize arcfour context from key, an array of ints, each from [0..255]
+function ARC4init(key) {
+  var i, j, t;
+  for(i = 0; i < 256; ++i)
+    this.S[i] = i;
+  j = 0;
+  for(i = 0; i < 256; ++i) {
+    j = (j + this.S[i] + key[i % key.length]) & 255;
+    t = this.S[i];
+    this.S[i] = this.S[j];
+    this.S[j] = t;
+  }
+  this.i = 0;
+  this.j = 0;
+}
+
+function ARC4next() {
+  var t;
+  this.i = (this.i + 1) & 255;
+  this.j = (this.j + this.S[this.i]) & 255;
+  t = this.S[this.i];
+  this.S[this.i] = this.S[this.j];
+  this.S[this.j] = t;
+  return this.S[(t + this.S[this.i]) & 255];
+}
+
+Arcfour.prototype.init = ARC4init;
+Arcfour.prototype.next = ARC4next;
+
+// Plug in your RNG constructor here
+function prng_newstate() {
+  return new Arcfour();
+}
+
+// Pool size must be a multiple of 4 and greater than 32.
+// An array of bytes the size of the pool will be passed to init()
+var rng_psize = 256;
+
+// Random number generator - requires a PRNG backend, e.g. prng4.js
+var rng_state;
+var rng_pool;
+var rng_pptr;
+
+// Initialize the pool with junk if needed.
+if(rng_pool == null) {
+  rng_pool = new Array();
+  rng_pptr = 0;
+  var t;
+  if(window.crypto && window.crypto.getRandomValues) {
+    // Extract entropy (2048 bits) from RNG if available
+    var z = new Uint32Array(256);
+    window.crypto.getRandomValues(z);
+    for (t = 0; t < z.length; ++t)
+      rng_pool[rng_pptr++] = z[t] & 255;
+  }
+
+  // Use mouse events for entropy, if we do not have enough entropy by the time
+  // we need it, entropy will be generated by Math.random.
+  var onMouseMoveListener = function(ev) {
+    this.count = this.count || 0;
+    if (this.count >= 256 || rng_pptr >= rng_psize) {
+      if (window.removeEventListener)
+        window.removeEventListener("mousemove", onMouseMoveListener, false);
+      else if (window.detachEvent)
+        window.detachEvent("onmousemove", onMouseMoveListener);
+      return;
+    }
+    try {
+      var mouseCoordinates = ev.x + ev.y;
+      rng_pool[rng_pptr++] = mouseCoordinates & 255;
+      this.count += 1;
+    } catch (e) {
+      // Sometimes Firefox will deny permission to access event properties for some reason. Ignore.
+    }
+  };
+  if (window.addEventListener)
+    window.addEventListener("mousemove", onMouseMoveListener, false);
+  else if (window.attachEvent)
+    window.attachEvent("onmousemove", onMouseMoveListener);
+
+}
+
+function rng_get_byte() {
+  if(rng_state == null) {
+    rng_state = prng_newstate();
+    // At this point, we may not have collected enough entropy.  If not, fall back to Math.random
+    while (rng_pptr < rng_psize) {
+      var random = Math.floor(65536 * Math.random());
+      rng_pool[rng_pptr++] = random & 255;
+    }
+    rng_state.init(rng_pool);
+    for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
+      rng_pool[rng_pptr] = 0;
+    rng_pptr = 0;
+  }
+  // TODO: allow reseeding after first request
+  return rng_state.next();
+}
+
+function rng_get_bytes(ba) {
+  var i;
+  for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
+}
+
+function SecureRandom() {}
+
+SecureRandom.prototype.nextBytes = rng_get_bytes;
+
+// Depends on jsbn.js and rng.js
+
+// Version 1.1: support utf-8 encoding in pkcs1pad2
+
+// convert a (hex) string to a bignum object
+function parseBigInt(str,r) {
+  return new BigInteger(str,r);
+}
+
+function linebrk(s,n) {
+  var ret = "";
+  var i = 0;
+  while(i + n < s.length) {
+    ret += s.substring(i,i+n) + "\n";
+    i += n;
+  }
+  return ret + s.substring(i,s.length);
+}
+
+function byte2Hex(b) {
+  if(b < 0x10)
+    return "0" + b.toString(16);
+  else
+    return b.toString(16);
+}
+
+// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
+function pkcs1pad2(s,n) {
+  if(n < s.length + 11) { // TODO: fix for utf-8
+    console.error("Message too long for RSA");
+    return null;
+  }
+  var ba = new Array();
+  var i = s.length - 1;
+  while(i >= 0 && n > 0) {
+    var c = s.charCodeAt(i--);
+    if(c < 128) { // encode using utf-8
+      ba[--n] = c;
+    }
+    else if((c > 127) && (c < 2048)) {
+      ba[--n] = (c & 63) | 128;
+      ba[--n] = (c >> 6) | 192;
+    }
+    else {
+      ba[--n] = (c & 63) | 128;
+      ba[--n] = ((c >> 6) & 63) | 128;
+      ba[--n] = (c >> 12) | 224;
+    }
+  }
+  ba[--n] = 0;
+  var rng = new SecureRandom();
+  var x = new Array();
+  while(n > 2) { // random non-zero pad
+    x[0] = 0;
+    while(x[0] == 0) rng.nextBytes(x);
+    ba[--n] = x[0];
+  }
+  ba[--n] = 2;
+  ba[--n] = 0;
+  return new BigInteger(ba);
+}
+
+// "empty" RSA key constructor
+function RSAKey() {
+  this.n = null;
+  this.e = 0;
+  this.d = null;
+  this.p = null;
+  this.q = null;
+  this.dmp1 = null;
+  this.dmq1 = null;
+  this.coeff = null;
+}
+
+// Set the public key fields N and e from hex strings
+function RSASetPublic(N,E) {
+  if(N != null && E != null && N.length > 0 && E.length > 0) {
+    this.n = parseBigInt(N,16);
+    this.e = parseInt(E,16);
+  }
+  else
+    console.error("Invalid RSA public key");
+}
+
+// Perform raw public operation on "x": return x^e (mod n)
+function RSADoPublic(x) {
+  return x.modPowInt(this.e, this.n);
+}
+
+// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
+function RSAEncrypt(text) {
+  var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
+  if(m == null) return null;
+  var c = this.doPublic(m);
+  if(c == null) return null;
+  var h = c.toString(16);
+  if((h.length & 1) == 0) return h; else return "0" + h;
+}
+
+// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
+//function RSAEncryptB64(text) {
+//  var h = this.encrypt(text);
+//  if(h) return hex2b64(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPublic = RSADoPublic;
+
+// public
+RSAKey.prototype.setPublic = RSASetPublic;
+RSAKey.prototype.encrypt = RSAEncrypt;
+//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
+
+// Depends on rsa.js and jsbn2.js
+
+// Version 1.1: support utf-8 decoding in pkcs1unpad2
+
+// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext
+function pkcs1unpad2(d,n) {
+  var b = d.toByteArray();
+  var i = 0;
+  while(i < b.length && b[i] == 0) ++i;
+  if(b.length-i != n-1 || b[i] != 2)
+    return null;
+  ++i;
+  while(b[i] != 0)
+    if(++i >= b.length) return null;
+  var ret = "";
+  while(++i < b.length) {
+    var c = b[i] & 255;
+    if(c < 128) { // utf-8 decode
+      ret += String.fromCharCode(c);
+    }
+    else if((c > 191) && (c < 224)) {
+      ret += String.fromCharCode(((c & 31) << 6) | (b[i+1] & 63));
+      ++i;
+    }
+    else {
+      ret += String.fromCharCode(((c & 15) << 12) | ((b[i+1] & 63) << 6) | (b[i+2] & 63));
+      i += 2;
+    }
+  }
+  return ret;
+}
+
+// Set the private key fields N, e, and d from hex strings
+function RSASetPrivate(N,E,D) {
+  if(N != null && E != null && N.length > 0 && E.length > 0) {
+    this.n = parseBigInt(N,16);
+    this.e = parseInt(E,16);
+    this.d = parseBigInt(D,16);
+  }
+  else
+    console.error("Invalid RSA private key");
+}
+
+// Set the private key fields N, e, d and CRT params from hex strings
+function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {
+  if(N != null && E != null && N.length > 0 && E.length > 0) {
+    this.n = parseBigInt(N,16);
+    this.e = parseInt(E,16);
+    this.d = parseBigInt(D,16);
+    this.p = parseBigInt(P,16);
+    this.q = parseBigInt(Q,16);
+    this.dmp1 = parseBigInt(DP,16);
+    this.dmq1 = parseBigInt(DQ,16);
+    this.coeff = parseBigInt(C,16);
+  }
+  else
+    console.error("Invalid RSA private key");
+}
+
+// Generate a new random private key B bits long, using public expt E
+function RSAGenerate(B,E) {
+  var rng = new SecureRandom();
+  var qs = B>>1;
+  this.e = parseInt(E,16);
+  var ee = new BigInteger(E,16);
+  for(;;) {
+    for(;;) {
+      this.p = new BigInteger(B-qs,1,rng);
+      if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;
+    }
+    for(;;) {
+      this.q = new BigInteger(qs,1,rng);
+      if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;
+    }
+    if(this.p.compareTo(this.q) <= 0) {
+      var t = this.p;
+      this.p = this.q;
+      this.q = t;
+    }
+    var p1 = this.p.subtract(BigInteger.ONE);
+    var q1 = this.q.subtract(BigInteger.ONE);
+    var phi = p1.multiply(q1);
+    if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
+      this.n = this.p.multiply(this.q);
+      this.d = ee.modInverse(phi);
+      this.dmp1 = this.d.mod(p1);
+      this.dmq1 = this.d.mod(q1);
+      this.coeff = this.q.modInverse(this.p);
+      break;
+    }
+  }
+}
+
+// Perform raw private operation on "x": return x^d (mod n)
+function RSADoPrivate(x) {
+  if(this.p == null || this.q == null)
+    return x.modPow(this.d, this.n);
+
+  // TODO: re-calculate any missing CRT params
+  var xp = x.mod(this.p).modPow(this.dmp1, this.p);
+  var xq = x.mod(this.q).modPow(this.dmq1, this.q);
+
+  while(xp.compareTo(xq) < 0)
+    xp = xp.add(this.p);
+  return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is an even-length hex string and the output is a plain string.
+function RSADecrypt(ctext) {
+  var c = parseBigInt(ctext, 16);
+  var m = this.doPrivate(c);
+  if(m == null) return null;
+  return pkcs1unpad2(m, (this.n.bitLength()+7)>>3);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is a Base64-encoded string and the output is a plain string.
+//function RSAB64Decrypt(ctext) {
+//  var h = b64tohex(ctext);
+//  if(h) return this.decrypt(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPrivate = RSADoPrivate;
+
+// public
+RSAKey.prototype.setPrivate = RSASetPrivate;
+RSAKey.prototype.setPrivateEx = RSASetPrivateEx;
+RSAKey.prototype.generate = RSAGenerate;
+RSAKey.prototype.decrypt = RSADecrypt;
+//RSAKey.prototype.b64_decrypt = RSAB64Decrypt;
+
+// Copyright (c) 2011  Kevin M Burns Jr.
+// All Rights Reserved.
+// See "LICENSE" for details.
+//
+// Extension to jsbn which adds facilities for asynchronous RSA key generation
+// Primarily created to avoid execution timeout on mobile devices
+//
+// http://www-cs-students.stanford.edu/~tjw/jsbn/
+//
+// ---
+
+(function(){
+
+// Generate a new random private key B bits long, using public expt E
+var RSAGenerateAsync = function (B, E, callback) {
+    //var rng = new SeededRandom();
+    var rng = new SecureRandom();
+    var qs = B >> 1;
+    this.e = parseInt(E, 16);
+    var ee = new BigInteger(E, 16);
+    var rsa = this;
+    // These functions have non-descript names because they were originally for(;;) loops.
+    // I don't know about cryptography to give them better names than loop1-4.
+    var loop1 = function() {
+        var loop4 = function() {
+            if (rsa.p.compareTo(rsa.q) <= 0) {
+                var t = rsa.p;
+                rsa.p = rsa.q;
+                rsa.q = t;
+            }
+            var p1 = rsa.p.subtract(BigInteger.ONE);
+            var q1 = rsa.q.subtract(BigInteger.ONE);
+            var phi = p1.multiply(q1);
+            if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
+                rsa.n = rsa.p.multiply(rsa.q);
+                rsa.d = ee.modInverse(phi);
+                rsa.dmp1 = rsa.d.mod(p1);
+                rsa.dmq1 = rsa.d.mod(q1);
+                rsa.coeff = rsa.q.modInverse(rsa.p);
+                setTimeout(function(){callback()},0); // escape
+            } else {
+                setTimeout(loop1,0);
+            }
+        };
+        var loop3 = function() {
+            rsa.q = nbi();
+            rsa.q.fromNumberAsync(qs, 1, rng, function(){
+                rsa.q.subtract(BigInteger.ONE).gcda(ee, function(r){
+                    if (r.compareTo(BigInteger.ONE) == 0 && rsa.q.isProbablePrime(10)) {
+                        setTimeout(loop4,0);
+                    } else {
+                        setTimeout(loop3,0);
+                    }
+                });
+            });
+        };
+        var loop2 = function() {
+            rsa.p = nbi();
+            rsa.p.fromNumberAsync(B - qs, 1, rng, function(){
+                rsa.p.subtract(BigInteger.ONE).gcda(ee, function(r){
+                    if (r.compareTo(BigInteger.ONE) == 0 && rsa.p.isProbablePrime(10)) {
+                        setTimeout(loop3,0);
+                    } else {
+                        setTimeout(loop2,0);
+                    }
+                });
+            });
+        };
+        setTimeout(loop2,0);
+    };
+    setTimeout(loop1,0);
+};
+RSAKey.prototype.generateAsync = RSAGenerateAsync;
+
+// Public API method
+var bnGCDAsync = function (a, callback) {
+    var x = (this.s < 0) ? this.negate() : this.clone();
+    var y = (a.s < 0) ? a.negate() : a.clone();
+    if (x.compareTo(y) < 0) {
+        var t = x;
+        x = y;
+        y = t;
+    }
+    var i = x.getLowestSetBit(),
+        g = y.getLowestSetBit();
+    if (g < 0) {
+        callback(x);
+        return;
+    }
+    if (i < g) g = i;
+    if (g > 0) {
+        x.rShiftTo(g, x);
+        y.rShiftTo(g, y);
+    }
+    // Workhorse of the algorithm, gets called 200 - 800 times per 512 bit keygen.
+    var gcda1 = function() {
+        if ((i = x.getLowestSetBit()) > 0){ x.rShiftTo(i, x); }
+        if ((i = y.getLowestSetBit()) > 0){ y.rShiftTo(i, y); }
+        if (x.compareTo(y) >= 0) {
+            x.subTo(y, x);
+            x.rShiftTo(1, x);
+        } else {
+            y.subTo(x, y);
+            y.rShiftTo(1, y);
+        }
+        if(!(x.signum() > 0)) {
+            if (g > 0) y.lShiftTo(g, y);
+            setTimeout(function(){callback(y)},0); // escape
+        } else {
+            setTimeout(gcda1,0);
+        }
+    };
+    setTimeout(gcda1,10);
+};
+BigInteger.prototype.gcda = bnGCDAsync;
+
+// (protected) alternate constructor
+var bnpFromNumberAsync = function (a,b,c,callback) {
+  if("number" == typeof b) {
+    if(a < 2) {
+        this.fromInt(1);
+    } else {
+      this.fromNumber(a,c);
+      if(!this.testBit(a-1)){
+        this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+      }
+      if(this.isEven()) {
+        this.dAddOffset(1,0);
+      }
+      var bnp = this;
+      var bnpfn1 = function(){
+        bnp.dAddOffset(2,0);
+        if(bnp.bitLength() > a) bnp.subTo(BigInteger.ONE.shiftLeft(a-1),bnp);
+        if(bnp.isProbablePrime(b)) {
+            setTimeout(function(){callback()},0); // escape
+        } else {
+            setTimeout(bnpfn1,0);
+        }
+      };
+      setTimeout(bnpfn1,0);
+    }
+  } else {
+    var x = new Array(), t = a&7;
+    x.length = (a>>3)+1;
+    b.nextBytes(x);
+    if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
+    this.fromString(x,256);
+  }
+};
+BigInteger.prototype.fromNumberAsync = bnpFromNumberAsync;
+
+})();
+var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+var b64pad="=";
+
+function hex2b64(h) {
+  var i;
+  var c;
+  var ret = "";
+  for(i = 0; i+3 <= h.length; i+=3) {
+    c = parseInt(h.substring(i,i+3),16);
+    ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
+  }
+  if(i+1 == h.length) {
+    c = parseInt(h.substring(i,i+1),16);
+    ret += b64map.charAt(c << 2);
+  }
+  else if(i+2 == h.length) {
+    c = parseInt(h.substring(i,i+2),16);
+    ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
+  }
+  while((ret.length & 3) > 0) ret += b64pad;
+  return ret;
+}
+
+// convert a base64 string to hex
+function b64tohex(s) {
+  var ret = ""
+  var i;
+  var k = 0; // b64 state, 0-3
+  var slop;
+  for(i = 0; i < s.length; ++i) {
+    if(s.charAt(i) == b64pad) break;
+    v = b64map.indexOf(s.charAt(i));
+    if(v < 0) continue;
+    if(k == 0) {
+      ret += int2char(v >> 2);
+      slop = v & 3;
+      k = 1;
+    }
+    else if(k == 1) {
+      ret += int2char((slop << 2) | (v >> 4));
+      slop = v & 0xf;
+      k = 2;
+    }
+    else if(k == 2) {
+      ret += int2char(slop);
+      ret += int2char(v >> 2);
+      slop = v & 3;
+      k = 3;
+    }
+    else {
+      ret += int2char((slop << 2) | (v >> 4));
+      ret += int2char(v & 0xf);
+      k = 0;
+    }
+  }
+  if(k == 1)
+    ret += int2char(slop << 2);
+  return ret;
+}
+
+// convert a base64 string to a byte/number array
+function b64toBA(s) {
+  //piggyback on b64tohex for now, optimize later
+  var h = b64tohex(s);
+  var i;
+  var a = new Array();
+  for(i = 0; 2*i < h.length; ++i) {
+    a[i] = parseInt(h.substring(2*i,2*i+2),16);
+  }
+  return a;
+}
+
+/*! asn1-1.0.2.js (c) 2013 Kenji Urushima | kjur.github.com/jsrsasign/license
+ */
+
+var JSX = JSX || {};
+JSX.env = JSX.env || {};
+
+var L = JSX, OP = Object.prototype, FUNCTION_TOSTRING = '[object Function]',ADD = ["toString", "valueOf"];
+
+JSX.env.parseUA = function(agent) {
+
+    var numberify = function(s) {
+        var c = 0;
+        return parseFloat(s.replace(/\./g, function() {
+            return (c++ == 1) ? '' : '.';
+        }));
+    },
+
+    nav = navigator,
+    o = {
+        ie: 0,
+        opera: 0,
+        gecko: 0,
+        webkit: 0,
+        chrome: 0,
+        mobile: null,
+        air: 0,
+        ipad: 0,
+        iphone: 0,
+        ipod: 0,
+        ios: null,
+        android: 0,
+        webos: 0,
+        caja: nav && nav.cajaVersion,
+        secure: false,
+        os: null
+
+    },
+
+    ua = agent || (navigator && navigator.userAgent),
+    loc = window && window.location,
+    href = loc && loc.href,
+    m;
+
+    o.secure = href && (href.toLowerCase().indexOf("https") === 0);
+
+    if (ua) {
+
+        if ((/windows|win32/i).test(ua)) {
+            o.os = 'windows';
+        } else if ((/macintosh/i).test(ua)) {
+            o.os = 'macintosh';
+        } else if ((/rhino/i).test(ua)) {
+            o.os = 'rhino';
+        }
+        if ((/KHTML/).test(ua)) {
+            o.webkit = 1;
+        }
+        m = ua.match(/AppleWebKit\/([^\s]*)/);
+        if (m && m[1]) {
+            o.webkit = numberify(m[1]);
+            if (/ Mobile\//.test(ua)) {
+                o.mobile = 'Apple'; // iPhone or iPod Touch
+                m = ua.match(/OS ([^\s]*)/);
+                if (m && m[1]) {
+                    m = numberify(m[1].replace('_', '.'));
+                }
+                o.ios = m;
+                o.ipad = o.ipod = o.iphone = 0;
+                m = ua.match(/iPad|iPod|iPhone/);
+                if (m && m[0]) {
+                    o[m[0].toLowerCase()] = o.ios;
+                }
+            } else {
+                m = ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);
+                if (m) {
+                    o.mobile = m[0];
+                }
+                if (/webOS/.test(ua)) {
+                    o.mobile = 'WebOS';
+                    m = ua.match(/webOS\/([^\s]*);/);
+                    if (m && m[1]) {
+                        o.webos = numberify(m[1]);
+                    }
+                }
+                if (/ Android/.test(ua)) {
+                    o.mobile = 'Android';
+                    m = ua.match(/Android ([^\s]*);/);
+                    if (m && m[1]) {
+                        o.android = numberify(m[1]);
+                    }
+                }
+            }
+            m = ua.match(/Chrome\/([^\s]*)/);
+            if (m && m[1]) {
+                o.chrome = numberify(m[1]); // Chrome
+            } else {
+                m = ua.match(/AdobeAIR\/([^\s]*)/);
+                if (m) {
+                    o.air = m[0]; // Adobe AIR 1.0 or better
+                }
+            }
+        }
+        if (!o.webkit) {
+            m = ua.match(/Opera[\s\/]([^\s]*)/);
+            if (m && m[1]) {
+                o.opera = numberify(m[1]);
+                m = ua.match(/Version\/([^\s]*)/);
+                if (m && m[1]) {
+                    o.opera = numberify(m[1]); // opera 10+
+                }
+                m = ua.match(/Opera Mini[^;]*/);
+                if (m) {
+                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+                }
+            } else { // not opera or webkit
+                m = ua.match(/MSIE\s([^;]*)/);
+                if (m && m[1]) {
+                    o.ie = numberify(m[1]);
+                } else { // not opera, webkit, or ie
+                    m = ua.match(/Gecko\/([^\s]*)/);
+                    if (m) {
+                        o.gecko = 1; // Gecko detected, look for revision
+                        m = ua.match(/rv:([^\s\)]*)/);
+                        if (m && m[1]) {
+                            o.gecko = numberify(m[1]);
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return o;
+};
+
+JSX.env.ua = JSX.env.parseUA();
+
+JSX.isFunction = function(o) {
+    return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;
+};
+
+JSX._IEEnumFix = (JSX.env.ua.ie) ? function(r, s) {
+    var i, fname, f;
+    for (i=0;i<ADD.length;i=i+1) {
+
+        fname = ADD[i];
+        f = s[fname];
+
+        if (L.isFunction(f) && f!=OP[fname]) {
+            r[fname]=f;
+        }
+    }
+} : function(){};
+
+JSX.extend = function(subc, superc, overrides) {
+    if (!superc||!subc) {
+        throw new Error("extend failed, please check that " +
+                        "all dependencies are included.");
+    }
+    var F = function() {}, i;
+    F.prototype=superc.prototype;
+    subc.prototype=new F();
+    subc.prototype.constructor=subc;
+    subc.superclass=superc.prototype;
+    if (superc.prototype.constructor == OP.constructor) {
+        superc.prototype.constructor=superc;
+    }
+
+    if (overrides) {
+        for (i in overrides) {
+            if (L.hasOwnProperty(overrides, i)) {
+                subc.prototype[i]=overrides[i];
+            }
+        }
+
+        L._IEEnumFix(subc.prototype, overrides);
+    }
+};
+
+/*
+ * asn1.js - ASN.1 DER encoder classes
+ *
+ * Copyright (c) 2013 Kenji Urushima (kenji.urushima@gmail.com)
+ *
+ * This software is licensed under the terms of the MIT License.
+ * http://kjur.github.com/jsrsasign/license
+ *
+ * The above copyright and license notice shall be 
+ * included in all copies or substantial portions of the Software.
+ */
+
+/**
+ * @fileOverview
+ * @name asn1-1.0.js
+ * @author Kenji Urushima kenji.urushima@gmail.com
+ * @version 1.0.2 (2013-May-30)
+ * @since 2.1
+ * @license <a href="http://kjur.github.io/jsrsasign/license/">MIT License</a>
+ */
+
+/** 
+ * kjur's class library name space
+ * <p>
+ * This name space provides following name spaces:
+ * <ul>
+ * <li>{@link KJUR.asn1} - ASN.1 primitive hexadecimal encoder</li>
+ * <li>{@link KJUR.asn1.x509} - ASN.1 structure for X.509 certificate and CRL</li>
+ * <li>{@link KJUR.crypto} - Java Cryptographic Extension(JCE) style MessageDigest/Signature 
+ * class and utilities</li>
+ * </ul>
+ * </p> 
+ * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
+  * @name KJUR
+ * @namespace kjur's class library name space
+ */
+var KJUR = null;
+if (typeof KJUR == "undefined" || !KJUR) KJUR = {};
+
+/**
+ * kjur's ASN.1 class library name space
+ * <p>
+ * This is ITU-T X.690 ASN.1 DER encoder class library and
+ * class structure and methods is very similar to 
+ * org.bouncycastle.asn1 package of 
+ * well known BouncyCaslte Cryptography Library.
+ *
+ * <h4>PROVIDING ASN.1 PRIMITIVES</h4>
+ * Here are ASN.1 DER primitive classes.
+ * <ul>
+ * <li>{@link KJUR.asn1.DERBoolean}</li>
+ * <li>{@link KJUR.asn1.DERInteger}</li>
+ * <li>{@link KJUR.asn1.DERBitString}</li>
+ * <li>{@link KJUR.asn1.DEROctetString}</li>
+ * <li>{@link KJUR.asn1.DERNull}</li>
+ * <li>{@link KJUR.asn1.DERObjectIdentifier}</li>
+ * <li>{@link KJUR.asn1.DERUTF8String}</li>
+ * <li>{@link KJUR.asn1.DERNumericString}</li>
+ * <li>{@link KJUR.asn1.DERPrintableString}</li>
+ * <li>{@link KJUR.asn1.DERTeletexString}</li>
+ * <li>{@link KJUR.asn1.DERIA5String}</li>
+ * <li>{@link KJUR.asn1.DERUTCTime}</li>
+ * <li>{@link KJUR.asn1.DERGeneralizedTime}</li>
+ * <li>{@link KJUR.asn1.DERSequence}</li>
+ * <li>{@link KJUR.asn1.DERSet}</li>
+ * </ul>
+ *
+ * <h4>OTHER ASN.1 CLASSES</h4>
+ * <ul>
+ * <li>{@link KJUR.asn1.ASN1Object}</li>
+ * <li>{@link KJUR.asn1.DERAbstractString}</li>
+ * <li>{@link KJUR.asn1.DERAbstractTime}</li>
+ * <li>{@link KJUR.asn1.DERAbstractStructured}</li>
+ * <li>{@link KJUR.asn1.DERTaggedObject}</li>
+ * </ul>
+ * </p>
+ * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
+ * @name KJUR.asn1
+ * @namespace
+ */
+if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1) KJUR.asn1 = {};
+
+/**
+ * ASN1 utilities class
+ * @name KJUR.asn1.ASN1Util
+ * @classs ASN1 utilities class
+ * @since asn1 1.0.2
+ */
+KJUR.asn1.ASN1Util = new function() {
+    this.integerToByteHex = function(i) {
+	var h = i.toString(16);
+	if ((h.length % 2) == 1) h = '0' + h;
+	return h;
+    };
+    this.bigIntToMinTwosComplementsHex = function(bigIntegerValue) {
+	var h = bigIntegerValue.toString(16);
+	if (h.substr(0, 1) != '-') {
+	    if (h.length % 2 == 1) {
+		h = '0' + h;
+	    } else {
+		if (! h.match(/^[0-7]/)) {
+		    h = '00' + h;
+		}
+	    }
+	} else {
+	    var hPos = h.substr(1);
+	    var xorLen = hPos.length;
+	    if (xorLen % 2 == 1) {
+		xorLen += 1;
+	    } else {
+		if (! h.match(/^[0-7]/)) {
+		    xorLen += 2;
+		}
+	    }
+	    var hMask = '';
+	    for (var i = 0; i < xorLen; i++) {
+		hMask += 'f';
+	    }
+	    var biMask = new BigInteger(hMask, 16);
+	    var biNeg = biMask.xor(bigIntegerValue).add(BigInteger.ONE);
+	    h = biNeg.toString(16).replace(/^-/, '');
+	}
+	return h;
+    };
+    /**
+     * get PEM string from hexadecimal data and header string
+     * @name getPEMStringFromHex
+     * @memberOf KJUR.asn1.ASN1Util
+     * @function
+     * @param {String} dataHex hexadecimal string of PEM body
+     * @param {String} pemHeader PEM header string (ex. 'RSA PRIVATE KEY')
+     * @return {String} PEM formatted string of input data
+     * @description
+     * @example
+     * var pem  = KJUR.asn1.ASN1Util.getPEMStringFromHex('616161', 'RSA PRIVATE KEY');
+     * // value of pem will be:
+     * -----BEGIN PRIVATE KEY-----
+     * YWFh
+     * -----END PRIVATE KEY-----
+     */
+    this.getPEMStringFromHex = function(dataHex, pemHeader) {
+	var dataWA = CryptoJS.enc.Hex.parse(dataHex);
+	var dataB64 = CryptoJS.enc.Base64.stringify(dataWA);
+	var pemBody = dataB64.replace(/(.{64})/g, "$1\r\n");
+        pemBody = pemBody.replace(/\r\n$/, '');
+	return "-----BEGIN " + pemHeader + "-----\r\n" + 
+               pemBody + 
+               "\r\n-----END " + pemHeader + "-----\r\n";
+    };
+};
+
+// ********************************************************************
+//  Abstract ASN.1 Classes
+// ********************************************************************
+
+// ********************************************************************
+
+/**
+ * base class for ASN.1 DER encoder object
+ * @name KJUR.asn1.ASN1Object
+ * @class base class for ASN.1 DER encoder object
+ * @property {Boolean} isModified flag whether internal data was changed
+ * @property {String} hTLV hexadecimal string of ASN.1 TLV
+ * @property {String} hT hexadecimal string of ASN.1 TLV tag(T)
+ * @property {String} hL hexadecimal string of ASN.1 TLV length(L)
+ * @property {String} hV hexadecimal string of ASN.1 TLV value(V)
+ * @description
+ */
+KJUR.asn1.ASN1Object = function() {
+    var isModified = true;
+    var hTLV = null;
+    var hT = '00'
+    var hL = '00';
+    var hV = '';
+
+    /**
+     * get hexadecimal ASN.1 TLV length(L) bytes from TLV value(V)
+     * @name getLengthHexFromValue
+     * @memberOf KJUR.asn1.ASN1Object
+     * @function
+     * @return {String} hexadecimal string of ASN.1 TLV length(L)
+     */
+    this.getLengthHexFromValue = function() {
+	if (typeof this.hV == "undefined" || this.hV == null) {
+	    throw "this.hV is null or undefined.";
+	}
+	if (this.hV.length % 2 == 1) {
+	    throw "value hex must be even length: n=" + hV.length + ",v=" + this.hV;
+	}
+	var n = this.hV.length / 2;
+	var hN = n.toString(16);
+	if (hN.length % 2 == 1) {
+	    hN = "0" + hN;
+	}
+	if (n < 128) {
+	    return hN;
+	} else {
+	    var hNlen = hN.length / 2;
+	    if (hNlen > 15) {
+		throw "ASN.1 length too long to represent by 8x: n = " + n.toString(16);
+	    }
+	    var head = 128 + hNlen;
+	    return head.toString(16) + hN;
+	}
+    };
+
+    /**
+     * get hexadecimal string of ASN.1 TLV bytes
+     * @name getEncodedHex
+     * @memberOf KJUR.asn1.ASN1Object
+     * @function
+     * @return {String} hexadecimal string of ASN.1 TLV
+     */
+    this.getEncodedHex = function() {
+	if (this.hTLV == null || this.isModified) {
+	    this.hV = this.getFreshValueHex();
+	    this.hL = this.getLengthHexFromValue();
+	    this.hTLV = this.hT + this.hL + this.hV;
+	    this.isModified = false;
+	    //console.error("first time: " + this.hTLV);
+	}
+	return this.hTLV;
+    };
+
+    /**
+     * get hexadecimal string of ASN.1 TLV value(V) bytes
+     * @name getValueHex
+     * @memberOf KJUR.asn1.ASN1Object
+     * @function
+     * @return {String} hexadecimal string of ASN.1 TLV value(V) bytes
+     */
+    this.getValueHex = function() {
+	this.getEncodedHex();
+	return this.hV;
+    }
+
+    this.getFreshValueHex = function() {
+	return '';
+    };
+};
+
+// == BEGIN DERAbstractString ================================================
+/**
+ * base class for ASN.1 DER string classes
+ * @name KJUR.asn1.DERAbstractString
+ * @class base class for ASN.1 DER string classes
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @property {String} s internal string of value
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>str - specify initial ASN.1 value(V) by a string</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERAbstractString = function(params) {
+    KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
+    var s = null;
+    var hV = null;
+
+    /**
+     * get string value of this string object
+     * @name getString
+     * @memberOf KJUR.asn1.DERAbstractString
+     * @function
+     * @return {String} string value of this string object
+     */
+    this.getString = function() {
+	return this.s;
+    };
+
+    /**
+     * set value by a string
+     * @name setString
+     * @memberOf KJUR.asn1.DERAbstractString
+     * @function
+     * @param {String} newS value by a string to set
+     */
+    this.setString = function(newS) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = newS;
+	this.hV = stohex(this.s);
+    };
+
+    /**
+     * set value by a hexadecimal string
+     * @name setStringHex
+     * @memberOf KJUR.asn1.DERAbstractString
+     * @function
+     * @param {String} newHexString value by a hexadecimal string to set
+     */
+    this.setStringHex = function(newHexString) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = null;
+	this.hV = newHexString;
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['str'] != "undefined") {
+	    this.setString(params['str']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setStringHex(params['hex']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object);
+// == END   DERAbstractString ================================================
+
+// == BEGIN DERAbstractTime ==================================================
+/**
+ * base class for ASN.1 DER Generalized/UTCTime class
+ * @name KJUR.asn1.DERAbstractTime
+ * @class base class for ASN.1 DER Generalized/UTCTime class
+ * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERAbstractTime = function(params) {
+    KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);
+    var s = null;
+    var date = null;
+
+    // --- PRIVATE METHODS --------------------
+    this.localDateToUTC = function(d) {
+	utc = d.getTime() + (d.getTimezoneOffset() * 60000);
+	var utcDate = new Date(utc);
+	return utcDate;
+    };
+
+    this.formatDate = function(dateObject, type) {
+	var pad = this.zeroPadding;
+	var d = this.localDateToUTC(dateObject);
+	var year = String(d.getFullYear());
+	if (type == 'utc') year = year.substr(2, 2);
+	var month = pad(String(d.getMonth() + 1), 2);
+	var day = pad(String(d.getDate()), 2);
+	var hour = pad(String(d.getHours()), 2);
+	var min = pad(String(d.getMinutes()), 2);
+	var sec = pad(String(d.getSeconds()), 2);
+	return year + month + day + hour + min + sec + 'Z';
+    };
+
+    this.zeroPadding = function(s, len) {
+	if (s.length >= len) return s;
+	return new Array(len - s.length + 1).join('0') + s;
+    };
+
+    // --- PUBLIC METHODS --------------------
+    /**
+     * get string value of this string object
+     * @name getString
+     * @memberOf KJUR.asn1.DERAbstractTime
+     * @function
+     * @return {String} string value of this time object
+     */
+    this.getString = function() {
+	return this.s;
+    };
+
+    /**
+     * set value by a string
+     * @name setString
+     * @memberOf KJUR.asn1.DERAbstractTime
+     * @function
+     * @param {String} newS value by a string to set such like "130430235959Z"
+     */
+    this.setString = function(newS) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = newS;
+	this.hV = stohex(this.s);
+    };
+
+    /**
+     * set value by a Date object
+     * @name setByDateValue
+     * @memberOf KJUR.asn1.DERAbstractTime
+     * @function
+     * @param {Integer} year year of date (ex. 2013)
+     * @param {Integer} month month of date between 1 and 12 (ex. 12)
+     * @param {Integer} day day of month
+     * @param {Integer} hour hours of date
+     * @param {Integer} min minutes of date
+     * @param {Integer} sec seconds of date
+     */
+    this.setByDateValue = function(year, month, day, hour, min, sec) {
+	var dateObject = new Date(Date.UTC(year, month - 1, day, hour, min, sec, 0));
+	this.setByDate(dateObject);
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+};
+JSX.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object);
+// == END   DERAbstractTime ==================================================
+
+// == BEGIN DERAbstractStructured ============================================
+/**
+ * base class for ASN.1 DER structured class
+ * @name KJUR.asn1.DERAbstractStructured
+ * @class base class for ASN.1 DER structured class
+ * @property {Array} asn1Array internal array of ASN1Object
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERAbstractStructured = function(params) {
+    KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
+    var asn1Array = null;
+
+    /**
+     * set value by array of ASN1Object
+     * @name setByASN1ObjectArray
+     * @memberOf KJUR.asn1.DERAbstractStructured
+     * @function
+     * @param {array} asn1ObjectArray array of ASN1Object to set
+     */
+    this.setByASN1ObjectArray = function(asn1ObjectArray) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.asn1Array = asn1ObjectArray;
+    };
+
+    /**
+     * append an ASN1Object to internal array
+     * @name appendASN1Object
+     * @memberOf KJUR.asn1.DERAbstractStructured
+     * @function
+     * @param {ASN1Object} asn1Object to add
+     */
+    this.appendASN1Object = function(asn1Object) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.asn1Array.push(asn1Object);
+    };
+
+    this.asn1Array = new Array();
+    if (typeof params != "undefined") {
+	if (typeof params['array'] != "undefined") {
+	    this.asn1Array = params['array'];
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object);
+
+
+// ********************************************************************
+//  ASN.1 Object Classes
+// ********************************************************************
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Boolean
+ * @name KJUR.asn1.DERBoolean
+ * @class class for ASN.1 DER Boolean
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERBoolean = function() {
+    KJUR.asn1.DERBoolean.superclass.constructor.call(this);
+    this.hT = "01";
+    this.hTLV = "0101ff";
+};
+JSX.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Integer
+ * @name KJUR.asn1.DERInteger
+ * @class class for ASN.1 DER Integer
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>int - specify initial ASN.1 value(V) by integer value</li>
+ * <li>bigint - specify initial ASN.1 value(V) by BigInteger object</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERInteger = function(params) {
+    KJUR.asn1.DERInteger.superclass.constructor.call(this);
+    this.hT = "02";
+
+    /**
+     * set value by Tom Wu's BigInteger object
+     * @name setByBigInteger
+     * @memberOf KJUR.asn1.DERInteger
+     * @function
+     * @param {BigInteger} bigIntegerValue to set
+     */
+    this.setByBigInteger = function(bigIntegerValue) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
+    };
+
+    /**
+     * set value by integer value
+     * @name setByInteger
+     * @memberOf KJUR.asn1.DERInteger
+     * @function
+     * @param {Integer} integer value to set
+     */
+    this.setByInteger = function(intValue) {
+	var bi = new BigInteger(String(intValue), 10);
+	this.setByBigInteger(bi);
+    };
+
+    /**
+     * set value by integer value
+     * @name setValueHex
+     * @memberOf KJUR.asn1.DERInteger
+     * @function
+     * @param {String} hexadecimal string of integer value
+     * @description
+     * <br/>
+     * NOTE: Value shall be represented by minimum octet length of
+     * two's complement representation.
+     */
+    this.setValueHex = function(newHexString) {
+	this.hV = newHexString;
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['bigint'] != "undefined") {
+	    this.setByBigInteger(params['bigint']);
+	} else if (typeof params['int'] != "undefined") {
+	    this.setByInteger(params['int']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setValueHex(params['hex']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER encoded BitString primitive
+ * @name KJUR.asn1.DERBitString
+ * @class class for ASN.1 DER encoded BitString primitive
+ * @extends KJUR.asn1.ASN1Object
+ * @description 
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>bin - specify binary string (ex. '10111')</li>
+ * <li>array - specify array of boolean (ex. [true,false,true,true])</li>
+ * <li>hex - specify hexadecimal string of ASN.1 value(V) including unused bits</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERBitString = function(params) {
+    KJUR.asn1.DERBitString.superclass.constructor.call(this);
+    this.hT = "03";
+
+    /**
+     * set ASN.1 value(V) by a hexadecimal string including unused bits
+     * @name setHexValueIncludingUnusedBits
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {String} newHexStringIncludingUnusedBits
+     */
+    this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = newHexStringIncludingUnusedBits;
+    };
+
+    /**
+     * set ASN.1 value(V) by unused bit and hexadecimal string of value
+     * @name setUnusedBitsAndHexValue
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {Integer} unusedBits
+     * @param {String} hValue
+     */
+    this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {
+	if (unusedBits < 0 || 7 < unusedBits) {
+	    throw "unused bits shall be from 0 to 7: u = " + unusedBits;
+	}
+	var hUnusedBits = "0" + unusedBits;
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = hUnusedBits + hValue;
+    };
+
+    /**
+     * set ASN.1 DER BitString by binary string
+     * @name setByBinaryString
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {String} binaryString binary value string (i.e. '10111')
+     * @description
+     * Its unused bits will be calculated automatically by length of 
+     * 'binaryValue'. <br/>
+     * NOTE: Trailing zeros '0' will be ignored.
+     */
+    this.setByBinaryString = function(binaryString) {
+	binaryString = binaryString.replace(/0+$/, '');
+	var unusedBits = 8 - binaryString.length % 8;
+	if (unusedBits == 8) unusedBits = 0;
+	for (var i = 0; i <= unusedBits; i++) {
+	    binaryString += '0';
+	}
+	var h = '';
+	for (var i = 0; i < binaryString.length - 1; i += 8) {
+	    var b = binaryString.substr(i, 8);
+	    var x = parseInt(b, 2).toString(16);
+	    if (x.length == 1) x = '0' + x;
+	    h += x;  
+	}
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = '0' + unusedBits + h;
+    };
+
+    /**
+     * set ASN.1 TLV value(V) by an array of boolean
+     * @name setByBooleanArray
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {array} booleanArray array of boolean (ex. [true, false, true])
+     * @description
+     * NOTE: Trailing falses will be ignored.
+     */
+    this.setByBooleanArray = function(booleanArray) {
+	var s = '';
+	for (var i = 0; i < booleanArray.length; i++) {
+	    if (booleanArray[i] == true) {
+		s += '1';
+	    } else {
+		s += '0';
+	    }
+	}
+	this.setByBinaryString(s);
+    };
+
+    /**
+     * generate an array of false with specified length
+     * @name newFalseArray
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {Integer} nLength length of array to generate
+     * @return {array} array of boolean faluse
+     * @description
+     * This static method may be useful to initialize boolean array.
+     */
+    this.newFalseArray = function(nLength) {
+	var a = new Array(nLength);
+	for (var i = 0; i < nLength; i++) {
+	    a[i] = false;
+	}
+	return a;
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['hex'] != "undefined") {
+	    this.setHexValueIncludingUnusedBits(params['hex']);
+	} else if (typeof params['bin'] != "undefined") {
+	    this.setByBinaryString(params['bin']);
+	} else if (typeof params['array'] != "undefined") {
+	    this.setByBooleanArray(params['array']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER OctetString
+ * @name KJUR.asn1.DEROctetString
+ * @class class for ASN.1 DER OctetString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DEROctetString = function(params) {
+    KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);
+    this.hT = "04";
+};
+JSX.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Null
+ * @name KJUR.asn1.DERNull
+ * @class class for ASN.1 DER Null
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERNull = function() {
+    KJUR.asn1.DERNull.superclass.constructor.call(this);
+    this.hT = "05";
+    this.hTLV = "0500";
+};
+JSX.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER ObjectIdentifier
+ * @name KJUR.asn1.DERObjectIdentifier
+ * @class class for ASN.1 DER ObjectIdentifier
+ * @param {Array} params associative array of parameters (ex. {'oid': '2.5.4.5'})
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERObjectIdentifier = function(params) {
+    var itox = function(i) {
+	var h = i.toString(16);
+	if (h.length == 1) h = '0' + h;
+	return h;
+    };
+    var roidtox = function(roid) {
+	var h = '';
+	var bi = new BigInteger(roid, 10);
+	var b = bi.toString(2);
+	var padLen = 7 - b.length % 7;
+	if (padLen == 7) padLen = 0;
+	var bPad = '';
+	for (var i = 0; i < padLen; i++) bPad += '0';
+	b = bPad + b;
+	for (var i = 0; i < b.length - 1; i += 7) {
+	    var b8 = b.substr(i, 7);
+	    if (i != b.length - 7) b8 = '1' + b8;
+	    h += itox(parseInt(b8, 2));
+	}
+	return h;
+    }
+
+    KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);
+    this.hT = "06";
+
+    /**
+     * set value by a hexadecimal string
+     * @name setValueHex
+     * @memberOf KJUR.asn1.DERObjectIdentifier
+     * @function
+     * @param {String} newHexString hexadecimal value of OID bytes
+     */
+    this.setValueHex = function(newHexString) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = null;
+	this.hV = newHexString;
+    };
+
+    /**
+     * set value by a OID string
+     * @name setValueOidString
+     * @memberOf KJUR.asn1.DERObjectIdentifier
+     * @function
+     * @param {String} oidString OID string (ex. 2.5.4.13)
+     */
+    this.setValueOidString = function(oidString) {
+	if (! oidString.match(/^[0-9.]+$/)) {
+	    throw "malformed oid string: " + oidString;
+	}
+	var h = '';
+	var a = oidString.split('.');
+	var i0 = parseInt(a[0]) * 40 + parseInt(a[1]);
+	h += itox(i0);
+	a.splice(0, 2);
+	for (var i = 0; i < a.length; i++) {
+	    h += roidtox(a[i]);
+	}
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = null;
+	this.hV = h;
+    };
+
+    /**
+     * set value by a OID name
+     * @name setValueName
+     * @memberOf KJUR.asn1.DERObjectIdentifier
+     * @function
+     * @param {String} oidName OID name (ex. 'serverAuth')
+     * @since 1.0.1
+     * @description
+     * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'.
+     * Otherwise raise error.
+     */
+    this.setValueName = function(oidName) {
+	if (typeof KJUR.asn1.x509.OID.name2oidList[oidName] != "undefined") {
+	    var oid = KJUR.asn1.x509.OID.name2oidList[oidName];
+	    this.setValueOidString(oid);
+	} else {
+	    throw "DERObjectIdentifier oidName undefined: " + oidName;
+	}
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['oid'] != "undefined") {
+	    this.setValueOidString(params['oid']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setValueHex(params['hex']);
+	} else if (typeof params['name'] != "undefined") {
+	    this.setValueName(params['name']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER UTF8String
+ * @name KJUR.asn1.DERUTF8String
+ * @class class for ASN.1 DER UTF8String
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERUTF8String = function(params) {
+    KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params);
+    this.hT = "0c";
+};
+JSX.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER NumericString
+ * @name KJUR.asn1.DERNumericString
+ * @class class for ASN.1 DER NumericString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERNumericString = function(params) {
+    KJUR.asn1.DERNumericString.superclass.constructor.call(this, params);
+    this.hT = "12";
+};
+JSX.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER PrintableString
+ * @name KJUR.asn1.DERPrintableString
+ * @class class for ASN.1 DER PrintableString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERPrintableString = function(params) {
+    KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params);
+    this.hT = "13";
+};
+JSX.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER TeletexString
+ * @name KJUR.asn1.DERTeletexString
+ * @class class for ASN.1 DER TeletexString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERTeletexString = function(params) {
+    KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params);
+    this.hT = "14";
+};
+JSX.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER IA5String
+ * @name KJUR.asn1.DERIA5String
+ * @class class for ASN.1 DER IA5String
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERIA5String = function(params) {
+    KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);
+    this.hT = "16";
+};
+JSX.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER UTCTime
+ * @name KJUR.asn1.DERUTCTime
+ * @class class for ASN.1 DER UTCTime
+ * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
+ * @extends KJUR.asn1.DERAbstractTime
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * <li>date - specify Date object.</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ * <h4>EXAMPLES</h4>
+ * @example
+ * var d1 = new KJUR.asn1.DERUTCTime();
+ * d1.setString('130430125959Z');
+ *
+ * var d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});
+ *
+ * var d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});
+ */
+KJUR.asn1.DERUTCTime = function(params) {
+    KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params);
+    this.hT = "17";
+
+    /**
+     * set value by a Date object
+     * @name setByDate
+     * @memberOf KJUR.asn1.DERUTCTime
+     * @function
+     * @param {Date} dateObject Date object to set ASN.1 value(V)
+     */
+    this.setByDate = function(dateObject) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.date = dateObject;
+	this.s = this.formatDate(this.date, 'utc');
+	this.hV = stohex(this.s);
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['str'] != "undefined") {
+	    this.setString(params['str']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setStringHex(params['hex']);
+	} else if (typeof params['date'] != "undefined") {
+	    this.setByDate(params['date']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER GeneralizedTime
+ * @name KJUR.asn1.DERGeneralizedTime
+ * @class class for ASN.1 DER GeneralizedTime
+ * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})
+ * @extends KJUR.asn1.DERAbstractTime
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * <li>date - specify Date object.</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERGeneralizedTime = function(params) {
+    KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params);
+    this.hT = "18";
+
+    /**
+     * set value by a Date object
+     * @name setByDate
+     * @memberOf KJUR.asn1.DERGeneralizedTime
+     * @function
+     * @param {Date} dateObject Date object to set ASN.1 value(V)
+     * @example
+     * When you specify UTC time, use 'Date.UTC' method like this:<br/>
+     * var o = new DERUTCTime();
+     * var date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59
+     * o.setByDate(date);
+     */
+    this.setByDate = function(dateObject) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.date = dateObject;
+	this.s = this.formatDate(this.date, 'gen');
+	this.hV = stohex(this.s);
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['str'] != "undefined") {
+	    this.setString(params['str']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setStringHex(params['hex']);
+	} else if (typeof params['date'] != "undefined") {
+	    this.setByDate(params['date']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Sequence
+ * @name KJUR.asn1.DERSequence
+ * @class class for ASN.1 DER Sequence
+ * @extends KJUR.asn1.DERAbstractStructured
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>array - specify array of ASN1Object to set elements of content</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERSequence = function(params) {
+    KJUR.asn1.DERSequence.superclass.constructor.call(this, params);
+    this.hT = "30";
+    this.getFreshValueHex = function() {
+	var h = '';
+	for (var i = 0; i < this.asn1Array.length; i++) {
+	    var asn1Obj = this.asn1Array[i];
+	    h += asn1Obj.getEncodedHex();
+	}
+	this.hV = h;
+	return this.hV;
+    };
+};
+JSX.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Set
+ * @name KJUR.asn1.DERSet
+ * @class class for ASN.1 DER Set
+ * @extends KJUR.asn1.DERAbstractStructured
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>array - specify array of ASN1Object to set elements of content</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERSet = function(params) {
+    KJUR.asn1.DERSet.superclass.constructor.call(this, params);
+    this.hT = "31";
+    this.getFreshValueHex = function() {
+	var a = new Array();
+	for (var i = 0; i < this.asn1Array.length; i++) {
+	    var asn1Obj = this.asn1Array[i];
+	    a.push(asn1Obj.getEncodedHex());
+	}
+	a.sort();
+	this.hV = a.join('');
+	return this.hV;
+    };
+};
+JSX.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER TaggedObject
+ * @name KJUR.asn1.DERTaggedObject
+ * @class class for ASN.1 DER TaggedObject
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object.
+ * For example, if you find '[1]' tag in a ASN.1 dump, 
+ * 'tagNoHex' will be 'a1'.
+ * <br/>
+ * As for optional argument 'params' for constructor, you can specify *ANY* of
+ * following properties:
+ * <ul>
+ * <li>explicit - specify true if this is explicit tag otherwise false 
+ *     (default is 'true').</li>
+ * <li>tag - specify tag (default is 'a0' which means [0])</li>
+ * <li>obj - specify ASN1Object which is tagged</li>
+ * </ul>
+ * @example
+ * d1 = new KJUR.asn1.DERUTF8String({'str':'a'});
+ * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1});
+ * hex = d2.getEncodedHex();
+ */
+KJUR.asn1.DERTaggedObject = function(params) {
+    KJUR.asn1.DERTaggedObject.superclass.constructor.call(this);
+    this.hT = "a0";
+    this.hV = '';
+    this.isExplicit = true;
+    this.asn1Object = null;
+
+    /**
+     * set value by an ASN1Object
+     * @name setString
+     * @memberOf KJUR.asn1.DERTaggedObject
+     * @function
+     * @param {Boolean} isExplicitFlag flag for explicit/implicit tag
+     * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag
+     * @param {ASN1Object} asn1Object ASN.1 to encapsulate
+     */
+    this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) {
+	this.hT = tagNoHex;
+	this.isExplicit = isExplicitFlag;
+	this.asn1Object = asn1Object;
+	if (this.isExplicit) {
+	    this.hV = this.asn1Object.getEncodedHex();
+	    this.hTLV = null;
+	    this.isModified = true;
+	} else {
+	    this.hV = null;
+	    this.hTLV = asn1Object.getEncodedHex();
+	    this.hTLV = this.hTLV.replace(/^../, tagNoHex);
+	    this.isModified = false;
+	}
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['tag'] != "undefined") {
+	    this.hT = params['tag'];
+	}
+	if (typeof params['explicit'] != "undefined") {
+	    this.isExplicit = params['explicit'];
+	}
+	if (typeof params['obj'] != "undefined") {
+	    this.asn1Object = params['obj'];
+	    this.setASN1Object(this.isExplicit, this.hT, this.asn1Object);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);
+// Hex JavaScript decoder
+// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
+
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
+(function (undefined) {
+"use strict";
+
+var Hex = {},
+    decoder;
+
+Hex.decode = function(a) {
+    var i;
+    if (decoder === undefined) {
+        var hex = "0123456789ABCDEF",
+            ignore = " \f\n\r\t\u00A0\u2028\u2029";
+        decoder = [];
+        for (i = 0; i < 16; ++i)
+            decoder[hex.charAt(i)] = i;
+        hex = hex.toLowerCase();
+        for (i = 10; i < 16; ++i)
+            decoder[hex.charAt(i)] = i;
+        for (i = 0; i < ignore.length; ++i)
+            decoder[ignore.charAt(i)] = -1;
+    }
+    var out = [],
+        bits = 0,
+        char_count = 0;
+    for (i = 0; i < a.length; ++i) {
+        var c = a.charAt(i);
+        if (c == '=')
+            break;
+        c = decoder[c];
+        if (c == -1)
+            continue;
+        if (c === undefined)
+            throw 'Illegal character at offset ' + i;
+        bits |= c;
+        if (++char_count >= 2) {
+            out[out.length] = bits;
+            bits = 0;
+            char_count = 0;
+        } else {
+            bits <<= 4;
+        }
+    }
+    if (char_count)
+        throw "Hex encoding incomplete: 4 bits missing";
+    return out;
+};
+
+// export globals
+window.Hex = Hex;
+})();
+// Base64 JavaScript decoder
+// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
+
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
+(function (undefined) {
+"use strict";
+
+var Base64 = {},
+    decoder;
+
+Base64.decode = function (a) {
+    var i;
+    if (decoder === undefined) {
+        var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
+            ignore = "= \f\n\r\t\u00A0\u2028\u2029";
+        decoder = [];
+        for (i = 0; i < 64; ++i)
+            decoder[b64.charAt(i)] = i;
+        for (i = 0; i < ignore.length; ++i)
+            decoder[ignore.charAt(i)] = -1;
+    }
+    var out = [];
+    var bits = 0, char_count = 0;
+    for (i = 0; i < a.length; ++i) {
+        var c = a.charAt(i);
+        if (c == '=')
+            break;
+        c = decoder[c];
+        if (c == -1)
+            continue;
+        if (c === undefined)
+            throw 'Illegal character at offset ' + i;
+        bits |= c;
+        if (++char_count >= 4) {
+            out[out.length] = (bits >> 16);
+            out[out.length] = (bits >> 8) & 0xFF;
+            out[out.length] = bits & 0xFF;
+            bits = 0;
+            char_count = 0;
+        } else {
+            bits <<= 6;
+        }
+    }
+    switch (char_count) {
+      case 1:
+        throw "Base64 encoding incomplete: at least 2 bits missing";
+      case 2:
+        out[out.length] = (bits >> 10);
+        break;
+      case 3:
+        out[out.length] = (bits >> 16);
+        out[out.length] = (bits >> 8) & 0xFF;
+        break;
+    }
+    return out;
+};
+
+Base64.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/;
+Base64.unarmor = function (a) {
+    var m = Base64.re.exec(a);
+    if (m) {
+        if (m[1])
+            a = m[1];
+        else if (m[2])
+            a = m[2];
+        else
+            throw "RegExp out of sync";
+    }
+    return Base64.decode(a);
+};
+
+// export globals
+window.Base64 = Base64;
+})();
+// ASN.1 JavaScript decoder
+// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
+
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
+/*global oids */
+(function (undefined) {
+"use strict";
+
+var hardLimit = 100,
+    ellipsis = "\u2026",
+    DOM = {
+        tag: function (tagName, className) {
+            var t = document.createElement(tagName);
+            t.className = className;
+            return t;
+        },
+        text: function (str) {
+            return document.createTextNode(str);
+        }
+    };
+
+function Stream(enc, pos) {
+    if (enc instanceof Stream) {
+        this.enc = enc.enc;
+        this.pos = enc.pos;
+    } else {
+        this.enc = enc;
+        this.pos = pos;
+    }
+}
+Stream.prototype.get = function (pos) {
+    if (pos === undefined)
+        pos = this.pos++;
+    if (pos >= this.enc.length)
+        throw 'Requesting byte offset ' + pos + ' on a stream of length ' + this.enc.length;
+    return this.enc[pos];
+};
+Stream.prototype.hexDigits = "0123456789ABCDEF";
+Stream.prototype.hexByte = function (b) {
+    return this.hexDigits.charAt((b >> 4) & 0xF) + this.hexDigits.charAt(b & 0xF);
+};
+Stream.prototype.hexDump = function (start, end, raw) {
+    var s = "";
+    for (var i = start; i < end; ++i) {
+        s += this.hexByte(this.get(i));
+        if (raw !== true)
+            switch (i & 0xF) {
+            case 0x7: s += "  "; break;
+            case 0xF: s += "\n"; break;
+            default:  s += " ";
+            }
+    }
+    return s;
+};
+Stream.prototype.parseStringISO = function (start, end) {
+    var s = "";
+    for (var i = start; i < end; ++i)
+        s += String.fromCharCode(this.get(i));
+    return s;
+};
+Stream.prototype.parseStringUTF = function (start, end) {
+    var s = "";
+    for (var i = start; i < end; ) {
+        var c = this.get(i++);
+        if (c < 128)
+            s += String.fromCharCode(c);
+        else if ((c > 191) && (c < 224))
+            s += String.fromCharCode(((c & 0x1F) << 6) | (this.get(i++) & 0x3F));
+        else
+            s += String.fromCharCode(((c & 0x0F) << 12) | ((this.get(i++) & 0x3F) << 6) | (this.get(i++) & 0x3F));
+    }
+    return s;
+};
+Stream.prototype.parseStringBMP = function (start, end) {
+    var str = ""
+    for (var i = start; i < end; i += 2) {
+        var high_byte = this.get(i);
+        var low_byte = this.get(i + 1);
+        str += String.fromCharCode( (high_byte << 8) + low_byte );
+    }
+
+    return str;
+};
+Stream.prototype.reTime = /^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
+Stream.prototype.parseTime = function (start, end) {
+    var s = this.parseStringISO(start, end),
+        m = this.reTime.exec(s);
+    if (!m)
+        return "Unrecognized time: " + s;
+    s = m[1] + "-" + m[2] + "-" + m[3] + " " + m[4];
+    if (m[5]) {
+        s += ":" + m[5];
+        if (m[6]) {
+            s += ":" + m[6];
+            if (m[7])
+                s += "." + m[7];
+        }
+    }
+    if (m[8]) {
+        s += " UTC";
+        if (m[8] != 'Z') {
+            s += m[8];
+            if (m[9])
+                s += ":" + m[9];
+        }
+    }
+    return s;
+};
+Stream.prototype.parseInteger = function (start, end) {
+    //TODO support negative numbers
+    var len = end - start;
+    if (len > 4) {
+        len <<= 3;
+        var s = this.get(start);
+        if (s === 0)
+            len -= 8;
+        else
+            while (s < 128) {
+                s <<= 1;
+                --len;
+            }
+        return "(" + len + " bit)";
+    }
+    var n = 0;
+    for (var i = start; i < end; ++i)
+        n = (n << 8) | this.get(i);
+    return n;
+};
+Stream.prototype.parseBitString = function (start, end) {
+    var unusedBit = this.get(start),
+        lenBit = ((end - start - 1) << 3) - unusedBit,
+        s = "(" + lenBit + " bit)";
+    if (lenBit <= 20) {
+        var skip = unusedBit;
+        s += " ";
+        for (var i = end - 1; i > start; --i) {
+            var b = this.get(i);
+            for (var j = skip; j < 8; ++j)
+                s += (b >> j) & 1 ? "1" : "0";
+            skip = 0;
+        }
+    }
+    return s;
+};
+Stream.prototype.parseOctetString = function (start, end) {
+    var len = end - start,
+        s = "(" + len + " byte) ";
+    if (len > hardLimit)
+        end = start + hardLimit;
+    for (var i = start; i < end; ++i)
+        s += this.hexByte(this.get(i)); //TODO: also try Latin1?
+    if (len > hardLimit)
+        s += ellipsis;
+    return s;
+};
+Stream.prototype.parseOID = function (start, end) {
+    var s = '',
+        n = 0,
+        bits = 0;
+    for (var i = start; i < end; ++i) {
+        var v = this.get(i);
+        n = (n << 7) | (v & 0x7F);
+        bits += 7;
+        if (!(v & 0x80)) { // finished
+            if (s === '') {
+                var m = n < 80 ? n < 40 ? 0 : 1 : 2;
+                s = m + "." + (n - m * 40);
+            } else
+                s += "." + ((bits >= 31) ? "bigint" : n);
+            n = bits = 0;
+        }
+    }
+    return s;
+};
+
+function ASN1(stream, header, length, tag, sub) {
+    this.stream = stream;
+    this.header = header;
+    this.length = length;
+    this.tag = tag;
+    this.sub = sub;
+}
+ASN1.prototype.typeName = function () {
+    if (this.tag === undefined)
+        return "unknown";
+    var tagClass = this.tag >> 6,
+        tagConstructed = (this.tag >> 5) & 1,
+        tagNumber = this.tag & 0x1F;
+    switch (tagClass) {
+    case 0: // universal
+        switch (tagNumber) {
+        case 0x00: return "EOC";
+        case 0x01: return "BOOLEAN";
+        case 0x02: return "INTEGER";
+        case 0x03: return "BIT_STRING";
+        case 0x04: return "OCTET_STRING";
+        case 0x05: return "NULL";
+        case 0x06: return "OBJECT_IDENTIFIER";
+        case 0x07: return "ObjectDescriptor";
+        case 0x08: return "EXTERNAL";
+        case 0x09: return "REAL";
+        case 0x0A: return "ENUMERATED";
+        case 0x0B: return "EMBEDDED_PDV";
+        case 0x0C: return "UTF8String";
+        case 0x10: return "SEQUENCE";
+        case 0x11: return "SET";
+        case 0x12: return "NumericString";
+        case 0x13: return "PrintableString"; // ASCII subset
+        case 0x14: return "TeletexString"; // aka T61String
+        case 0x15: return "VideotexString";
+        case 0x16: return "IA5String"; // ASCII
+        case 0x17: return "UTCTime";
+        case 0x18: return "GeneralizedTime";
+        case 0x19: return "GraphicString";
+        case 0x1A: return "VisibleString"; // ASCII subset
+        case 0x1B: return "GeneralString";
+        case 0x1C: return "UniversalString";
+        case 0x1E: return "BMPString";
+        default:   return "Universal_" + tagNumber.toString(16);
+        }
+    case 1: return "Application_" + tagNumber.toString(16);
+    case 2: return "[" + tagNumber + "]"; // Context
+    case 3: return "Private_" + tagNumber.toString(16);
+    }
+};
+ASN1.prototype.reSeemsASCII = /^[ -~]+$/;
+ASN1.prototype.content = function () {
+    if (this.tag === undefined)
+        return null;
+    var tagClass = this.tag >> 6,
+        tagNumber = this.tag & 0x1F,
+        content = this.posContent(),
+        len = Math.abs(this.length);
+    if (tagClass !== 0) { // universal
+        if (this.sub !== null)
+            return "(" + this.sub.length + " elem)";
+        //TODO: TRY TO PARSE ASCII STRING
+        var s = this.stream.parseStringISO(content, content + Math.min(len, hardLimit));
+        if (this.reSeemsASCII.test(s))
+            return s.substring(0, 2 * hardLimit) + ((s.length > 2 * hardLimit) ? ellipsis : "");
+        else
+            return this.stream.parseOctetString(content, content + len);
+    }
+    switch (tagNumber) {
+    case 0x01: // BOOLEAN
+        return (this.stream.get(content) === 0) ? "false" : "true";
+    case 0x02: // INTEGER
+        return this.stream.parseInteger(content, content + len);
+    case 0x03: // BIT_STRING
+        return this.sub ? "(" + this.sub.length + " elem)" :
+            this.stream.parseBitString(content, content + len);
+    case 0x04: // OCTET_STRING
+        return this.sub ? "(" + this.sub.length + " elem)" :
+            this.stream.parseOctetString(content, content + len);
+    //case 0x05: // NULL
+    case 0x06: // OBJECT_IDENTIFIER
+        return this.stream.parseOID(content, content + len);
+    //case 0x07: // ObjectDescriptor
+    //case 0x08: // EXTERNAL
+    //case 0x09: // REAL
+    //case 0x0A: // ENUMERATED
+    //case 0x0B: // EMBEDDED_PDV
+    case 0x10: // SEQUENCE
+    case 0x11: // SET
+        return "(" + this.sub.length + " elem)";
+    case 0x0C: // UTF8String
+        return this.stream.parseStringUTF(content, content + len);
+    case 0x12: // NumericString
+    case 0x13: // PrintableString
+    case 0x14: // TeletexString
+    case 0x15: // VideotexString
+    case 0x16: // IA5String
+    //case 0x19: // GraphicString
+    case 0x1A: // VisibleString
+    //case 0x1B: // GeneralString
+    //case 0x1C: // UniversalString
+        return this.stream.parseStringISO(content, content + len);
+    case 0x1E: // BMPString
+        return this.stream.parseStringBMP(content, content + len);
+    case 0x17: // UTCTime
+    case 0x18: // GeneralizedTime
+        return this.stream.parseTime(content, content + len);
+    }
+    return null;
+};
+ASN1.prototype.toString = function () {
+    return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + ((this.sub === null) ? 'null' : this.sub.length) + "]";
+};
+ASN1.prototype.print = function (indent) {
+    if (indent === undefined) indent = '';
+    document.writeln(indent + this);
+    if (this.sub !== null) {
+        indent += '  ';
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            this.sub[i].print(indent);
+    }
+};
+ASN1.prototype.toPrettyString = function (indent) {
+    if (indent === undefined) indent = '';
+    var s = indent + this.typeName() + " @" + this.stream.pos;
+    if (this.length >= 0)
+        s += "+";
+    s += this.length;
+    if (this.tag & 0x20)
+        s += " (constructed)";
+    else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))
+        s += " (encapsulates)";
+    s += "\n";
+    if (this.sub !== null) {
+        indent += '  ';
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            s += this.sub[i].toPrettyString(indent);
+    }
+    return s;
+};
+ASN1.prototype.toDOM = function () {
+    var node = DOM.tag("div", "node");
+    node.asn1 = this;
+    var head = DOM.tag("div", "head");
+    var s = this.typeName().replace(/_/g, " ");
+    head.innerHTML = s;
+    var content = this.content();
+    if (content !== null) {
+        content = String(content).replace(/</g, "&lt;");
+        var preview = DOM.tag("span", "preview");
+        preview.appendChild(DOM.text(content));
+        head.appendChild(preview);
+    }
+    node.appendChild(head);
+    this.node = node;
+    this.head = head;
+    var value = DOM.tag("div", "value");
+    s = "Offset: " + this.stream.pos + "<br/>";
+    s += "Length: " + this.header + "+";
+    if (this.length >= 0)
+        s += this.length;
+    else
+        s += (-this.length) + " (undefined)";
+    if (this.tag & 0x20)
+        s += "<br/>(constructed)";
+    else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))
+        s += "<br/>(encapsulates)";
+    //TODO if (this.tag == 0x03) s += "Unused bits: "
+    if (content !== null) {
+        s += "<br/>Value:<br/><b>" + content + "</b>";
+        if ((typeof oids === 'object') && (this.tag == 0x06)) {
+            var oid = oids[content];
+            if (oid) {
+                if (oid.d) s += "<br/>" + oid.d;
+                if (oid.c) s += "<br/>" + oid.c;
+                if (oid.w) s += "<br/>(warning!)";
+            }
+        }
+    }
+    value.innerHTML = s;
+    node.appendChild(value);
+    var sub = DOM.tag("div", "sub");
+    if (this.sub !== null) {
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            sub.appendChild(this.sub[i].toDOM());
+    }
+    node.appendChild(sub);
+    head.onclick = function () {
+        node.className = (node.className == "node collapsed") ? "node" : "node collapsed";
+    };
+    return node;
+};
+ASN1.prototype.posStart = function () {
+    return this.stream.pos;
+};
+ASN1.prototype.posContent = function () {
+    return this.stream.pos + this.header;
+};
+ASN1.prototype.posEnd = function () {
+    return this.stream.pos + this.header + Math.abs(this.length);
+};
+ASN1.prototype.fakeHover = function (current) {
+    this.node.className += " hover";
+    if (current)
+        this.head.className += " hover";
+};
+ASN1.prototype.fakeOut = function (current) {
+    var re = / ?hover/;
+    this.node.className = this.node.className.replace(re, "");
+    if (current)
+        this.head.className = this.head.className.replace(re, "");
+};
+ASN1.prototype.toHexDOM_sub = function (node, className, stream, start, end) {
+    if (start >= end)
+        return;
+    var sub = DOM.tag("span", className);
+    sub.appendChild(DOM.text(
+        stream.hexDump(start, end)));
+    node.appendChild(sub);
+};
+ASN1.prototype.toHexDOM = function (root) {
+    var node = DOM.tag("span", "hex");
+    if (root === undefined) root = node;
+    this.head.hexNode = node;
+    this.head.onmouseover = function () { this.hexNode.className = "hexCurrent"; };
+    this.head.onmouseout  = function () { this.hexNode.className = "hex"; };
+    node.asn1 = this;
+    node.onmouseover = function () {
+        var current = !root.selected;
+        if (current) {
+            root.selected = this.asn1;
+            this.className = "hexCurrent";
+        }
+        this.asn1.fakeHover(current);
+    };
+    node.onmouseout  = function () {
+        var current = (root.selected == this.asn1);
+        this.asn1.fakeOut(current);
+        if (current) {
+            root.selected = null;
+            this.className = "hex";
+        }
+    };
+    this.toHexDOM_sub(node, "tag", this.stream, this.posStart(), this.posStart() + 1);
+    this.toHexDOM_sub(node, (this.length >= 0) ? "dlen" : "ulen", this.stream, this.posStart() + 1, this.posContent());
+    if (this.sub === null)
+        node.appendChild(DOM.text(
+            this.stream.hexDump(this.posContent(), this.posEnd())));
+    else if (this.sub.length > 0) {
+        var first = this.sub[0];
+        var last = this.sub[this.sub.length - 1];
+        this.toHexDOM_sub(node, "intro", this.stream, this.posContent(), first.posStart());
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            node.appendChild(this.sub[i].toHexDOM(root));
+        this.toHexDOM_sub(node, "outro", this.stream, last.posEnd(), this.posEnd());
+    }
+    return node;
+};
+ASN1.prototype.toHexString = function (root) {
+    return this.stream.hexDump(this.posStart(), this.posEnd(), true);
+};
+ASN1.decodeLength = function (stream) {
+    var buf = stream.get(),
+        len = buf & 0x7F;
+    if (len == buf)
+        return len;
+    if (len > 3)
+        throw "Length over 24 bits not supported at position " + (stream.pos - 1);
+    if (len === 0)
+        return -1; // undefined
+    buf = 0;
+    for (var i = 0; i < len; ++i)
+        buf = (buf << 8) | stream.get();
+    return buf;
+};
+ASN1.hasContent = function (tag, len, stream) {
+    if (tag & 0x20) // constructed
+        return true;
+    if ((tag < 0x03) || (tag > 0x04))
+        return false;
+    var p = new Stream(stream);
+    if (tag == 0x03) p.get(); // BitString unused bits, must be in [0, 7]
+    var subTag = p.get();
+    if ((subTag >> 6) & 0x01) // not (universal or context)
+        return false;
+    try {
+        var subLength = ASN1.decodeLength(p);
+        return ((p.pos - stream.pos) + subLength == len);
+    } catch (exception) {
+        return false;
+    }
+};
+ASN1.decode = function (stream) {
+    if (!(stream instanceof Stream))
+        stream = new Stream(stream, 0);
+    var streamStart = new Stream(stream),
+        tag = stream.get(),
+        len = ASN1.decodeLength(stream),
+        header = stream.pos - streamStart.pos,
+        sub = null;
+    if (ASN1.hasContent(tag, len, stream)) {
+        // it has content, so we decode it
+        var start = stream.pos;
+        if (tag == 0x03) stream.get(); // skip BitString unused bits, must be in [0, 7]
+        sub = [];
+        if (len >= 0) {
+            // definite length
+            var end = start + len;
+            while (stream.pos < end)
+                sub[sub.length] = ASN1.decode(stream);
+            if (stream.pos != end)
+                throw "Content size is not correct for container starting at offset " + start;
+        } else {
+            // undefined length
+            try {
+                for (;;) {
+                    var s = ASN1.decode(stream);
+                    if (s.tag === 0)
+                        break;
+                    sub[sub.length] = s;
+                }
+                len = start - stream.pos;
+            } catch (e) {
+                throw "Exception while decoding undefined length content: " + e;
+            }
+        }
+    } else
+        stream.pos += len; // skip content
+    return new ASN1(streamStart, header, len, tag, sub);
+};
+ASN1.test = function () {
+    var test = [
+        { value: [0x27],                   expected: 0x27     },
+        { value: [0x81, 0xC9],             expected: 0xC9     },
+        { value: [0x83, 0xFE, 0xDC, 0xBA], expected: 0xFEDCBA }
+    ];
+    for (var i = 0, max = test.length; i < max; ++i) {
+        var pos = 0,
+            stream = new Stream(test[i].value, 0),
+            res = ASN1.decodeLength(stream);
+        if (res != test[i].expected)
+            document.write("In test[" + i + "] expected " + test[i].expected + " got " + res + "\n");
+    }
+};
+
+// export globals
+window.ASN1 = ASN1;
+})();
+/**
+ * Retrieve the hexadecimal value (as a string) of the current ASN.1 element
+ * @returns {string}
+ * @public
+ */
+ASN1.prototype.getHexStringValue = function () {
+  var hexString = this.toHexString();
+  var offset = this.header * 2;
+  var length = this.length * 2;
+  return hexString.substr(offset, length);
+};
+
+/**
+ * Method to parse a pem encoded string containing both a public or private key.
+ * The method will translate the pem encoded string in a der encoded string and
+ * will parse private key and public key parameters. This method accepts public key
+ * in the rsaencryption pkcs #1 format (oid: 1.2.840.113549.1.1.1).
+ *
+ * @todo Check how many rsa formats use the same format of pkcs #1.
+ *
+ * The format is defined as:
+ * PublicKeyInfo ::= SEQUENCE {
+ *   algorithm       AlgorithmIdentifier,
+ *   PublicKey       BIT STRING
+ * }
+ * Where AlgorithmIdentifier is:
+ * AlgorithmIdentifier ::= SEQUENCE {
+ *   algorithm       OBJECT IDENTIFIER,     the OID of the enc algorithm
+ *   parameters      ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
+ * }
+ * and PublicKey is a SEQUENCE encapsulated in a BIT STRING
+ * RSAPublicKey ::= SEQUENCE {
+ *   modulus           INTEGER,  -- n
+ *   publicExponent    INTEGER   -- e
+ * }
+ * it's possible to examine the structure of the keys obtained from openssl using
+ * an asn.1 dumper as the one used here to parse the components: http://lapo.it/asn1js/
+ * @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer
+ * @private
+ */
+RSAKey.prototype.parseKey = function (pem) {
+  try {
+    var modulus = 0;
+    var public_exponent = 0;
+    var reHex = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;
+    var der = reHex.test(pem) ? Hex.decode(pem) : Base64.unarmor(pem);
+    var asn1 = ASN1.decode(der);
+
+    //Fixes a bug with OpenSSL 1.0+ private keys
+    if(asn1.sub.length === 3){
+        asn1 = asn1.sub[2].sub[0];
+    }
+    if (asn1.sub.length === 9) {
+
+      // Parse the private key.
+      modulus = asn1.sub[1].getHexStringValue(); //bigint
+      this.n = parseBigInt(modulus, 16);
+
+      public_exponent = asn1.sub[2].getHexStringValue(); //int
+      this.e = parseInt(public_exponent, 16);
+
+      var private_exponent = asn1.sub[3].getHexStringValue(); //bigint
+      this.d = parseBigInt(private_exponent, 16);
+
+      var prime1 = asn1.sub[4].getHexStringValue(); //bigint
+      this.p = parseBigInt(prime1, 16);
+
+      var prime2 = asn1.sub[5].getHexStringValue(); //bigint
+      this.q = parseBigInt(prime2, 16);
+
+      var exponent1 = asn1.sub[6].getHexStringValue(); //bigint
+      this.dmp1 = parseBigInt(exponent1, 16);
+
+      var exponent2 = asn1.sub[7].getHexStringValue(); //bigint
+      this.dmq1 = parseBigInt(exponent2, 16);
+
+      var coefficient = asn1.sub[8].getHexStringValue(); //bigint
+      this.coeff = parseBigInt(coefficient, 16);
+
+    }
+    else if (asn1.sub.length === 2) {
+
+      // Parse the public key.
+      var bit_string = asn1.sub[1];
+      var sequence = bit_string.sub[0];
+
+      modulus = sequence.sub[0].getHexStringValue();
+      this.n = parseBigInt(modulus, 16);
+      public_exponent = sequence.sub[1].getHexStringValue();
+      this.e = parseInt(public_exponent, 16);
+
+    }
+    else {
+      return false;
+    }
+    return true;
+  }
+  catch (ex) {
+    return false;
+  }
+};
+
+/**
+ * Translate rsa parameters in a hex encoded string representing the rsa key.
+ *
+ * The translation follow the ASN.1 notation :
+ * RSAPrivateKey ::= SEQUENCE {
+ *   version           Version,
+ *   modulus           INTEGER,  -- n
+ *   publicExponent    INTEGER,  -- e
+ *   privateExponent   INTEGER,  -- d
+ *   prime1            INTEGER,  -- p
+ *   prime2            INTEGER,  -- q
+ *   exponent1         INTEGER,  -- d mod (p1)
+ *   exponent2         INTEGER,  -- d mod (q-1)
+ *   coefficient       INTEGER,  -- (inverse of q) mod p
+ * }
+ * @returns {string}  DER Encoded String representing the rsa private key
+ * @private
+ */
+RSAKey.prototype.getPrivateBaseKey = function () {
+  var options = {
+    'array': [
+      new KJUR.asn1.DERInteger({'int': 0}),
+      new KJUR.asn1.DERInteger({'bigint': this.n}),
+      new KJUR.asn1.DERInteger({'int': this.e}),
+      new KJUR.asn1.DERInteger({'bigint': this.d}),
+      new KJUR.asn1.DERInteger({'bigint': this.p}),
+      new KJUR.asn1.DERInteger({'bigint': this.q}),
+      new KJUR.asn1.DERInteger({'bigint': this.dmp1}),
+      new KJUR.asn1.DERInteger({'bigint': this.dmq1}),
+      new KJUR.asn1.DERInteger({'bigint': this.coeff})
+    ]
+  };
+  var seq = new KJUR.asn1.DERSequence(options);
+  return seq.getEncodedHex();
+};
+
+/**
+ * base64 (pem) encoded version of the DER encoded representation
+ * @returns {string} pem encoded representation without header and footer
+ * @public
+ */
+RSAKey.prototype.getPrivateBaseKeyB64 = function () {
+  return hex2b64(this.getPrivateBaseKey());
+};
+
+/**
+ * Translate rsa parameters in a hex encoded string representing the rsa public key.
+ * The representation follow the ASN.1 notation :
+ * PublicKeyInfo ::= SEQUENCE {
+ *   algorithm       AlgorithmIdentifier,
+ *   PublicKey       BIT STRING
+ * }
+ * Where AlgorithmIdentifier is:
+ * AlgorithmIdentifier ::= SEQUENCE {
+ *   algorithm       OBJECT IDENTIFIER,     the OID of the enc algorithm
+ *   parameters      ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
+ * }
+ * and PublicKey is a SEQUENCE encapsulated in a BIT STRING
+ * RSAPublicKey ::= SEQUENCE {
+ *   modulus           INTEGER,  -- n
+ *   publicExponent    INTEGER   -- e
+ * }
+ * @returns {string} DER Encoded String representing the rsa public key
+ * @private
+ */
+RSAKey.prototype.getPublicBaseKey = function () {
+  var options = {
+    'array': [
+      new KJUR.asn1.DERObjectIdentifier({'oid': '1.2.840.113549.1.1.1'}), //RSA Encryption pkcs #1 oid
+      new KJUR.asn1.DERNull()
+    ]
+  };
+  var first_sequence = new KJUR.asn1.DERSequence(options);
+
+  options = {
+    'array': [
+      new KJUR.asn1.DERInteger({'bigint': this.n}),
+      new KJUR.asn1.DERInteger({'int': this.e})
+    ]
+  };
+  var second_sequence = new KJUR.asn1.DERSequence(options);
+
+  options = {
+    'hex': '00' + second_sequence.getEncodedHex()
+  };
+  var bit_string = new KJUR.asn1.DERBitString(options);
+
+  options = {
+    'array': [
+      first_sequence,
+      bit_string
+    ]
+  };
+  var seq = new KJUR.asn1.DERSequence(options);
+  return seq.getEncodedHex();
+};
+
+/**
+ * base64 (pem) encoded version of the DER encoded representation
+ * @returns {string} pem encoded representation without header and footer
+ * @public
+ */
+RSAKey.prototype.getPublicBaseKeyB64 = function () {
+  return hex2b64(this.getPublicBaseKey());
+};
+
+/**
+ * wrap the string in block of width chars. The default value for rsa keys is 64
+ * characters.
+ * @param {string} str the pem encoded string without header and footer
+ * @param {Number} [width=64] - the length the string has to be wrapped at
+ * @returns {string}
+ * @private
+ */
+RSAKey.prototype.wordwrap = function (str, width) {
+  width = width || 64;
+  if (!str) {
+    return str;
+  }
+  var regex = '(.{1,' + width + '})( +|$\n?)|(.{1,' + width + '})';
+  return str.match(RegExp(regex, 'g')).join('\n');
+};
+
+/**
+ * Retrieve the pem encoded private key
+ * @returns {string} the pem encoded private key with header/footer
+ * @public
+ */
+RSAKey.prototype.getPrivateKey = function () {
+  var key = "-----BEGIN RSA PRIVATE KEY-----\n";
+  key += this.wordwrap(this.getPrivateBaseKeyB64()) + "\n";
+  key += "-----END RSA PRIVATE KEY-----";
+  return key;
+};
+
+/**
+ * Retrieve the pem encoded public key
+ * @returns {string} the pem encoded public key with header/footer
+ * @public
+ */
+RSAKey.prototype.getPublicKey = function () {
+  var key = "-----BEGIN PUBLIC KEY-----\n";
+  key += this.wordwrap(this.getPublicBaseKeyB64()) + "\n";
+  key += "-----END PUBLIC KEY-----";
+  return key;
+};
+
+/**
+ * Check if the object contains the necessary parameters to populate the rsa modulus
+ * and public exponent parameters.
+ * @param {Object} [obj={}] - An object that may contain the two public key
+ * parameters
+ * @returns {boolean} true if the object contains both the modulus and the public exponent
+ * properties (n and e)
+ * @todo check for types of n and e. N should be a parseable bigInt object, E should
+ * be a parseable integer number
+ * @private
+ */
+RSAKey.prototype.hasPublicKeyProperty = function (obj) {
+  obj = obj || {};
+  return (
+    obj.hasOwnProperty('n') &&
+    obj.hasOwnProperty('e')
+  );
+};
+
+/**
+ * Check if the object contains ALL the parameters of an RSA key.
+ * @param {Object} [obj={}] - An object that may contain nine rsa key
+ * parameters
+ * @returns {boolean} true if the object contains all the parameters needed
+ * @todo check for types of the parameters all the parameters but the public exponent
+ * should be parseable bigint objects, the public exponent should be a parseable integer number
+ * @private
+ */
+RSAKey.prototype.hasPrivateKeyProperty = function (obj) {
+  obj = obj || {};
+  return (
+    obj.hasOwnProperty('n') &&
+    obj.hasOwnProperty('e') &&
+    obj.hasOwnProperty('d') &&
+    obj.hasOwnProperty('p') &&
+    obj.hasOwnProperty('q') &&
+    obj.hasOwnProperty('dmp1') &&
+    obj.hasOwnProperty('dmq1') &&
+    obj.hasOwnProperty('coeff')
+  );
+};
+
+/**
+ * Parse the properties of obj in the current rsa object. Obj should AT LEAST
+ * include the modulus and public exponent (n, e) parameters.
+ * @param {Object} obj - the object containing rsa parameters
+ * @private
+ */
+RSAKey.prototype.parsePropertiesFrom = function (obj) {
+  this.n = obj.n;
+  this.e = obj.e;
+
+  if (obj.hasOwnProperty('d')) {
+    this.d = obj.d;
+    this.p = obj.p;
+    this.q = obj.q;
+    this.dmp1 = obj.dmp1;
+    this.dmq1 = obj.dmq1;
+    this.coeff = obj.coeff;
+  }
+};
+
+/**
+ * Create a new JSEncryptRSAKey that extends Tom Wu's RSA key object.
+ * This object is just a decorator for parsing the key parameter
+ * @param {string|Object} key - The key in string format, or an object containing
+ * the parameters needed to build a RSAKey object.
+ * @constructor
+ */
+var JSEncryptRSAKey = function (key) {
+  // Call the super constructor.
+  RSAKey.call(this);
+  // If a key key was provided.
+  if (key) {
+    // If this is a string...
+    if (typeof key === 'string') {
+      this.parseKey(key);
+    }
+    else if (
+      this.hasPrivateKeyProperty(key) ||
+      this.hasPublicKeyProperty(key)
+    ) {
+      // Set the values for the key.
+      this.parsePropertiesFrom(key);
+    }
+  }
+};
+
+// Derive from RSAKey.
+JSEncryptRSAKey.prototype = new RSAKey();
+
+// Reset the contructor.
+JSEncryptRSAKey.prototype.constructor = JSEncryptRSAKey;
+
+
+/**
+ *
+ * @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
+ * possible parameters are:
+ * - default_key_size        {number}  default: 1024 the key size in bit
+ * - default_public_exponent {string}  default: '010001' the hexadecimal representation of the public exponent
+ * - log                     {boolean} default: false whether log warn/error or not
+ * @constructor
+ */
+var JSEncrypt = function (options) {
+  options = options || {};
+  this.default_key_size = parseInt(options.default_key_size) || 1024;
+  this.default_public_exponent = options.default_public_exponent || '010001'; //65537 default openssl public exponent for rsa key type
+  this.log = options.log || false;
+  // The private and public key.
+  this.key = null;
+};
+
+/**
+ * Method to set the rsa key parameter (one method is enough to set both the public
+ * and the private key, since the private key contains the public key paramenters)
+ * Log a warning if logs are enabled
+ * @param {Object|string} key the pem encoded string or an object (with or without header/footer)
+ * @public
+ */
+JSEncrypt.prototype.setKey = function (key) {
+  if (this.log && this.key) {
+    console.warn('A key was already set, overriding existing.');
+  }
+  this.key = new JSEncryptRSAKey(key);
+};
+
+/**
+ * Proxy method for setKey, for api compatibility
+ * @see setKey
+ * @public
+ */
+JSEncrypt.prototype.setPrivateKey = function (privkey) {
+  // Create the key.
+  this.setKey(privkey);
+};
+
+/**
+ * Proxy method for setKey, for api compatibility
+ * @see setKey
+ * @public
+ */
+JSEncrypt.prototype.setPublicKey = function (pubkey) {
+  // Sets the public key.
+  this.setKey(pubkey);
+};
+
+/**
+ * Proxy method for RSAKey object's decrypt, decrypt the string using the private
+ * components of the rsa key object. Note that if the object was not set will be created
+ * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
+ * @param {string} string base64 encoded crypted string to decrypt
+ * @return {string} the decrypted string
+ * @public
+ */
+JSEncrypt.prototype.decrypt = function (string) {
+  // Return the decrypted string.
+  try {
+    return this.getKey().decrypt(b64tohex(string));
+  }
+  catch (ex) {
+    return false;
+  }
+};
+
+/**
+ * Proxy method for RSAKey object's encrypt, encrypt the string using the public
+ * components of the rsa key object. Note that if the object was not set will be created
+ * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
+ * @param {string} string the string to encrypt
+ * @return {string} the encrypted string encoded in base64
+ * @public
+ */
+JSEncrypt.prototype.encrypt = function (string) {
+  // Return the encrypted string.
+  try {
+    return hex2b64(this.getKey().encrypt(string));
+  }
+  catch (ex) {
+    return false;
+  }
+};
+
+/**
+ * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
+ * will be created and returned
+ * @param {callback} [cb] the callback to be called if we want the key to be generated
+ * in an async fashion
+ * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
+ * @public
+ */
+JSEncrypt.prototype.getKey = function (cb) {
+  // Only create new if it does not exist.
+  if (!this.key) {
+    // Get a new private key.
+    this.key = new JSEncryptRSAKey();
+    if (cb && {}.toString.call(cb) === '[object Function]') {
+      this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);
+      return;
+    }
+    // Generate the key.
+    this.key.generate(this.default_key_size, this.default_public_exponent);
+  }
+  return this.key;
+};
+
+/**
+ * Returns the pem encoded representation of the private key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the private key WITH header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPrivateKey = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPrivateKey();
+};
+
+/**
+ * Returns the pem encoded representation of the private key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the private key WITHOUT header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPrivateKeyB64 = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPrivateBaseKeyB64();
+};
+
+
+/**
+ * Returns the pem encoded representation of the public key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the public key WITH header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPublicKey = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPublicKey();
+};
+
+/**
+ * Returns the pem encoded representation of the public key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the public key WITHOUT header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPublicKeyB64 = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPublicBaseKeyB64();
+};
+
+
+  JSEncrypt.version = '2.3.1';
+  // exports.JSEncrypt = JSEncrypt;
+  window['JSEncrypt'] = JSEncrypt;
+});

+ 9 - 0
tower_sanguo/assets/MOKA/util/rsa/jsencrypt.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "a9b1dc9d-74a4-4d83-ad64-bf9ac566c968",
+  "isPlugin": true,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 69 - 0
tower_sanguo/assets/MOKA/util/util.ts

@@ -0,0 +1,69 @@
+const BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
+
+export function int2char(n:number) {
+    return BI_RM.charAt(n);
+}
+
+//#region BIT_OPERATIONS
+
+// (public) this & a
+export function op_and(x:number, y:number):number {
+    return x & y;
+}
+
+
+// (public) this | a
+export function op_or(x:number, y:number):number {
+    return x | y;
+}
+
+// (public) this ^ a
+export function op_xor(x:number, y:number):number {
+    return x ^ y;
+}
+
+
+// (public) this & ~a
+export function op_andnot(x:number, y:number):number {
+    return x & ~y;
+}
+
+// return index of lowest 1-bit in x, x < 2^31
+export function lbit(x:number) {
+    if (x == 0) {
+        return -1;
+    }
+    let r = 0;
+    if ((x & 0xffff) == 0) {
+        x >>= 16;
+        r += 16;
+    }
+    if ((x & 0xff) == 0) {
+        x >>= 8;
+        r += 8;
+    }
+    if ((x & 0xf) == 0) {
+        x >>= 4;
+        r += 4;
+    }
+    if ((x & 3) == 0) {
+        x >>= 2;
+        r += 2;
+    }
+    if ((x & 1) == 0) {
+        ++r;
+    }
+    return r;
+}
+
+// return number of 1 bits in x
+export function cbit(x:number) {
+    let r = 0;
+    while (x != 0) {
+        x &= x - 1;
+        ++r;
+    }
+    return r;
+}
+
+//#endregion BIT_OPERATIONS

+ 9 - 0
tower_sanguo/assets/MOKA/util/util.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "c87bfb28-c921-467e-8cb6-bf08438e6104",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "98435cf6-be6f-4754-9359-bfa5fd4bc6f9",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/anim.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "43f01998-3743-4860-b515-2e8ea2285224",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/data.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "805686a9-5acf-45bc-a02b-9742e87d28b6",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 30 - 0
tower_sanguo/assets/resources/data/AchieveCfg.json

@@ -0,0 +1,30 @@
+{
+"1": [
+{"index":0,"condition":100,"reward_type":10002,"rewadr_num":50},
+{"index":1,"condition":300,"reward_type":10002,"rewadr_num":100},
+{"index":2,"condition":600,"reward_type":10002,"rewadr_num":150},
+{"index":3,"condition":1000,"reward_type":10002,"rewadr_num":200},
+{"index":4,"condition":5000,"reward_type":10002,"rewadr_num":300}
+],
+"2": [
+{"index":0,"condition":10,"reward_type":10002,"rewadr_num":50},
+{"index":1,"condition":15,"reward_type":10002,"rewadr_num":100},
+{"index":2,"condition":20,"reward_type":10002,"rewadr_num":150},
+{"index":3,"condition":50,"reward_type":10002,"rewadr_num":200},
+{"index":4,"condition":100,"reward_type":10002,"rewadr_num":300}
+],
+"3": [
+{"index":0,"condition":100,"reward_type":10002,"rewadr_num":100},
+{"index":1,"condition":300,"reward_type":10002,"rewadr_num":200},
+{"index":2,"condition":500,"reward_type":10002,"rewadr_num":300},
+{"index":3,"condition":1000,"reward_type":10002,"rewadr_num":400},
+{"index":4,"condition":5000,"reward_type":10002,"rewadr_num":600}
+],    
+"4": [
+{"index":0,"condition":10,"reward_type":10002,"rewadr_num":50},
+{"index":1,"condition":15,"reward_type":10002,"rewadr_num":100},
+{"index":2,"condition":20,"reward_type":10002,"rewadr_num":150},
+{"index":3,"condition":50,"reward_type":10002,"rewadr_num":200},
+{"index":4,"condition":100,"reward_type":10002,"rewadr_num":300}
+]
+}

+ 5 - 0
tower_sanguo/assets/resources/data/AchieveCfg.json.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.0",
+  "uuid": "50aea08f-1918-4aba-966b-9790ec06d523",
+  "subMetas": {}
+}

+ 550 - 0
tower_sanguo/assets/resources/data/guide.json

@@ -0,0 +1,550 @@
+{
+    "task":{
+        "task1":{
+            "id":1,
+            "desc":"新用户首次引导",
+            "steps":[
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b>施主,欢迎来到\n东土大唐</b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b><size=45><color=red>牛年已至</color></size>,小僧准\n备了见面礼</b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/centorPart/btnTixian","<b>购买妖怪,即可<size=45><color=red>\n每日提现</color></size></b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["RedPackageNode/Par/frontCashNode/btnCashOpen","<b><size=45><color=red>领取</color></size>今日提现任务!</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["RedPackageNode/Par/frontCashNode/hongbao_1/guideRect","<b><size=45><color=red>完成任务</color></size>,即可\n<size=45><color=red>提现</color></size></b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["RedPackageNode/Par/frontCashNode/hongbao_1/guideRect","<b>主场景<size=45><color=red>购买妖怪</color></size>,\n可增加任务进度</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/downPart/btnBuy","<b><size=45><color=red>购买</color></size>第1只小妖</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/downPart/btnBuy","<b>再<size=45><color=red>购买</color></size>1只小妖</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"拖拽合成",
+                    "cmd":"drag1",
+                    "args":["HallNode/CarPark/0","HallNode/CarPark/1","<b>拖动小妖进行合成</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/downPart/btnBuy","<b>继续购买妖怪,\n<size=45><color=red>增加提现进度吧!</color></size></b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task2":{
+            "id":2,
+            "desc":"五福引导",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/centorPart/btnTixian","<b>天天五福开启啦</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["RedPackageNode/Par/frontCashNode/panel/btn_nor_ok","<b>领取今日五福任务</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["RedPackageNode/Par/frontCashNode/panel/btn_nor_ok","<b>购买小妖可增加\n福气值</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["RedPackageNode/Par/frontCashNode/panel/fiveluck_table/guideRect","<b>福气值满后,即可\n立即提现</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task3":{
+            "id":3,
+            "desc":"伙伴引导",
+            "steps":[
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b>多谢施主协助收服\n“悟空”</b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/downPart/btnMate","<b>有了“悟空”,我们\n就能斩妖除魔了</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["Panel/MatePanel/Panel/menu","<b>这是伙伴的天赋效果</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["Panel/MatePanel/Panel/menu/Talent/Rect/content/TalentItem/btnUplv","<b><size=45><color=red>天赋</color></size>可以进行<size=45><color=red>升级</color></size></b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["Panel/MatePanel/Panel/menu/Talent/Rect/content/TalentItem","<b>天赋升级成功</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["Panel/MatePanel/Panel/btnBack","<b>点击回到主页</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task4":{
+            "id":4,
+            "desc":"战斗引导",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["Panel/FightRoleBPanel/Panel/btnChallenge","<b>点击开启战斗</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["Panel/FightPanel/Panel/guideRect2","<b>点击妖怪可对妖怪\n造成伤害</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task5":{
+            "id":5,
+            "desc":"化缘引导",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/InvestNode/Par/ScrollView/view/content/1/btnInvest","<b>化缘可获得大量收益</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/InvestNode/Par/ScrollView/view/content/1","<b>5分钟后记得回来\n查收哦</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task6":{
+            "id":6,
+            "desc":"现金多宝1",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/TreasureNode/treasurePart/topPart/guideRect1","<b>参与夺宝需要\n使用“夺宝券”</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/TreasureNode/treasurePart/topPart/guideRect2","<b>点击“参与夺宝”\n即可参与啦</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/TreasureNode/treasurePart/topPart/guideRect2","<b>中奖之后即可\n立即提现</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task7":{
+            "id":7,
+            "desc":"钱庄",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/centorPart/btnBank","<b>钱庄开启啦</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/SafeDepositBox/guideRect1","<b>提现的金额都能\n存入钱庄哦</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/SafeDepositBox/guideRect2","<b>达到指定金额即可\n提现</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task8":{
+            "id":8,
+            "desc":"日常任务",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["TaskNode/Par/guideRect1","<b>完成任务可获得\n活跃值哦</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["TaskNode/Par/guideRect2","<b>达到规定活跃值即可\n领奖</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task9":{
+            "id":9,
+            "desc":"登录豪礼",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/centorPart/btnDaily","<b>登录豪礼开启啦</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/DailyNode/Par/guideRect1","<b>登陆奖励在这哦</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/DailyNode/Par/guideRect2","<b>达到规定天数即可\n领取奖励</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task10":{
+            "id":10,
+            "desc":"提现",
+            "steps":[
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b>多谢施主协助\n降服黑熊精</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/FightResultPanel/Panel/success/btnCash","<b>快去领取降服\n奖励吧</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["onPanelPar/CashNode/main/top/centerPart/guideRect","<b><size=45><color=red>仙玉足够</color></size>才能提现\n提现哦</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/CashNode/main/top/downPart/guideRect","<b>点击开启黑熊精\n<size=45><color=red>红包奖励</color></size></b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task11":{
+            "id":11,
+            "desc":"点击妖怪生产金币",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/CarPark/0/chewei","<b>点击妖怪可加速产\n出金币哦</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/CarPark/0/chewei","<b>再点几下试试</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/CarPark/0/chewei","<b>点击会有更多金钱</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/CarPark/0/chewei","<b>要发财咯</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task12":{
+            "id":12,
+            "desc":"五福条件达成 提现引导",
+            "steps":[
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b>每日提现任务完成,\n可以提现啦!</b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/centorPart/btnTixian","<b>打开每日提现</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["RedPackageNode/Par/frontCashNode/btnCashOpen","<b>点击打开</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["RedPackageNode/Par/backNode/moneyPart/authBtn","<b>授权后,\n即可提现</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task13":{
+            "id":13,
+            "desc":"现金多宝2",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["onPanelPar/TreasureNode/treasurePart/topPart/guideRect1","<b>参与夺宝需要使用\n“夺宝券”</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["onPanelPar/TreasureNode/treasurePart/topPart/guideRect2","<b>点击“参与夺宝”即可\n参与啦</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["onPanelPar/TreasureNode/treasurePart/topPart/guideRect2","<b>中奖之后即可立即\n提现</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task14":{
+            "id":14,
+            "desc":"提现开启引导",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["Panel/FightResultPanel/Panel/success/btnCash","<b>点击立即提现</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/CashNode/main/top/centerPart/guideRect","<b><size=45><color=red>仙玉足够</color></size>才能提现\n红包奖励</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/CashNode/main/top/downPart/guideRect","<b>点击开启黑熊精\n<size=45><color=red>红包奖励</color></size></b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task15":{
+            "id":15,
+            "desc":"转盘开启引导",
+            "steps":[
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b><size=45><color=red>转盘</color></size>功能开启啦</b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/centorPart/btnTurntable","<b>点击进入转盘</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/TurnTableNode/btnDraw","<b>看看施主的<size=45><color=red>运气</color></size>吧</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["giftNode/Par/dropPart/btnGetGold","<b>快快领取<size=45><color=red>奖励</color></size>吧</b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["onPanelPar/TurnTableNode/guideRect","<b>参与次数每天<size=45><color=red>12点\n,18点,24点</color></size>恢复</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task16":{
+            "id":16,
+            "desc":"登录奖励引导",
+            "steps":[
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b>黑熊精奖励消耗了\n<size=45><color=red>很多仙玉</color></size>吧</b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b>我来告诉你怎么获得\n<size=45><color=red>更多仙玉</color></size></b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/centorPart/btnDaily","<b>打开<size=45><color=red>登录豪礼</color></size></b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/DailyNode/Par/guideRect1","<b>登录豪礼送<size=45><color=red>大量仙玉</color></size></b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["onPanelPar/DailyNode/Par/guideRect2","<b>坚持登录即可\n领取奖励</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task17":{
+            "id":17,
+            "desc":"财神降临引导",
+            "steps":[                
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["GameWealth/Game/wealth","<b>点击财神,可加快\n<size=45><color=red>聚宝盆进度</color></size></b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["GameWealth/Game/wealth","<b>点击财神,可加快\n<size=45><color=red>聚宝盆进度</color></size></b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["GameWealth/Game/wealth","<b>点击财神,可加快\n<size=45><color=red>聚宝盆进度</color></size></b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["GameWealth/Game/wealth","<b>进度达到100%后,可\n获得<size=45><color=red>财神献礼</color></size></b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task18":{
+            "id":18,
+            "desc":"财神献礼引导",
+            "steps":[
+                {
+                    "desc":"提示文本",
+                    "cmd":"text",
+                    "args":["<b>恭喜你获得了财神\n的<size=45><color=red>献礼</color></size></b>"],
+                    "nexrPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["HallNode/topPart/btnWealth","<b>一段时间后,财神会\n<size=45><color=red>再来一次</color></size></b>"],
+                    "nextPause":false
+                },
+                {
+                    "desc":"点击手指",
+                    "cmd":"highlight",
+                    "args":["Panel/WealthPanel/Panel/guideCooling","<b>记得<size=45><color=red>准时</color></size>来获取\n奖励哦</b>"],
+                    "nextPause":false
+                }
+            ]
+        },
+        "task19":{
+            "id":19,
+            "desc":"明日提现引导",
+            "steps":[
+                {
+                    "desc":"点击手指",
+                    "cmd":"finger",
+                    "args":["RedPackageNode/Par/frontCashNode/btnCashOpen","<b>点击开启\n明日提现</b>"],
+                    "nextPause":true
+                },
+                {
+                    "desc":"框选",
+                    "cmd":"highlight",
+                    "args":["RedPackageNode/Par/frontCashNode/hongbao_1/hongbao_mingri","<b>任务完成后,\n明日即可提现</b>"],
+                    "nextPause":false
+                }
+            ]
+        }
+    }
+}

+ 5 - 0
tower_sanguo/assets/resources/data/guide.json.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.0",
+  "uuid": "a1ff5861-4419-4178-afb1-74e613b89d97",
+  "subMetas": {}
+}

+ 5 - 0
tower_sanguo/assets/resources/data/mission.json

@@ -0,0 +1,5 @@
+[
+    {
+        
+    }
+]

+ 5 - 0
tower_sanguo/assets/resources/data/mission.json.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.0",
+  "uuid": "f59142a8-d9b8-440d-80b4-89d24600c7b2",
+  "subMetas": {}
+}

+ 3 - 0
tower_sanguo/assets/resources/data/monster.json

@@ -0,0 +1,3 @@
+{
+  
+}

+ 5 - 0
tower_sanguo/assets/resources/data/monster.json.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.0",
+  "uuid": "0563d2d4-4704-48d5-80e4-6130eb47ab59",
+  "subMetas": {}
+}

+ 16 - 0
tower_sanguo/assets/resources/data/resList.json

@@ -0,0 +1,16 @@
+[
+
+  {
+    "id": 4,
+    "type": "wav",
+    "name": "Sutra_PickUP",
+    "url": "music/"
+  },
+  {
+    "id": 5,
+    "type": "mp3",
+    "name": "victory",
+    "url": "music/"
+  }
+
+]

+ 5 - 0
tower_sanguo/assets/resources/data/resList.json.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.0",
+  "uuid": "7de3453b-ae1f-4a69-a6c1-cf9036c35003",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/effect.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "0fee5ca9-3d42-48cc-9e7d-0119cc900f66",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/module.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "50e92dfd-9e23-4ff5-b6a7-c851c1057831",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/module/fight.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "b3bee9ab-b579-4a0f-8ec8-121726f4699c",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

BIN
tower_sanguo/assets/resources/module/fight/attack_normal.png


+ 36 - 0
tower_sanguo/assets/resources/module/fight/attack_normal.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "fce16b4a-db39-4c92-a4b9-9c0fabc6a5c9",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 125,
+  "height": 108,
+  "platformSettings": {},
+  "subMetas": {
+    "attack_normal": {
+      "ver": "1.0.4",
+      "uuid": "a7ced0f1-dc08-43bf-9951-6f79ccc9a3f7",
+      "rawTextureUuid": "fce16b4a-db39-4c92-a4b9-9c0fabc6a5c9",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 125,
+      "height": 108,
+      "rawWidth": 125,
+      "rawHeight": 108,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
tower_sanguo/assets/resources/module/fight/bg_fight.png


+ 36 - 0
tower_sanguo/assets/resources/module/fight/bg_fight.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "e6e7eb2e-6bcd-4138-a5b9-1c30a2473c67",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 750,
+  "height": 1334,
+  "platformSettings": {},
+  "subMetas": {
+    "bg_fight": {
+      "ver": "1.0.4",
+      "uuid": "4971645b-bcb7-49bb-9bf1-dc65fbf1adae",
+      "rawTextureUuid": "e6e7eb2e-6bcd-4138-a5b9-1c30a2473c67",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 750,
+      "height": 1334,
+      "rawWidth": 750,
+      "rawHeight": 1334,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 775 - 0
tower_sanguo/assets/resources/module/fight/fight.prefab

@@ -0,0 +1,775 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "fight",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 8
+      },
+      {
+        "__id__": 11
+      },
+      {
+        "__id__": 14
+      },
+      {
+        "__id__": 17
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 20
+      }
+    ],
+    "_prefab": {
+      "__id__": 21
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 750,
+      "height": 1334
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        375,
+        667,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "bg_fight",
+    "_objFlags": 512,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 750,
+      "height": 1334
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "4971645b-bcb7-49bb-9bf1-dc65fbf1adae"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "42451b9d-0b8f-43df-bba7-24efa7828d8c"
+    },
+    "fileId": "37XrVh1xdF14zK2+E3RSno",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "general_bg1",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 6
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 128,
+      "height": 128
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        -85.568,
+        203.988,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 5
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "f830714a-904a-4e31-bf8e-c47f7733a452"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "42451b9d-0b8f-43df-bba7-24efa7828d8c"
+    },
+    "fileId": "945XMc1Q1DVZSaLMoSs5jP",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "general_bg2",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 9
+      }
+    ],
+    "_prefab": {
+      "__id__": 10
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 128,
+      "height": 128
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        135.115,
+        197.363,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 8
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "f830714a-904a-4e31-bf8e-c47f7733a452"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "42451b9d-0b8f-43df-bba7-24efa7828d8c"
+    },
+    "fileId": "28H8/TSo5PopPx9h/T6idu",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "general_bg3",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 12
+      }
+    ],
+    "_prefab": {
+      "__id__": 13
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 128,
+      "height": 128
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        -101.694,
+        -92.462,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 11
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "f830714a-904a-4e31-bf8e-c47f7733a452"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "42451b9d-0b8f-43df-bba7-24efa7828d8c"
+    },
+    "fileId": "a4aqI+dO9EaaOx8JBodREm",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "general_bg4",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 15
+      }
+    ],
+    "_prefab": {
+      "__id__": 16
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 128,
+      "height": 128
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        139.511,
+        -86.25,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 14
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "f830714a-904a-4e31-bf8e-c47f7733a452"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "42451b9d-0b8f-43df-bba7-24efa7828d8c"
+    },
+    "fileId": "9dCVgBXBlB2YPailRijaHx",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "general_bg5",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 18
+      }
+    ],
+    "_prefab": {
+      "__id__": 19
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 128,
+      "height": 128
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        16.334,
+        43.924,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 17
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "f830714a-904a-4e31-bf8e-c47f7733a452"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "42451b9d-0b8f-43df-bba7-24efa7828d8c"
+    },
+    "fileId": "44vTlHk/pNWbrjKsRnCXXA",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 45,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 750,
+    "_originalHeight": 1334,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "42451b9d-0b8f-43df-bba7-24efa7828d8c"
+    },
+    "fileId": "c59tyYWsBDMYSMO8mByqlk",
+    "sync": false
+  }
+]

+ 8 - 0
tower_sanguo/assets/resources/module/fight/fight.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.7",
+  "uuid": "42451b9d-0b8f-43df-bba7-24efa7828d8c",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

BIN
tower_sanguo/assets/resources/module/fight/monster_blood_1.png


BIN
tower_sanguo/assets/resources/module/fight/monster_blood_2.png


BIN
tower_sanguo/assets/resources/module/fight/monster_blood_3.png


+ 7 - 0
tower_sanguo/assets/resources/module/fight/prefab.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "fdb72a57-f352-4410-ac2c-8aea17d215e2",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 232 - 0
tower_sanguo/assets/resources/module/fight/prefab/attack_normal.prefab

@@ -0,0 +1,232 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "attack_normal",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 6
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 125,
+      "height": 108
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "attack_node",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 4
+      }
+    ],
+    "_prefab": {
+      "__id__": 5
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 32,
+      "height": 32
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 1,
+    "groupIndex": 1,
+    "_id": ""
+  },
+  {
+    "__type__": "10f0aBdVrJPt7rAdqXxz+d4",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.BoxCollider",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "tag": 0,
+    "_offset": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_size": {
+      "__type__": "cc.Size",
+      "width": 128,
+      "height": 128
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "a426dbc7-029d-4410-bab1-32f9e6289b40"
+    },
+    "fileId": "8ewJidAc1EyYkORIMW7Nxn",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "a7ced0f1-dc08-43bf-9951-6f79ccc9a3f7"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "a426dbc7-029d-4410-bab1-32f9e6289b40"
+    },
+    "fileId": "85b5YTxyFK8ZIHKcHdaIYF",
+    "sync": false
+  }
+]

+ 8 - 0
tower_sanguo/assets/resources/module/fight/prefab/attack_normal.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.7",
+  "uuid": "a426dbc7-029d-4410-bab1-32f9e6289b40",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

+ 145 - 0
tower_sanguo/assets/resources/module/fight/prefab/bing_1.prefab

@@ -0,0 +1,145 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "bing_1",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 750,
+      "height": 1334
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        -1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_name": "bing_1<Skeleton>",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
+      }
+    ],
+    "paused": false,
+    "defaultSkin": "default",
+    "defaultAnimation": "run",
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "loop": true,
+    "premultipliedAlpha": true,
+    "timeScale": 1,
+    "_accTime": 0,
+    "_playCount": 0,
+    "_frameCache": null,
+    "_curFrame": null,
+    "_skeletonCache": null,
+    "_animationName": "run",
+    "_animationQueue": [],
+    "_headAniInfo": null,
+    "_playTimes": 0,
+    "_isAniComplete": true,
+    "_N$skeletonData": {
+      "__uuid__": "53f2d2ae-4093-4fa8-8414-3c6e85d72957"
+    },
+    "_N$_defaultCacheMode": 0,
+    "_N$debugSlots": false,
+    "_N$debugBones": false,
+    "_N$debugMesh": false,
+    "_N$useTint": false,
+    "_N$enableBatch": false,
+    "_id": ""
+  },
+  {
+    "__type__": "1b5d8L6KapJN40RfXfD64b8",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "skeleton": {
+      "__id__": 2
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "11b7a87e-3aae-4eb4-9674-73fea2202d48"
+    },
+    "fileId": "b5lJFQ7ddA9py7yLn8H47i",
+    "sync": false
+  }
+]

+ 8 - 0
tower_sanguo/assets/resources/module/fight/prefab/bing_1.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.7",
+  "uuid": "11b7a87e-3aae-4eb4-9674-73fea2202d48",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

+ 145 - 0
tower_sanguo/assets/resources/module/fight/prefab/guanyu.prefab

@@ -0,0 +1,145 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "guanyu",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 210,
+      "height": 232.22
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        0.5,
+        0.5,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
+      }
+    ],
+    "paused": false,
+    "defaultSkin": "default",
+    "defaultAnimation": "",
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "loop": true,
+    "premultipliedAlpha": true,
+    "timeScale": 1,
+    "_accTime": 0,
+    "_playCount": 0,
+    "_frameCache": null,
+    "_curFrame": null,
+    "_skeletonCache": null,
+    "_animationName": "attack",
+    "_animationQueue": [],
+    "_headAniInfo": null,
+    "_playTimes": 0,
+    "_isAniComplete": true,
+    "_N$skeletonData": {
+      "__uuid__": "ff4ec9d5-e708-41f1-9c22-ce3b840a5c0f"
+    },
+    "_N$_defaultCacheMode": 0,
+    "_N$debugSlots": false,
+    "_N$debugBones": false,
+    "_N$debugMesh": false,
+    "_N$useTint": false,
+    "_N$enableBatch": false,
+    "_id": ""
+  },
+  {
+    "__type__": "ed32ffUXIhNqa2h6mVXt1Lz",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "skeleton": {
+      "__id__": 2
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "c9807a8d-ca54-4e6c-8726-020bdad2a207"
+    },
+    "fileId": "79exbQsAdFMruqe7zMHj15",
+    "sync": false
+  }
+]

+ 8 - 0
tower_sanguo/assets/resources/module/fight/prefab/guanyu.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.7",
+  "uuid": "c9807a8d-ca54-4e6c-8726-020bdad2a207",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/module/fight/spine.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "7b871283-e769-484f-abee-1ba198a35e89",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "8b6e3aae-7274-4ae0-aeab-7c923857df2b",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 7 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/1.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "2a098d11-5f19-43c3-a2ab-7d6ea7cf33c3",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 264 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.atlas

@@ -0,0 +1,264 @@
+
+skeleton.png
+size: 1971,2013
+format: RGBA8888
+filter: Linear,Linear
+repeat: none
+cu_00002
+  rotate: false
+  xy: 2, 79
+  size: 303, 667
+  orig: 375, 667
+  offset: 0, 0
+  index: -1
+cu_00003
+  rotate: false
+  xy: 2, 748
+  size: 338, 621
+  orig: 375, 667
+  offset: 12, 0
+  index: -1
+cu_00004
+  rotate: false
+  xy: 2, 1371
+  size: 375, 640
+  orig: 375, 667
+  offset: 0, 27
+  index: -1
+cu_00005
+  rotate: false
+  xy: 307, 79
+  size: 283, 667
+  orig: 375, 667
+  offset: 0, 0
+  index: -1
+jineng_00007
+  rotate: true
+  xy: 1717, 1567
+  size: 444, 252
+  orig: 667, 288
+  offset: 0, 16
+  index: -1
+jineng_00009
+  rotate: false
+  xy: 342, 1109
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00010
+  rotate: false
+  xy: 342, 847
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00011
+  rotate: false
+  xy: 379, 1751
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00012
+  rotate: false
+  xy: 379, 1489
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00013
+  rotate: true
+  xy: 592, 178
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00014
+  rotate: true
+  xy: 854, 178
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00015
+  rotate: false
+  xy: 1011, 1227
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00016
+  rotate: false
+  xy: 1011, 965
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00017
+  rotate: false
+  xy: 1048, 1751
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00018
+  rotate: false
+  xy: 1048, 1489
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00019
+  rotate: true
+  xy: 1680, 820
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00020
+  rotate: true
+  xy: 1116, 296
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00021
+  rotate: false
+  xy: 1154, 34
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00022
+  rotate: true
+  xy: 1378, 296
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+xiao1
+  rotate: true
+  xy: 442, 15
+  size: 62, 270
+  orig: 375, 438
+  offset: 249, 168
+  index: -1
+xiao3
+  rotate: true
+  xy: 2, 2
+  size: 75, 438
+  orig: 375, 438
+  offset: 157, 0
+  index: -1
+xiao4
+  rotate: true
+  xy: 379, 1375
+  size: 112, 438
+  orig: 375, 438
+  offset: 129, 0
+  index: -1
+xiao5
+  rotate: true
+  xy: 714, 30
+  size: 146, 438
+  orig: 375, 438
+  offset: 111, 0
+  index: -1
+xiao6
+  rotate: false
+  xy: 1823, 380
+  size: 139, 438
+  orig: 375, 438
+  offset: 111, 0
+  index: -1
+
+skeleton2.png
+size: 1865,1047
+format: RGBA8888
+filter: Linear,Linear
+repeat: none
+cu_00000
+  rotate: true
+  xy: 255, 792
+  size: 253, 666
+  orig: 375, 667
+  offset: 43, 1
+  index: -1
+jineng_00006
+  rotate: false
+  xy: 2, 797
+  size: 251, 248
+  orig: 667, 288
+  offset: 0, 20
+  index: -1
+jineng_00008
+  rotate: false
+  xy: 923, 788
+  size: 638, 257
+  orig: 667, 288
+  offset: 0, 12
+  index: -1
+jineng_00023
+  rotate: false
+  xy: 2, 530
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00024
+  rotate: false
+  xy: 671, 526
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00025
+  rotate: false
+  xy: 2, 268
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00026
+  rotate: false
+  xy: 671, 264
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00027
+  rotate: true
+  xy: 1603, 66
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00028
+  rotate: false
+  xy: 2, 6
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00029
+  rotate: false
+  xy: 671, 2
+  size: 667, 260
+  orig: 667, 288
+  offset: 0, 9
+  index: -1
+jineng_00030
+  rotate: true
+  xy: 1340, 168
+  size: 565, 261
+  orig: 667, 288
+  offset: 102, 8
+  index: -1
+jineng_00031
+  rotate: true
+  xy: 1563, 735
+  size: 310, 262
+  orig: 667, 288
+  offset: 357, 8
+  index: -1

+ 5 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.atlas.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.1",
+  "uuid": "966581bf-f2f6-49dd-8efc-bf1268389d00",
+  "subMetas": {}
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.json


+ 10 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.json.meta

@@ -0,0 +1,10 @@
+{
+  "ver": "1.2.3",
+  "uuid": "63f8a5b6-190a-4a4f-8fb5-320fc7485e80",
+  "textures": [
+    "e1b89ff4-dd97-43cb-8e3a-d5578703092f",
+    "4c22109c-3d4c-4295-aa7a-8a476aa3da3b"
+  ],
+  "scale": 1,
+  "subMetas": {}
+}

BIN
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.png


+ 36 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "e1b89ff4-dd97-43cb-8e3a-d5578703092f",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 1971,
+  "height": 2013,
+  "platformSettings": {},
+  "subMetas": {
+    "skeleton": {
+      "ver": "1.0.4",
+      "uuid": "1532bc52-f614-4472-8428-ee6e9d383fb3",
+      "rawTextureUuid": "e1b89ff4-dd97-43cb-8e3a-d5578703092f",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 1971,
+      "height": 2013,
+      "rawWidth": 1971,
+      "rawHeight": 2013,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton2.png


+ 36 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/1/skeleton2.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "4c22109c-3d4c-4295-aa7a-8a476aa3da3b",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 1865,
+  "height": 1047,
+  "platformSettings": {},
+  "subMetas": {
+    "skeleton2": {
+      "ver": "1.0.4",
+      "uuid": "40b9e98b-4163-47bb-9a3b-51523db9e8ca",
+      "rawTextureUuid": "4c22109c-3d4c-4295-aa7a-8a476aa3da3b",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 1865,
+      "height": 1047,
+      "rawWidth": 1865,
+      "rawHeight": 1047,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 7 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/2.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "29981c78-82d2-4f53-8ef4-af24eaaa3efc",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 125 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/2/skeleton.atlas

@@ -0,0 +1,125 @@
+
+skeleton.png
+size: 1579,1057
+format: RGBA8888
+filter: Linear,Linear
+repeat: none
+juneng_00000
+  rotate: false
+  xy: 994, 754
+  size: 285, 301
+  orig: 350, 350
+  offset: 14, 36
+  index: -1
+juneng_00001
+  rotate: false
+  xy: 997, 451
+  size: 285, 301
+  orig: 350, 350
+  offset: 14, 36
+  index: -1
+juneng_00002
+  rotate: true
+  xy: 1281, 783
+  size: 272, 296
+  orig: 350, 350
+  offset: 20, 29
+  index: -1
+juneng_00003
+  rotate: true
+  xy: 1284, 249
+  size: 270, 280
+  orig: 350, 350
+  offset: 24, 38
+  index: -1
+juneng_00004
+  rotate: true
+  xy: 999, 190
+  size: 259, 270
+  orig: 350, 350
+  offset: 29, 41
+  index: -1
+juneng_00005
+  rotate: false
+  xy: 1284, 521
+  size: 291, 260
+  orig: 350, 350
+  offset: 30, 42
+  index: -1
+juneng_00006
+  rotate: false
+  xy: 672, 735
+  size: 320, 320
+  orig: 350, 350
+  offset: 15, 15
+  index: -1
+juneng_00007
+  rotate: false
+  xy: 352, 369
+  size: 334, 334
+  orig: 350, 350
+  offset: 8, 8
+  index: -1
+juneng_00008
+  rotate: false
+  xy: 2, 11
+  size: 342, 342
+  orig: 350, 350
+  offset: 4, 4
+  index: -1
+juneng_00009
+  rotate: false
+  xy: 2, 355
+  size: 348, 348
+  orig: 350, 350
+  offset: 1, 1
+  index: -1
+juneng_00010
+  rotate: false
+  xy: 2, 705
+  size: 350, 350
+  orig: 350, 350
+  offset: 0, 0
+  index: -1
+juneng_00011
+  rotate: false
+  xy: 354, 729
+  size: 316, 326
+  orig: 350, 350
+  offset: 18, 11
+  index: -1
+juneng_00012
+  rotate: false
+  xy: 688, 407
+  size: 307, 326
+  orig: 350, 350
+  offset: 27, 11
+  index: -1
+juneng_00013
+  rotate: false
+  xy: 676, 24
+  size: 321, 343
+  orig: 350, 350
+  offset: 15, 1
+  index: -1
+juneng_00014
+  rotate: false
+  xy: 346, 6
+  size: 328, 347
+  orig: 350, 350
+  offset: 12, 0
+  index: -1
+juneng_00015
+  rotate: true
+  xy: 1271, 2
+  size: 245, 238
+  orig: 350, 350
+  offset: 55, 0
+  index: -1
+juneng_00016
+  rotate: false
+  xy: 999, 61
+  size: 249, 127
+  orig: 350, 350
+  offset: 55, 112
+  index: -1

+ 5 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/2/skeleton.atlas.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.1",
+  "uuid": "6277fac1-eaee-47a1-aa42-f207f24e15e0",
+  "subMetas": {}
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
tower_sanguo/assets/resources/module/fight/spine/attack_full/2/skeleton.json


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است