浏览代码

修复提示昵称重复Bug

liuqilin 7 年之前
父节点
当前提交
7a0bd9afdf

二进制
.vs/Garden5_2017/v15/Server/sqlite3/storage.ide


二进制
.vs/Garden5_2017/v15/Server/sqlite3/storage.ide-shm


二进制
.vs/Garden5_2017/v15/Server/sqlite3/storage.ide-wal


+ 0 - 9
Assets/Plugins/Alipay/IOS.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 56a9574fc6d17c044a383d0f6cdb5d68
-folderAsset: yes
-timeCreated: 1502760989
-licenseType: Pro
-DefaultImporter:
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 32
Assets/Plugins/Alipay/IOS/AlipaySDK.framework.meta

@@ -1,32 +0,0 @@
-fileFormatVersion: 2
-guid: 786969225a8dc4e0eb4e00a91e7e1501
-folderAsset: yes
-timeCreated: 1502698138
-licenseType: Pro
-PluginImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  iconMap: {}
-  executionOrder: {}
-  isPreloaded: 0
-  isOverridable: 0
-  platformData:
-  - first:
-      Any: 
-    second:
-      enabled: 0
-      settings: {}
-  - first:
-      Editor: Editor
-    second:
-      enabled: 0
-      settings:
-        DefaultValueInitialized: true
-  - first:
-      iPhone: iOS
-    second:
-      enabled: 1
-      settings: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 1 - 1
Assets/Resource/Logo.unity

@@ -341,7 +341,7 @@ RectTransform:
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 841147520}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 488.5, y: 275, z: 0}
+  m_LocalPosition: {x: 504.5, y: 284, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   - {fileID: 722194762}

+ 3 - 3
Assets/Resource/Prefab/PrefabUI/Canvas.prefab

@@ -77888,8 +77888,8 @@ RectTransform:
   - {fileID: 224102181510017788}
   - {fileID: 224851005691090728}
   - {fileID: 224454876144202192}
-  - {fileID: 224385199567227060}
   - {fileID: 224886965450808824}
+  - {fileID: 224385199567227060}
   - {fileID: 224499353917912188}
   - {fileID: 224264575441689428}
   - {fileID: 224903833123223624}
@@ -81279,7 +81279,7 @@ RectTransform:
   m_Children:
   - {fileID: 224158748822785144}
   m_Father: {fileID: 224229560457679016}
-  m_RootOrder: 20
+  m_RootOrder: 21
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 1, y: 1}
@@ -92733,7 +92733,7 @@ RectTransform:
   m_Children:
   - {fileID: 224673728143906378}
   m_Father: {fileID: 224229560457679016}
-  m_RootOrder: 21
+  m_RootOrder: 20
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 1, y: 1}

+ 2 - 2
Assets/Resource/Shader/DragonboneUGUIMat.mat

@@ -8,7 +8,7 @@ Material:
   m_PrefabInternal: {fileID: 0}
   m_Name: DragonboneUGUIMat
   m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
-  m_ShaderKeywords: UNITY_UI_CLIP_RECT _EMISSION
+  m_ShaderKeywords: _EMISSION
   m_LightmapFlags: 1
   m_EnableInstancingVariants: 0
   m_DoubleSidedGI: 0
@@ -39,7 +39,7 @@ Material:
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - _MainTex:
-        m_Texture: {fileID: 2800000, guid: c0256ea9e745dc544ae7035b55f87b84, type: 3}
+        m_Texture: {fileID: 2800000, guid: c486bd2e1e577b24a86013546709abda, type: 3}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
     - _MetallicGlossMap:

+ 1 - 1
Assets/Resource/Shader/UIMaskMat.mat

@@ -8,7 +8,7 @@ Material:
   m_PrefabInternal: {fileID: 0}
   m_Name: UIMaskMat
   m_Shader: {fileID: 4800000, guid: 62507a9ea3ab77f4db3a493bdcbe5eff, type: 3}
-  m_ShaderKeywords: UNITY_UI_CLIP_RECT _EMISSION
+  m_ShaderKeywords: _EMISSION
   m_LightmapFlags: 1
   m_EnableInstancingVariants: 0
   m_DoubleSidedGI: 0

+ 1 - 1
Assets/Resource/XML/PlayerConfig.xml

@@ -1,5 +1,5 @@
 <PlayerConfig>
-  <Version value="43" />
+  <Version value="45" />
   <ReplayVersion value="1" />
   
   <ID value="Default" />

+ 14 - 14
Assets/Script/AssetBundleUtility/AssetBundleUtility.prefab

@@ -56,35 +56,35 @@ MonoBehaviour:
     MD5DictionaryFileName: AndroidMD5Dictionary#VERSION.txt
     OutputPath: Assets\HotUpdate\Android
     AssetBundleSets:
-    - Object: {fileID: 102900000, guid: 773613e0fa4cc094ca162741d97a2500, type: 3}
+    - Object: {fileID: 102900000, guid: 0db33fbef35d83548b4ce06d1aef020e, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: 8fb4da250528ad14f8a3fba6268d5197, type: 3}
+    - Object: {fileID: 102900000, guid: 6c815a3ce50b41e41a21b1c378a47149, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: ee5fee89fa104cf41a76583857c4a30a, type: 3}
+    - Object: {fileID: 102900000, guid: b058981ed9ba2814a87635c8a9d773dd, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: bd1e91f7137571548abfcd709c9ffb31, type: 3}
+    - Object: {fileID: 102900000, guid: f27b048cfa763b8478e7fbbab230d9b4, type: 3}
       URL: null
-  - MD5FileName: IOSMD5.txt
-    MD5DictionaryFileName: IOSMD5Dictionary.txt
+  - MD5FileName: IOSMD5#VERSION.txt
+    MD5DictionaryFileName: IOSMD5Dictionary#VERSION.txt
     OutputPath: Assets\HotUpdate\IOS
     AssetBundleSets:
-    - Object: {fileID: 102900000, guid: 1f03e821e1ebdc24e9f0fa80e2efcc0c, type: 3}
+    - Object: {fileID: 102900000, guid: e368cc43bdeb82b448804d5343d557b5, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: 46e6bdba81cd7ce4695e7e3b87409b5b, type: 3}
+    - Object: {fileID: 102900000, guid: 866bcda6275f37f44baa4d04a5b4140c, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: de2a2ad7ab38f9e4b80402dc8153ccbe, type: 3}
+    - Object: {fileID: 102900000, guid: 459ca6b8c8c93824daa56722706e8cbe, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: 2322ebf659ac53340bfdc21c831c6f31, type: 3}
+    - Object: {fileID: 102900000, guid: 516c0ea069fc39f40a0156b402617f40, type: 3}
       URL: null
   - MD5FileName: WindowsMD5#VERSION.txt
     MD5DictionaryFileName: WindowsMD5Dictionary#VERSION.txt
     OutputPath: Assets\HotUpdate\Windows
     AssetBundleSets:
-    - Object: {fileID: 102900000, guid: 2fc161b61d959124eaab94c4e3ac5ab9, type: 3}
+    - Object: {fileID: 102900000, guid: 4cd12ca873c72504c95e42a5d558687d, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: e1235e583c8429f448217f2c095145df, type: 3}
+    - Object: {fileID: 102900000, guid: c2aa22318a7180f49a828e217b313dc9, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: 69be5c43ca4b79949a62aedb799c9cf5, type: 3}
+    - Object: {fileID: 102900000, guid: 0b4c1963d0856884ea2d79d1e5ea4c27, type: 3}
       URL: null
-    - Object: {fileID: 102900000, guid: 6ac7e53c87f1b4e4d81bd6347744ed10, type: 3}
+    - Object: {fileID: 102900000, guid: f4c714a841199494b89b686f3de11e63, type: 3}
       URL: null

+ 137 - 139
Assets/Script/Editor/PostProcessor.cs

@@ -1,139 +1,137 @@
-#if !UNITY_EDITOR_WIN
-using UnityEditor;
-using UnityEngine;
-using UnityEditor.Callbacks;
-
-using System.IO;
-using System.Collections;
-using System.Collections.Generic;
-
-using UnityEditor.iOS.Xcode;
-
-public class NewBehaviourScript 
-{
-    [PostProcessBuild(100)]
-    public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath)
-    {
-        if (buildTarget != BuildTarget.iOS)
-        {
-            return;
-        }
-
-        string projectPath = PBXProject.GetPBXProjectPath(buildPath);
-
-        PBXProject project = new PBXProject();
-
-        project.ReadFromFile(projectPath);
-
-        string target = project.TargetGuidByName("Unity-iPhone");
-
-        //关闭BitCode
-        project.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
-
-
-        //添加引用库
-        //string targetGuid = project.TargetGuidByName("Unity-iPhone");
-
-        //project.AddFrameworkToProject(targetGuid, "libc++.tbd", false);
-        //project.AddFrameworkToProject(targetGuid, "libz.tbd", false);
-        //project.AddFrameworkToProject(targetGuid, "SystemConfiguration.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "CoreTelephony.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "QuartzCore.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "CoreText.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "CoreGraphics.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "UIKit.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "Foundation.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "CFNetwork.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "CoreMotion.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "AlipaySDK.framework", false);
-        //project.AddFrameworkToProject(targetGuid, "Security.framework", false);
-
-
-        //App名称本地化
-        string plistPath = Path.Combine(buildPath, "Info.plist");
-
-        PlistDocument plist = new PlistDocument();
-
-        plist.ReadFromFile(plistPath);
-
-        //plist.root.SetString("CFBundleDisplayName", "${CFBundleDisplayName}");
-
-        FileUtil.CopyFileOrDirectory(Application.dataPath + "/AppleDependency", buildPath + "/AppleDependency");
-
-        project.AddFileToBuild(target, project.AddFile(buildPath + "/AppleDependency/InfoPlist.strings", "InfoPlist.strings", PBXSourceTree.Source));
-
-
-        //修改UnityAppController.mm
-        //string scriptPath = buildPath + "/Classes/UnityAppController.mm";
-
-        //List<string> lines = new List<string>();
-
-        //StreamReader streamReader = new StreamReader(scriptPath);
-
-        //while (!streamReader.EndOfStream)
-        //{
-        //    lines.Add(streamReader.ReadLine());
-        //}
-
-        //streamReader.Close();
-
-        //lines.Insert
-        //    (
-        //        0,
-        //        "#import <AlipaySDK/AlipaySDK.h>"
-        //    );
-
-        //lines.Insert
-        //    (
-        //        231,
-        //        "if ([url.host isEqualToString:@\"safepay\"]) {\n" +
-        //        "//跳转支付宝钱包进行支付,处理支付结果\n" +
-        //        "[[AlipaySDK defaultService] processOrderWithPaymentResult: url standbyCallback:^ (NSDictionary * resultDic) {\n" +
-        //        "NSLog(@\"result 1 = %@\", resultDic);\n" +
-        //        " }];\n" +
-        //        "}\n"
-        //    );
-
-        //lines.Insert
-        //    (
-        //        247,
-        //        "// NOTE: 9.0以后使用新API接口\n" +
-        //        "-(BOOL)application:(UIApplication*)app openURL: (NSURL*)url options: (NSDictionary<NSString*, id>*)options\n" +
-        //        "{\n" +
-        //        "if ([url.host isEqualToString: @\"safepay\"])\n" +
-        //        "{\n" +
-        //        "//跳转支付宝钱包进行支付,处理支付结果\n" +
-        //        "[[AlipaySDK defaultService]\n" +
-        //        "processOrderWithPaymentResult:url standbyCallback:^(NSDictionary* resultDic) {\n" +
-        //        "NSLog(@\"result 2 = %@\", resultDic);\n" +
-        //        "}];\n" +
-        //        "}\n" +
-        //        "return YES;\n" +
-        //        "}\n"
-        //    );
-
-        //StreamWriter streamWriter = new StreamWriter(scriptPath);
-
-        //for (int i = 0; i < lines.Count; i++)
-        //{
-        //    streamWriter.WriteLine(lines[i]);
-        //}
-
-        //streamWriter.Close();
-
-
-        //添加URLScheme
-        //PlistElementDict urlDict = plist.root["CFBundleURLTypes"].AsArray().AddDict();
-        //PlistElementArray urlArray = urlDict.CreateArray("CFBundleURLSchemes");
-        //urlArray.AddString("MyLovelyGarden");
-
-
-        //保存Plist
-        plist.WriteToFile(plistPath);
-
-
-        //保存PBXProject
-        File.WriteAllText(projectPath, project.WriteToString());
-    }
-}
-#endif
+using UnityEditor;
+using UnityEngine;
+using UnityEditor.Callbacks;
+
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+
+using UnityEditor.iOS.Xcode;
+
+public class NewBehaviourScript 
+{
+    [PostProcessBuild(100)]
+    public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath)
+    {
+        if (buildTarget != BuildTarget.iOS)
+        {
+            return;
+        }
+
+        string projectPath = PBXProject.GetPBXProjectPath(buildPath);
+
+        PBXProject project = new PBXProject();
+
+        project.ReadFromFile(projectPath);
+
+        string target = project.TargetGuidByName("Unity-iPhone");
+
+        //关闭BitCode
+        project.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
+
+
+        //添加引用库
+        //string targetGuid = project.TargetGuidByName("Unity-iPhone");
+
+        //project.AddFrameworkToProject(targetGuid, "libc++.tbd", false);
+        //project.AddFrameworkToProject(targetGuid, "libz.tbd", false);
+        //project.AddFrameworkToProject(targetGuid, "SystemConfiguration.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "CoreTelephony.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "QuartzCore.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "CoreText.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "CoreGraphics.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "UIKit.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "Foundation.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "CFNetwork.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "CoreMotion.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "AlipaySDK.framework", false);
+        //project.AddFrameworkToProject(targetGuid, "Security.framework", false);
+
+
+        //App名称本地化
+        //string plistPath = Path.Combine(buildPath, "Info.plist");
+
+        //PlistDocument plist = new PlistDocument();
+
+        //plist.ReadFromFile(plistPath);
+
+        //plist.root.SetString("CFBundleDisplayName", "${CFBundleDisplayName}");
+
+        //FileUtil.CopyFileOrDirectory(Application.dataPath + "/AppleDependency", buildPath + "/AppleDependency");
+
+        //project.AddFileToBuild(target, project.AddFile(buildPath + "/AppleDependency/InfoPlist.strings", "InfoPlist.strings", PBXSourceTree.Source));
+
+
+        //修改UnityAppController.mm
+        //string scriptPath = buildPath + "/Classes/UnityAppController.mm";
+
+        //List<string> lines = new List<string>();
+
+        //StreamReader streamReader = new StreamReader(scriptPath);
+
+        //while (!streamReader.EndOfStream)
+        //{
+        //    lines.Add(streamReader.ReadLine());
+        //}
+
+        //streamReader.Close();
+
+        //lines.Insert
+        //    (
+        //        0,
+        //        "#import <AlipaySDK/AlipaySDK.h>"
+        //    );
+
+        //lines.Insert
+        //    (
+        //        231,
+        //        "if ([url.host isEqualToString:@\"safepay\"]) {\n" +
+        //        "//跳转支付宝钱包进行支付,处理支付结果\n" +
+        //        "[[AlipaySDK defaultService] processOrderWithPaymentResult: url standbyCallback:^ (NSDictionary * resultDic) {\n" +
+        //        "NSLog(@\"result 1 = %@\", resultDic);\n" +
+        //        " }];\n" +
+        //        "}\n"
+        //    );
+
+        //lines.Insert
+        //    (
+        //        247,
+        //        "// NOTE: 9.0以后使用新API接口\n" +
+        //        "-(BOOL)application:(UIApplication*)app openURL: (NSURL*)url options: (NSDictionary<NSString*, id>*)options\n" +
+        //        "{\n" +
+        //        "if ([url.host isEqualToString: @\"safepay\"])\n" +
+        //        "{\n" +
+        //        "//跳转支付宝钱包进行支付,处理支付结果\n" +
+        //        "[[AlipaySDK defaultService]\n" +
+        //        "processOrderWithPaymentResult:url standbyCallback:^(NSDictionary* resultDic) {\n" +
+        //        "NSLog(@\"result 2 = %@\", resultDic);\n" +
+        //        "}];\n" +
+        //        "}\n" +
+        //        "return YES;\n" +
+        //        "}\n"
+        //    );
+
+        //StreamWriter streamWriter = new StreamWriter(scriptPath);
+
+        //for (int i = 0; i < lines.Count; i++)
+        //{
+        //    streamWriter.WriteLine(lines[i]);
+        //}
+
+        //streamWriter.Close();
+
+
+        //添加URLScheme
+        //PlistElementDict urlDict = plist.root["CFBundleURLTypes"].AsArray().AddDict();
+        //PlistElementArray urlArray = urlDict.CreateArray("CFBundleURLSchemes");
+        //urlArray.AddString("MyLovelyGarden");
+
+
+        //保存Plist
+        //plist.WriteToFile(plistPath);
+
+
+        //保存PBXProject
+        File.WriteAllText(projectPath, project.WriteToString());
+    }
+}

+ 40 - 0
Assets/Script/Manage/ConfigManager.cs

@@ -1657,6 +1657,20 @@ public class ConfigManager : Regist
             ToVersion43(nativeDoc, defaultDoc);
         }
 
+        if (nativeVersion < 44)
+        {
+            Debug.LogWarning("UpdateArchive to 44");
+
+            ToVersion44(nativeDoc, defaultDoc);
+        }
+
+        if (nativeVersion < 45)
+        {
+            Debug.LogWarning("UpdateArchive to 45");
+
+            ToVersion45(nativeDoc, defaultDoc);
+        }
+
         return nativeDoc;
     }
 
@@ -2267,4 +2281,30 @@ public class ConfigManager : Regist
 
         return nativeDoc;
     }
+
+    public static XmlDocument ToVersion44(XmlDocument nativeDoc, XmlDocument defaultDoc)
+    {
+        nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 44.ToString();
+
+        string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
+        if (Directory.Exists(persistentFolderPath))
+        {
+            Directory.Delete(persistentFolderPath, true);
+        }
+
+        return nativeDoc;
+    }
+
+    public static XmlDocument ToVersion45(XmlDocument nativeDoc, XmlDocument defaultDoc)
+    {
+        nativeDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 45.ToString();
+
+        string persistentFolderPath = string.Format("{0}{1}HotUpdate", Application.persistentDataPath, Path.DirectorySeparatorChar);
+        if (Directory.Exists(persistentFolderPath))
+        {
+            Directory.Delete(persistentFolderPath, true);
+        }
+
+        return nativeDoc;
+    }
 }

+ 103 - 103
Assets/Script/Manage/FashionShowHttp/FashionShowData/GetFashionShowData.cs

@@ -1,104 +1,104 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using LitJson;
-using UnityEngine;
-
-public class GetFashionShowData : FashionShowData
-{
-    public int showId;
-    public int cuteScore;
-    public int vividScore;
-    public int simpleScore;
-    public int graceScore;
-    public int gloryScore;
-    public int scoreCnt;
-    public int praiseCnt;
-    public bool praised;
-    public string playerNickName;
-    public bool rated;
-
-    public GetFashionShowData()
-    {
-
-    }
-
-    public GetFashionShowData(GetFashionShowData data)
-    {
-        playerId = data.playerId;
-        title = data.title;
-        content = data.content;
-        head = data.head;
-        headwear = data.headwear;
-        eye = data.eye;
-        mouth = data.mouth;
-        top = data.top;
-        skirt = data.skirt;
-        shoe = data.shoe;
-        wing = data.wing;
-
-        showId = data.showId;
-        cuteScore = data.cuteScore;
-        vividScore = data.vividScore;
-        simpleScore = data.simpleScore;
-        graceScore = data.graceScore;
-        gloryScore = data.gloryScore;
-        scoreCnt = data.scoreCnt;
-        praiseCnt = data.praiseCnt;
-        praised = data.praised;
-        playerNickName = data.playerNickName;
-    }
-
-    public GetFashionShowData(JsonData data)
-    {
-        playerId = long.Parse((string) data["user_id"]);
-        title = (string) data["title"];
-        content = (string) data["content"];
-        head = (int) data["head"];
-        headwear = (int) data["headwear"];
-        eye = (int) data["eyes"];
-        mouth = (int) data["mouth"];
-        top = (int) data["clothes"];
-        skirt = (int) data["skirt"];
-        shoe = (int) data["shoes"];
-        wing = (int) data["wing"];
-
-        showId = (int) data["id"];
-        cuteScore = (int) data["score1"];
-        graceScore = (int) data["score2"];
-        vividScore = (int) data["score3"];
-        simpleScore = (int) data["score4"];
-        gloryScore = (int) data["score5"];
-        scoreCnt = (int) data["num_scored"];
-        praiseCnt = (int) data["likes"];
-        praised = ((int) data["liked"]).ToBool();
-        playerNickName = (string) data["nickname"];
-        rated = ((int) data["scored"]).ToBool();
-    }
-
-    public float GetCuteRate()
-    {
-        return (float) cuteScore/scoreCnt;
-    }
-
-    public float GetVividRate()
-    {
-        return (float) vividScore/scoreCnt;
-    }
-
-    public float GetSimpleRate()
-    {
-        return (float) simpleScore/scoreCnt;
-    }
-
-    public float GetGloryRate()
-    {
-        return (float) gloryScore/scoreCnt;
-    }
-
-    public float GetGraceRate()
-    {
-        return (float) graceScore/scoreCnt;
-    }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using LitJson;
+using UnityEngine;
+
+public class GetFashionShowData : FashionShowData
+{
+    public int showId;
+    public int cuteScore;
+    public int vividScore;
+    public int simpleScore;
+    public int graceScore;
+    public int gloryScore;
+    public int scoreCnt;
+    public int praiseCnt;
+    public bool praised;
+    public string playerNickName;
+    public bool rated;
+
+    public GetFashionShowData()
+    {
+
+    }
+
+    public GetFashionShowData(GetFashionShowData data)
+    {
+        playerId = data.playerId;
+        title = data.title;
+        content = data.content;
+        head = data.head;
+        headwear = data.headwear;
+        eye = data.eye;
+        mouth = data.mouth;
+        top = data.top;
+        skirt = data.skirt;
+        shoe = data.shoe;
+        wing = data.wing;
+
+        showId = data.showId;
+        cuteScore = data.cuteScore;
+        vividScore = data.vividScore;
+        simpleScore = data.simpleScore;
+        graceScore = data.graceScore;
+        gloryScore = data.gloryScore;
+        scoreCnt = data.scoreCnt;
+        praiseCnt = data.praiseCnt;
+        praised = data.praised;
+        playerNickName = data.playerNickName;
+    }
+
+    public GetFashionShowData(JsonData data)
+    {
+        playerId = long.Parse(data["user_id"].ToString());
+        title = (string) data["title"];
+        content = (string) data["content"];
+        head = (int) data["head"];
+        headwear = (int) data["headwear"];
+        eye = (int) data["eyes"];
+        mouth = (int) data["mouth"];
+        top = (int) data["clothes"];
+        skirt = (int) data["skirt"];
+        shoe = (int) data["shoes"];
+        wing = (int) data["wing"];
+
+        showId = (int) data["id"];
+        cuteScore = (int) data["score1"];
+        graceScore = (int) data["score2"];
+        vividScore = (int) data["score3"];
+        simpleScore = (int) data["score4"];
+        gloryScore = (int) data["score5"];
+        scoreCnt = (int) data["num_scored"];
+        praiseCnt = (int) data["likes"];
+        praised = ((int) data["liked"]).ToBool();
+        playerNickName = (string) data["nickname"];
+        rated = ((int) data["scored"]).ToBool();
+    }
+
+    public float GetCuteRate()
+    {
+        return (float) cuteScore/scoreCnt;
+    }
+
+    public float GetVividRate()
+    {
+        return (float) vividScore/scoreCnt;
+    }
+
+    public float GetSimpleRate()
+    {
+        return (float) simpleScore/scoreCnt;
+    }
+
+    public float GetGloryRate()
+    {
+        return (float) gloryScore/scoreCnt;
+    }
+
+    public float GetGraceRate()
+    {
+        return (float) graceScore/scoreCnt;
+    }
 }

+ 15 - 8
Assets/Script/Manage/HttpManager.cs

@@ -147,6 +147,9 @@ public class HttpManager : Regist
     public static string Md5Dictionnary;
     public static string AssetbundleUrl;
 
+    public static string sfsIp;
+    public static int sfsPort;
+
     public static string BaseURL = "https://garden.dashgame.com/index.php/home";
     public static string NewBaseURL = "https://garden.dashgame.com/index.php/newhome";
     public static string NicknameURL = NewBaseURL + "/user/nickname";
@@ -439,13 +442,13 @@ public class HttpManager : Regist
                 {
                     succeedCallback.Invoke();
                 }
-                else if (data.Contains("Could not resolve host"))
+                else if (data == "{\"error\":2020}")
                 {
-                    failCallback.Invoke(Language.GetStr(LanguageLabel.UI__Fg_Lab3));
+                    failCallback.Invoke(Language.GetStr(LanguageLabel.UI__T_RepeatName));
                 }
                 else
                 {
-                    failCallback.Invoke(Language.GetStr(LanguageLabel.UI__T_RepeatName));
+                    failCallback.Invoke(Language.GetStr(LanguageLabel.UI__Fg_Lab3));
                 }
             },
             URLRequest.Method.POST
@@ -825,6 +828,8 @@ public class HttpManager : Regist
                 }
                 else
                 {
+                    sfsIp = data["l"][5]["val"].ToJson().Trim('"');
+                    sfsPort = int.Parse(data["l"][6]["val"].ToJson().Trim('"'));
                     AssetbundleUrl = data["l"][4]["val"].ToJson().Trim('"');
                     callback(data);
                 }
@@ -1428,7 +1433,7 @@ public class HttpManager : Regist
                     List<AccountData> accountDatas = new List<AccountData>();
                     for (int i = 0; i < jData.Count; i++)
                     {
-                        string serialNumber = (string)jData[i]["i"];
+                        string serialNumber = jData[i]["i"].ToString();
                         string dateString = (string)jData[i]["t"];
                         string nickname = jData[i]["n"] != null ? (string) jData[i]["n"] : Language.GetStr(LanguageLabel.UI__Unnamed);
                         if (!accountDatas.MyContains((accountData => accountData.SerialNumber == serialNumber)))
@@ -1473,7 +1478,9 @@ public class HttpManager : Regist
                     for (int i = 0; i < jData.Count; i++)
                     {
                         //Debug.Log(jData[i].ToJson());
-                        string serialNumber = (string)jData[i]["i"];
+                        //Debug.Log(jData[i]["i"].IsInt);
+                        //Debug.Log(jData[i]["i"].IsLong);
+                        string serialNumber = jData[i]["i"].ToString();
                         string nickname = jData[i]["n"] != null ? (string)jData[i]["n"] : Language.GetStr(LanguageLabel.UI__Unnamed);
                         string dateString = (string)jData[i]["t"];
                         accountDatas.Add(new AccountData(nickname, serialNumber, dateString));
@@ -1512,7 +1519,7 @@ public class HttpManager : Regist
                     List<AccountData> accountDatas = new List<AccountData>();
                     for (int i = 0; i < jData.Count; i++)
                     {
-                        string serialNumber = (string)jData[i]["i"];
+                        string serialNumber = jData[i]["i"].ToString();
                         string nickname = jData[i]["n"] != null ? (string)jData[i]["n"] : Language.GetStr(LanguageLabel.UI__Unnamed);
                         string dateString = (string)jData[i]["t"];
                         accountDatas.Add(new AccountData(nickname, serialNumber, dateString));
@@ -1615,7 +1622,7 @@ public class HttpManager : Regist
             requestData,
             data =>
             {
-                //Debug.Log(data);
+                Debug.Log(data);
                 try
                 {
                     JsonData jData = JsonMapper.ToObject(data.Trim());
@@ -1690,7 +1697,7 @@ public class HttpManager : Regist
                         string content = (string)jData[i]["c"];
                         string nickname = jData[i]["n"] != null ? (string)jData[i]["n"] : Language.GetStr(LanguageLabel.UI__Unnamed);
                         string dateString = (string)jData[i]["t"];
-                        string serialNumber = (string)jData[i]["s"];
+                        string serialNumber = jData[i]["s"].ToString();
                         DateTime date = DateTime.Parse(dateString);
                         privateMessageDatas.Add(new PrivateMessageData(serialNumber, nickname, content, date));
                     }

+ 14 - 0
Assets/Script/Manage/TutorialManager.cs

@@ -1657,6 +1657,13 @@ public class TutorialManager : Regist
         changeMouseTutorial = false;
         Tutorial.HightDisable();
         Tutorial.SceneArrow.SetActive(false);
+
+        UIManager.UnblockOfflinePanel();
+
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn0).interactable = true;
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn0).blocksRaycasts = true;
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn).interactable = true;
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn).blocksRaycasts = true;
     }
 
     public static void BeginChangeMouseTutorial()
@@ -1702,5 +1709,12 @@ public class TutorialManager : Regist
 
         ResourceManager.Get(CanvasLabel.Canvas).TweenForCG();
         PlayerManager.Player.onClick += EndChangeMouseTutorial;
+
+        UIManager.BlockOfflinePanel();
+
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn0).interactable = false;
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn0).blocksRaycasts = false;
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn).interactable = false;
+        //ResourceManager.Get<CanvasGroup>(CanvasLabel.B_SignIn).blocksRaycasts = false;
     }
 }

+ 5 - 0
Assets/Script/Manage/UIManager.cs

@@ -500,6 +500,11 @@ public class UIManager : Regist
             CanvasLabel.C_AddFriendButton,
             () =>
             {
+                if (FriendPanel.IsFriendFull(true))
+                {
+                    return;
+                }
+
                 HttpManager.ApplyBuddy
                 (
                     VisitManager.VisiteeSerialNumber,

+ 42 - 42
Assets/Script/Object/Comment/ShowComment.cs

@@ -1,43 +1,43 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using LitJson;
-
-public class ShowCommentData
-{
-    public int id;
-    public string content;
-    public AccountData accountData;
-
-    public ShowCommentData(JsonData data)
-    {
-        id = (int) data["id"];
-        content = (string) data["content"];
-        long playerId = long.Parse((string) data["user_id"]);
-        string nickname = (string) data["nickname"];
-        accountData = new AccountData(nickname, playerId.ToString());
-    }
-}
-
-public class ShowComment : BaseComment
-{
-    public override void Visit()
-    {
-        FashionShowCommentPanel.HidePanel();
-        FashionShowEditPage.HidePanel();
-        FashionShowEditPage.HidePanel();
-        DelayCall.Call(1f, () =>
-        {
-            //FashionShowHomePage.HideSidePanel();
-            FashionShowHomePage.HidePanel();
-        });
-        //TweenVec tweenVec = FashionShowEditPage.Panel.GetTweenVec();
-        //tweenVec.AddEventOnetime(EventType.BackwardFinish, () =>
-        //{
-        //    FashionShowHomePage.HideSidePanel();
-        //    FashionShowHomePage.HidePanel();
-        //});
-        base.Visit();
-    }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using LitJson;
+
+public class ShowCommentData
+{
+    public int id;
+    public string content;
+    public AccountData accountData;
+
+    public ShowCommentData(JsonData data)
+    {
+        id = (int) data["id"];
+        content = (string) data["content"];
+        long playerId = long.Parse(data["user_id"].ToString());
+        string nickname = (string) data["nickname"];
+        accountData = new AccountData(nickname, playerId.ToString());
+    }
+}
+
+public class ShowComment : BaseComment
+{
+    public override void Visit()
+    {
+        FashionShowCommentPanel.HidePanel();
+        FashionShowEditPage.HidePanel();
+        FashionShowEditPage.HidePanel();
+        DelayCall.Call(1f, () =>
+        {
+            //FashionShowHomePage.HideSidePanel();
+            FashionShowHomePage.HidePanel();
+        });
+        //TweenVec tweenVec = FashionShowEditPage.Panel.GetTweenVec();
+        //tweenVec.AddEventOnetime(EventType.BackwardFinish, () =>
+        //{
+        //    FashionShowHomePage.HideSidePanel();
+        //    FashionShowHomePage.HidePanel();
+        //});
+        base.Visit();
+    }
 }

+ 0 - 29
Assets/Script/Object/Player.cs

@@ -1725,12 +1725,9 @@ public class Player : Regist , IPointerClickHandler
         UAC.transform.SetLZ(0.7f);
         SetSlotLocalZ(WingSlot, 0.00003f);
         SetSlotLocalZ(EyeSlot, -0.00007f);
-        //SetSlotLocalZ(EyeSlot, -0.00001f);
         SetSlotLocalZ(TopSlot, -0.00003f);
         SetSlotLocalZ(MouseSlot, -0.00007f);
-        //SetSlotLocalZ(MouseSlot, -0.00001f);
         SetSlotLocalZ(HeadWearSlot, -0.00008f);
-        //SetSlotLocalZ(HeadWearSlot, -0.00001f);
         SetSlotLocalZ(LeftShoeSlot, -0.00001f);
         SetSlotLocalZ(RightShoeSlot, -0.00001f);
         SetSlotLocalZ(LeftLegSlot, 0);
@@ -1741,9 +1738,6 @@ public class Player : Regist , IPointerClickHandler
         SetSlotLocalZ(LeftShortSleeveSlot, -0.000015f);
         SetSlotLocalZ(RightShortSleeveSlot, -0.000015f);
 
-        //Debug.Log("reset depth");
-        //Debug.Log(WingSlot.UnityTransform.localPosition.z, WingSlot.UnityTransform);
-
         SetSlotLocalZ(HeadSlot, 0);
         if (HeadSlot.UnityTransform != null && HeadSlot.UnityTransform.childCount > 1)
         {
@@ -1766,8 +1760,6 @@ public class Player : Regist , IPointerClickHandler
             uguiDisplays.MySort((display1, display0) =>
                     display1.transform.position.z < display0.transform.position.z);
 
-            //Debug.Log("resetDepth");
-
             foreach (var display in uguiDisplays)
             {
                 if (display.dbGraphic == null)
@@ -1779,34 +1771,13 @@ public class Player : Regist , IPointerClickHandler
 
             foreach (var display in uguiDisplays)
             {
-                //Debug.Log(display.dbGraphic.copyTrans.name);
                 if (display.dbGraphic == null)
                 {
                     continue;
                 }
                 display.dbGraphic.transform.SetParent(UAC.transform);
                 display.dbGraphic.transform.SetAsLastSibling();
-                //Debug.Log(display.dbGraphic.copyTrans.name, display.dbGraphic.copyTrans);
             }
-
-            //SetSlotAsFirstChild(TopSlot);
-            //SetSlotAsFirstChild(DressSlot);
-            //SetSlotAsFirstChild(LeftShortSleeveSlot);
-            //SetSlotAsFirstChild(RightShortSleeveSlot);
-            //LeftLongSleeveUAC.transform.SetAsFirstSibling();
-            //RightLongSleeveUAC.transform.SetAsFirstSibling();
-            //SetSlotAsFirstChild(EyeSlot);
-            //SetSlotAsFirstChild(MouseSlot);
-            //SetSlotAsFirstChild(LeftShoeSlot);
-            //SetSlotAsFirstChild(RightShoeSlot);
-            //SetSlotAsFirstChild(HeadWearSlot);
-            //SetSlotAsFirstChild(LeftHandSlot);
-            //SetSlotAsFirstChild(RightHandSlot);
-            //SetSlotAsFirstChild(HeadSlot);
-            //SetSlotAsFirstChild(LeftLegSlot);
-            //SetSlotAsFirstChild(RightLegSlot);
-            //SetSlotAsFirstChild(NeckSlot);
-            //SetSlotAsFirstChild(WingSlot);
         }
     }
 

+ 61 - 63
Assets/Script/SFS/Manager/BaseConnector.cs

@@ -1,64 +1,62 @@
-using System;
-
-using UnityEngine;
-
-using Sfs2X.Core;
-
-public abstract class BaseConnector 
-{
-    public GardenSmartFox GardenSmartFox;
-
-    public static int TcpPort = 9933;
-    public static string Host = "121.199.20.79";
-    public static string Zone = "Garden";
-
-    public Action<BaseEvent> onConnectSucceed;
-    public Action<BaseEvent> onConnectFailed;
-    public Action<BaseEvent> onConnectionLost;
-    public Action<bool, BaseEvent> onConnectResult;
-
-    public BaseConnector Init(GardenSmartFox smartFox)
-    {
-        GardenSmartFox = smartFox;
-
-        GardenSmartFox.SmartFox.AddEventListener(SFSEvent.CONNECTION, OnConnection);
-        GardenSmartFox.SmartFox.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
-
-        return this;
-    }
-
-    public abstract void Connect();
-    public abstract void Disconnect();
-
-    public void OnConnection(BaseEvent baseEvent)
-    {
-        if ((bool)baseEvent.Params[SFSLabel.DefaultResult])
-        {
-            //Debug.Log("Connect succeed");
-
-            if (onConnectSucceed != null)
-                onConnectSucceed.Invoke(baseEvent);
-
-            if (onConnectResult != null)
-                onConnectResult.Invoke(true, baseEvent);
-        }
-        else
-        {
-            //Debug.Log("Connect failed");
-
-            if (onConnectFailed != null)
-                onConnectSucceed.Invoke(baseEvent);
-
-            if (onConnectResult != null)
-                onConnectResult.Invoke(false, baseEvent);
-        }
-    }
-
-    public void OnConnectionLost(BaseEvent baseEvent)
-    {
-        //Debug.Log("ConnectionLost : " + (string)baseEvent.Params["reason"]);
-
-        if (onConnectionLost != null)
-            onConnectionLost.Invoke(baseEvent);
-    }
+using System;
+
+using UnityEngine;
+
+using Sfs2X.Core;
+
+public abstract class BaseConnector 
+{
+    public GardenSmartFox GardenSmartFox;
+
+    public static string Zone = "Garden";
+
+    public Action<BaseEvent> onConnectSucceed;
+    public Action<BaseEvent> onConnectFailed;
+    public Action<BaseEvent> onConnectionLost;
+    public Action<bool, BaseEvent> onConnectResult;
+
+    public BaseConnector Init(GardenSmartFox smartFox)
+    {
+        GardenSmartFox = smartFox;
+
+        GardenSmartFox.SmartFox.AddEventListener(SFSEvent.CONNECTION, OnConnection);
+        GardenSmartFox.SmartFox.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
+
+        return this;
+    }
+
+    public abstract void Connect();
+    public abstract void Disconnect();
+
+    public void OnConnection(BaseEvent baseEvent)
+    {
+        if ((bool)baseEvent.Params[SFSLabel.DefaultResult])
+        {
+            //Debug.Log("Connect succeed");
+
+            if (onConnectSucceed != null)
+                onConnectSucceed.Invoke(baseEvent);
+
+            if (onConnectResult != null)
+                onConnectResult.Invoke(true, baseEvent);
+        }
+        else
+        {
+            //Debug.Log("Connect failed");
+
+            if (onConnectFailed != null)
+                onConnectSucceed.Invoke(baseEvent);
+
+            if (onConnectResult != null)
+                onConnectResult.Invoke(false, baseEvent);
+        }
+    }
+
+    public void OnConnectionLost(BaseEvent baseEvent)
+    {
+        //Debug.Log("ConnectionLost : " + (string)baseEvent.Params["reason"]);
+
+        if (onConnectionLost != null)
+            onConnectionLost.Invoke(baseEvent);
+    }
 }

+ 42 - 42
Assets/Script/SFS/Manager/Connector.cs

@@ -1,43 +1,43 @@
-using UnityEngine;
-
-using System;
-
-using Sfs2X.Util;
-using Sfs2X.Requests;
-
-[Serializable]
-public class Connector : BaseConnector
-{
-    public Connector()
-    {
-        onConnectSucceed += baseEvent =>
-        {
-            GardenSmartFox.Loggor.Login();
-        };
-    }
-
-    public override void Connect()
-    {
-        ConfigData configData = new ConfigData
-        {
-            Host = Host,
-            Port = TcpPort,
-            Zone = Zone
-        };
-
-        //Debug.Log("Send connect request");
-
-        GardenSmartFox.SmartFox.Connect(configData);
-    }
-
-    public override void Disconnect()
-    {
-        //Debug.Log("Send logout request");
-
-        GardenSmartFox.SmartFox.Send(new LogoutRequest());
-
-        //Debug.Log("Send disconnect request");
-
-        GardenSmartFox.SmartFox.Disconnect();
-    }
+using UnityEngine;
+
+using System;
+
+using Sfs2X.Util;
+using Sfs2X.Requests;
+
+[Serializable]
+public class Connector : BaseConnector
+{
+    public Connector()
+    {
+        onConnectSucceed += baseEvent =>
+        {
+            GardenSmartFox.Loggor.Login();
+        };
+    }
+
+    public override void Connect()
+    {
+        ConfigData configData = new ConfigData
+        {
+            Host = HttpManager.sfsIp,
+            Port = HttpManager.sfsPort,
+            Zone = Zone
+        };
+
+        //Debug.Log("Send connect request");
+
+        GardenSmartFox.SmartFox.Connect(configData);
+    }
+
+    public override void Disconnect()
+    {
+        //Debug.Log("Send logout request");
+
+        GardenSmartFox.SmartFox.Send(new LogoutRequest());
+
+        //Debug.Log("Send disconnect request");
+
+        GardenSmartFox.SmartFox.Disconnect();
+    }
 }

+ 491 - 491
Assets/Script/SFS/Object/Robot.cs

@@ -1,492 +1,492 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Policy;
-using System.Xml;
-using Sfs2X;
-using Sfs2X.Core;
-using Sfs2X.Entities;
-using Sfs2X.Entities.Data;
-using Sfs2X.Requests;
-using Sfs2X.Util;
-using UnityEngine;
-using Random = UnityEngine.Random;
-
-public class Robot
-{
-    #region Config
-
-    private static Vector2 LeftDownBorder;
-    private static Vector2 RightTop;
-    private static Camera Camera;
-
-    private static bool Inited;
-    private static int MinChestValue;
-    private static int MaxChestValue;
-    private static float MinLifetime;
-    private static float MaxLifetime;
-    private static float CreateChestRate;
-    private static float ColorChestRate;
-    private static float DigitChestRate;
-    private static float MinMoveTime;
-    private static float MaxMoveTime;
-    public static string MaxRobotAmtFml;
-
-    private long RobotConfigID;
-    private string Nickname;
-    private Vector3 Position;
-    private DateTime JoinedTime;
-    private PlayerDirection Direction;
-
-    private User User;
-    private SmartFox SmartFox;
-
-    private List<int> DressdataIDs = new List<int>();
-    private List<string> DressdataNames = new List<string>();
-
-    #endregion
-
-    public static void Init()
-    {
-        if (Inited)
-        {
-            Inited = true;
-            return;
-        }
-
-        LeftDownBorder = ResourceManager.Get(PlazaRoomLabel.PlayerLeftDownBorder).position;
-        RightTop = ResourceManager.Get(PlazaRoomLabel.PlayerRightTopBorder).position;
-        Camera = ResourceManager.Get<Camera>(ResourceLabel.MainCamera);
-
-        XmlDocument document = ConfigManager.GetXmlDocument(ResourceLabel.RobotConfig);
-        XmlNode dataNode = document.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
-        XmlAttributeCollection attributes = dataNode.Attributes;
-
-        int index = 1;
-        MaxRobotAmtFml = attributes[index++].Value;
-        DigitChestRate = float.Parse(attributes[index++].Value);
-        ColorChestRate = float.Parse(attributes[index++].Value);
-        List<int> ints = Auxiliary.StringToInts(',', attributes[index++].Value, null);
-        MinMoveTime = ints[0];
-        MaxMoveTime = ints[1];
-        CreateChestRate = float.Parse(attributes[index++].Value);
-        ints = Auxiliary.StringToInts(',', attributes[index++].Value, null);
-        MinChestValue = ints[0];
-        MaxChestValue = ints[1];
-        ints = Auxiliary.StringToInts(',', attributes[index++].Value, null);
-        MinLifetime = ints[0];
-        MaxLifetime = ints[1];
-
-        //Debug.Log($"RobotConfig {MinRobotCreateTime}");
-        //Debug.Log($"RobotConfig {MaxRobotCreateTime}");
-        //Debug.Log($"RobotConfig {MaxRobotAmtFml}");
-        //Debug.Log($"RobotConfig {DigitChestRate}");
-        //Debug.Log($"RobotConfig {ColorChestRate}");
-        //Debug.Log($"RobotConfig {MinMoveTime}");
-        //Debug.Log($"RobotConfig {MaxMoveTime}");
-        //Debug.Log($"RobotConfig {CreateChestRate}");
-        //Debug.Log($"RobotConfig {MinChestValue}");
-        //Debug.Log($"RobotConfig {MaxChestValue}");
-        //Debug.Log($"RobotConfig {MinLifetime}");
-        //Debug.Log($"RobotConfig {MaxLifetime}");
-    }
-
-
-    public Robot(long robotConfigID, bool randomPos, string nickname, List<string> dressdatas)
-    {
-        //if (randomPos)
-        //{
-        //    Vector3? pos;
-        //    while ((pos = Raycast()) == null);
-        //    Position = pos.Value;
-        //    Direction = (PlayerDirection) Random.Range(0, 2);
-        //}
-        //else
-        //{
-        //    Position = SFSPlazaRoomManager.GetDefaultPosition();
-        //    Direction = SFSPlazaRoomManager.DefaultDirection;
-        //}
-        Position = PlazaRoomController.GetDefaultPosition();
-        Direction = PlazaRoomController.DefaultDirection;
-
-        try
-        {
-            RobotConfigID = robotConfigID;
-            Nickname = nickname;
-            DressdataNames = dressdatas;
-            DressdataIDs = ConfigManager.GetDressDataIDs(DressdataNames);
-        }
-        catch (Exception e)
-        {
-            foreach (var DressdataName in DressdataNames)
-            {
-                Debug.LogWarning(DressdataName);
-            }
-            Debug.LogWarning(e);
-        }
-    }
-
-    public void Connect(int sfsRoomID, int maxRobotAmt)
-    {
-        //Debug.LogWarning("Robot connect");
-        SmartFox = new SmartFox();
-        SmartFox.AddEventListener(SFSEvent.CONNECTION, OnConnectReturn);
-        SmartFox.AddEventListener(SFSEvent.CONNECTION_LOST, (evt) => Deactivate(false));
-        SmartFox.AddEventListener(SFSEvent.LOGIN, evt => { MarkAsRobot(evt, sfsRoomID, maxRobotAmt); });
-        SmartFox.AddEventListener(SFSEvent.LOGIN_ERROR, (evt) => Deactivate(false));
-        SmartFox.AddEventListener(SFSEvent.LOGOUT, (evt) => Deactivate(false));
-        SmartFox.AddEventListener(SFSEvent.EXTENSION_RESPONSE, OnExtensionResponse);
-
-        ConfigData configData = new ConfigData
-        {
-            Host = BaseConnector.Host,
-            Port = BaseConnector.TcpPort,
-            Zone = BaseConnector.Zone,
-        };
-        SmartFox.Connect(configData);
-    }
-
-    private void Login()
-    {
-        //Debug.LogWarning("Robot login");
-        string userName = Loggor.GetRandomUsername();
-        SmartFox.Send(new LoginRequest(userName, ""));
-    }
-
-    private void MarkAsRobot(BaseEvent evt, int sfsRoomID, int maxRobotAmt)
-    {
-        //Debug.LogWarning("Robot mark");
-        User = (User) evt.Params[SFSLabel.DefaultUser];
-        SFSObject arg = new SFSObject();
-        arg.PutInt(SFSLabel.CommandID, PlazaRoomReq.MarkAsRobot.GetHashCode());
-        arg.PutInt(SFSLabel.Data, maxRobotAmt);
-        arg.PutInt(SFSLabel.RoomID, sfsRoomID);
-        arg.PutLong(SFSLabel.UserID, RobotConfigID);
-        SendRequest(arg);
-    }
-
-    private void SendRequest(SFSObject arg)
-    {
-        arg = GardenSmartFox.WrapIntoArray(new List<SFSObject> {arg});
-        SmartFox.Send(new ExtensionRequest(HandlerID.PlazaRoom.GetHashString(), arg));
-    }
-
-    private void SendChestAwardRequest(long chestID)
-    {
-        SFSObject arg = PlazaRoomEvent.WrapChestAwardArg(chestID);
-        SendRequest(arg);
-    }
-
-    private void SendInstantiateRequest(int receiver)
-    {
-        SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.SendInstantiateRequset(User.Id, DressdataIDs.ToArray(), RobotConfigID.ToString(), JoinedTime, Position, Direction, Nickname, receiver);
-    }
-
-
-    private void OnConnectReturn(BaseEvent evt)
-    {
-        if ((bool) evt.Params[SFSLabel.DefaultResult])
-        {
-            //Debug.LogWarning("Robot connect succeed");
-            Login();
-        }
-        else
-        {
-            //Debug.LogWarning("Robot connect failed");
-            Deactivate(false);
-        }
-    }
-
-    private void OnExtensionResponse(BaseEvent evt)
-    {
-        string cmd = evt.Params[SFSLabel.DefaultCommand].ToString();
-
-        if (cmd == PlazaRoomRep.JoinRoomSucceed.GetHashString())
-        {
-            Activate(evt);
-        }
-        else if (cmd == PlazaRoomRep.MarkRobotError.GetHashString())
-        {
-            Deactivate(false);
-        }
-        else if (cmd == PlazaRoomRep.OtherEnterRoom.GetHashString())
-        {
-            OnOtherEnterRoom(evt);
-        }
-    }
-
-    private void OnOtherEnterRoom(BaseEvent evt)
-    {
-        ISFSObject arg = (ISFSObject) evt.Params[SFSLabel.DefaultParams];
-        int userID = arg.GetInt(SFSLabel.UserID);
-
-        if (userID != User.Id)
-        {
-            SendInstantiateRequest(userID);
-        }
-    }
-
-
-    public bool Update()
-    {
-        if (SmartFox != null)
-        {
-            SmartFox.ProcessEvents();
-        }
-
-        return Behaviour();
-    }
-
-    private bool Activated;
-    private void Activate(BaseEvent evt)
-    {
-        //Debug.LogWarning("Robot Activate");
-        Activated = true;
-        MoveTime = Random.Range(MinMoveTime, MaxMoveTime);
-        LifetimeTime = Random.Range(MinLifetime, MaxLifetime);
-        CreateChestTime = Random.Range(0, LifetimeTime);
-        JoinedTime = DateUtil.GetTimeFromSeconds(((ISFSObject) evt.Params[SFSLabel.DefaultParams]).GetLong(SFSLabel.DateTime).ToString());
-        //Debug.Log(JoinedTime);
-        SendInstantiateRequest(-1);
-    }
-
-    private bool Behaviour()
-    {
-        if (!Activated)
-        {
-            return false;
-        }
-
-        if (!SFSManager.GardenSmartFox.PlazaRoomController.JoinedPlazaRoom)
-        {
-            return false;
-        }
-
-        if (LifetimeBehaviour())
-        {
-            return true;
-        }
-
-        MoveBehaviour();
-        CreateChestBehaviour();
-        GetChestAwardBehaviour();
-        return false;
-    }
-
-    private float MoveTime;
-    private float MoveTimer;
-    private void MoveBehaviour()
-    {
-        MoveTimer += Time.deltaTime;
-        if (MoveTimer >= MoveTime)
-        {
-            MoveTimer = 0;
-            //Debug.LogWarning("Robot move");
-            Vector3? pos = Raycast();
-            if (pos != null)
-            {
-                Position = pos.Value;
-                SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.SendSynchronizeDestination(User.Id, Position);
-            }
-        }
-    }
-
-    private Vector3? Raycast()
-    {
-        Vector3 origin = new Vector3(Random.Range(LeftDownBorder.x, RightTop.x), Random.Range(LeftDownBorder.y, RightTop.y), Camera.transform.position.z);
-        Ray ray = new Ray(origin, Vector3.forward);
-        RaycastHit hitInfo;
-        if (Physics.Raycast(ray, out hitInfo))
-        {
-            if (hitInfo.collider.tag == Tags.PlazaChestTag)
-            {
-                //Debug.LogWarning("射线被箱子阻挡");
-                return null;
-            }
-            else
-            {
-                Vector3 destination = PlazaRoom.HitPositionToDestination(hitInfo.point);
-                return destination;
-            }
-        }
-        else
-        {
-            //Debug.LogWarning("射线检测失败");
-            return null;
-        }
-    }
-
-
-    private float LifetimeTime;
-    private float LifetimeTimer;
-    private bool LifetimeBehaviour()
-    {
-        LifetimeTimer += Time.deltaTime;
-        if (LifetimeTimer >= LifetimeTime)
-        {
-            //Debug.LogWarning("Robot lifetime over");
-            return true;
-        }
-        else
-        {
-            return false;
-        }
-    }
-
-    private bool CreateChestLock;
-    private float CreateChestTime;
-    private float CreateChestTimer;
-    private void CreateChestBehaviour()
-    {
-        if (CreateChestLock)
-        {
-            return;
-        }
-
-        CreateChestTimer += Time.deltaTime;
-        if (CreateChestTimer >= CreateChestTime)
-        {
-            CreateChestLock = true;
-            if (Random.Range(0f, 1f) >= CreateChestRate)
-            {
-                //Debug.LogWarning("create chest ran out of luck");
-                return;
-            }
-
-            //Debug.LogWarning("Robot create a chest");
-            RoomData roomData = SFSManager.GardenSmartFox.PlazaRoomController.CurrentRoomData;
-            int round = Random.Range(1, roomData.MaxPlayer + 1);
-            int value = Random.Range(MinChestValue, MaxChestValue);
-            Vector3 playerPos = SFSManager.GardenSmartFox.PlazaRoomController.UserInstanceDictionary[User.Id].Player.transform.position;
-            Vector3 chestPos = ChestManager.PlayerPosToChestPos(playerPos);
-            ChestType type = (ChestType) Random.Range(1, 4);
-            SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.CreateChest(round, value, type, roomData.ID, -2, chestPos);
-        }
-    }
-
-    private float GetChestTime = 3;
-    private float GetChestTimer;
-    private float MaxChestDistance = 8;
-    private List<long> OperatedChestIDs = new List<long>();
-    private void GetChestAwardBehaviour()
-    {
-        GetChestTimer += Time.deltaTime;
-        if (GetChestTimer >= GetChestTime)
-        {
-            GetChestTimer = 0;
-            //Debug.LogWarning("Robot try get some chests");
-            List<PlazaRoomChest> chests = DetectChest();
-            //Debug.LogWarning($"{chests.Count} chest/chests is available");
-            for (int i = 0; i < chests.Count; i++)
-            {
-                TryGetChestAward(chests[i]);
-            }
-        }
-    }
-
-    private List<PlazaRoomChest> DetectChest()
-    {
-        List<PlazaRoomChest> chests = new List<PlazaRoomChest>();
-
-        for (int i = 0; i < ChestManager.PlazaRoomChests.Count; i++)
-        {
-            if (Mathf.Abs(ChestManager.PlazaRoomChests[i].transform.position.x - Position.x) <= MaxChestDistance)
-            {
-                if (OperatedChestIDs.Contains(ChestManager.PlazaRoomChests[i].ChestData.ID))
-                {
-                    //Debug.LogWarning("this chest has been operated");
-                }
-                else
-                {
-                    chests.Add(ChestManager.PlazaRoomChests[i]);
-                }
-            }
-            else
-            {
-                //Debug.LogWarning("this chest is too far");
-                //Debug.LogWarning(Mathf.Abs(ChestMge.PlazaRoomChests[i].transform.position.x - Position.x));
-            }
-        }
-
-        return chests;
-    }
-
-    private void TryGetChestAward(PlazaRoomChest chest)
-    {
-        float rate = Random.Range(0f, 1f);
-        bool get = false;
-        if (chest.ChestData.ChestType == ChestType.GuessColor)
-        {
-            if (rate < ColorChestRate)
-            {
-                get = true;
-            }
-            else
-            {
-                get = false;
-            }
-        }
-        else if (chest.ChestData.ChestType == ChestType.GuessNumber)
-        {
-            if (rate < DigitChestRate)
-            {
-                get = true;
-            }
-            else
-            {
-                get = false;
-            }
-        }
-        else if (chest.ChestData.ChestType == ChestType.System)
-        {
-            if (chest.IsActive)
-            {
-                get = true;
-            }
-            else
-            {
-                get = false;
-            }
-        }
-        else
-        {
-            get = true;
-        }
-
-        OperatedChestIDs.Add(chest.ChestData.ID);
-        if (get)
-        {
-            SendChestAwardRequest(chest.ChestData.ID);
-            //Debug.LogWarning("get a chest");
-        }
-        else
-        {
-            //Debug.LogWarning("get chest ran out of luck");
-        }
-    }
-
-
-    private static float MinDelayTime = 3f;
-    private static float MaxDelayTime = 10f;
-    public void Deactivate(bool delay)
-    {
-        //Debug.LogWarning("Robot disconnect " + delay);
-        Activated = false;
-
-        if (delay)
-        {
-            DelayCall.Call(Random.Range(MinDelayTime, MaxDelayTime), Remove);
-        }
-        else
-        {
-            Remove();
-        }
-    }
-
-    private void Remove()
-    {
-        RobotManager.Robots.Remove(this);
-        SmartFox.Disconnect();
-    }
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Policy;
+using System.Xml;
+using Sfs2X;
+using Sfs2X.Core;
+using Sfs2X.Entities;
+using Sfs2X.Entities.Data;
+using Sfs2X.Requests;
+using Sfs2X.Util;
+using UnityEngine;
+using Random = UnityEngine.Random;
+
+public class Robot
+{
+    #region Config
+
+    private static Vector2 LeftDownBorder;
+    private static Vector2 RightTop;
+    private static Camera Camera;
+
+    private static bool Inited;
+    private static int MinChestValue;
+    private static int MaxChestValue;
+    private static float MinLifetime;
+    private static float MaxLifetime;
+    private static float CreateChestRate;
+    private static float ColorChestRate;
+    private static float DigitChestRate;
+    private static float MinMoveTime;
+    private static float MaxMoveTime;
+    public static string MaxRobotAmtFml;
+
+    private long RobotConfigID;
+    private string Nickname;
+    private Vector3 Position;
+    private DateTime JoinedTime;
+    private PlayerDirection Direction;
+
+    private User User;
+    private SmartFox SmartFox;
+
+    private List<int> DressdataIDs = new List<int>();
+    private List<string> DressdataNames = new List<string>();
+
+    #endregion
+
+    public static void Init()
+    {
+        if (Inited)
+        {
+            Inited = true;
+            return;
+        }
+
+        LeftDownBorder = ResourceManager.Get(PlazaRoomLabel.PlayerLeftDownBorder).position;
+        RightTop = ResourceManager.Get(PlazaRoomLabel.PlayerRightTopBorder).position;
+        Camera = ResourceManager.Get<Camera>(ResourceLabel.MainCamera);
+
+        XmlDocument document = ConfigManager.GetXmlDocument(ResourceLabel.RobotConfig);
+        XmlNode dataNode = document.SelectSingleNode(ConfigLabel.RootNode).SelectSingleNode(ConfigLabel.ChildNode);
+        XmlAttributeCollection attributes = dataNode.Attributes;
+
+        int index = 1;
+        MaxRobotAmtFml = attributes[index++].Value;
+        DigitChestRate = float.Parse(attributes[index++].Value);
+        ColorChestRate = float.Parse(attributes[index++].Value);
+        List<int> ints = Auxiliary.StringToInts(',', attributes[index++].Value, null);
+        MinMoveTime = ints[0];
+        MaxMoveTime = ints[1];
+        CreateChestRate = float.Parse(attributes[index++].Value);
+        ints = Auxiliary.StringToInts(',', attributes[index++].Value, null);
+        MinChestValue = ints[0];
+        MaxChestValue = ints[1];
+        ints = Auxiliary.StringToInts(',', attributes[index++].Value, null);
+        MinLifetime = ints[0];
+        MaxLifetime = ints[1];
+
+        //Debug.Log($"RobotConfig {MinRobotCreateTime}");
+        //Debug.Log($"RobotConfig {MaxRobotCreateTime}");
+        //Debug.Log($"RobotConfig {MaxRobotAmtFml}");
+        //Debug.Log($"RobotConfig {DigitChestRate}");
+        //Debug.Log($"RobotConfig {ColorChestRate}");
+        //Debug.Log($"RobotConfig {MinMoveTime}");
+        //Debug.Log($"RobotConfig {MaxMoveTime}");
+        //Debug.Log($"RobotConfig {CreateChestRate}");
+        //Debug.Log($"RobotConfig {MinChestValue}");
+        //Debug.Log($"RobotConfig {MaxChestValue}");
+        //Debug.Log($"RobotConfig {MinLifetime}");
+        //Debug.Log($"RobotConfig {MaxLifetime}");
+    }
+
+
+    public Robot(long robotConfigID, bool randomPos, string nickname, List<string> dressdatas)
+    {
+        //if (randomPos)
+        //{
+        //    Vector3? pos;
+        //    while ((pos = Raycast()) == null);
+        //    Position = pos.Value;
+        //    Direction = (PlayerDirection) Random.Range(0, 2);
+        //}
+        //else
+        //{
+        //    Position = SFSPlazaRoomManager.GetDefaultPosition();
+        //    Direction = SFSPlazaRoomManager.DefaultDirection;
+        //}
+        Position = PlazaRoomController.GetDefaultPosition();
+        Direction = PlazaRoomController.DefaultDirection;
+
+        try
+        {
+            RobotConfigID = robotConfigID;
+            Nickname = nickname;
+            DressdataNames = dressdatas;
+            DressdataIDs = ConfigManager.GetDressDataIDs(DressdataNames);
+        }
+        catch (Exception e)
+        {
+            foreach (var DressdataName in DressdataNames)
+            {
+                Debug.LogWarning(DressdataName);
+            }
+            Debug.LogWarning(e);
+        }
+    }
+
+    public void Connect(int sfsRoomID, int maxRobotAmt)
+    {
+        //Debug.LogWarning("Robot connect");
+        SmartFox = new SmartFox();
+        SmartFox.AddEventListener(SFSEvent.CONNECTION, OnConnectReturn);
+        SmartFox.AddEventListener(SFSEvent.CONNECTION_LOST, (evt) => Deactivate(false));
+        SmartFox.AddEventListener(SFSEvent.LOGIN, evt => { MarkAsRobot(evt, sfsRoomID, maxRobotAmt); });
+        SmartFox.AddEventListener(SFSEvent.LOGIN_ERROR, (evt) => Deactivate(false));
+        SmartFox.AddEventListener(SFSEvent.LOGOUT, (evt) => Deactivate(false));
+        SmartFox.AddEventListener(SFSEvent.EXTENSION_RESPONSE, OnExtensionResponse);
+
+        ConfigData configData = new ConfigData
+        {
+            Host = HttpManager.sfsIp,
+            Port = HttpManager.sfsPort,
+            Zone = BaseConnector.Zone,
+        };
+        SmartFox.Connect(configData);
+    }
+
+    private void Login()
+    {
+        //Debug.LogWarning("Robot login");
+        string userName = Loggor.GetRandomUsername();
+        SmartFox.Send(new LoginRequest(userName, ""));
+    }
+
+    private void MarkAsRobot(BaseEvent evt, int sfsRoomID, int maxRobotAmt)
+    {
+        //Debug.LogWarning("Robot mark");
+        User = (User) evt.Params[SFSLabel.DefaultUser];
+        SFSObject arg = new SFSObject();
+        arg.PutInt(SFSLabel.CommandID, PlazaRoomReq.MarkAsRobot.GetHashCode());
+        arg.PutInt(SFSLabel.Data, maxRobotAmt);
+        arg.PutInt(SFSLabel.RoomID, sfsRoomID);
+        arg.PutLong(SFSLabel.UserID, RobotConfigID);
+        SendRequest(arg);
+    }
+
+    private void SendRequest(SFSObject arg)
+    {
+        arg = GardenSmartFox.WrapIntoArray(new List<SFSObject> {arg});
+        SmartFox.Send(new ExtensionRequest(HandlerID.PlazaRoom.GetHashString(), arg));
+    }
+
+    private void SendChestAwardRequest(long chestID)
+    {
+        SFSObject arg = PlazaRoomEvent.WrapChestAwardArg(chestID);
+        SendRequest(arg);
+    }
+
+    private void SendInstantiateRequest(int receiver)
+    {
+        SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.SendInstantiateRequset(User.Id, DressdataIDs.ToArray(), RobotConfigID.ToString(), JoinedTime, Position, Direction, Nickname, receiver);
+    }
+
+
+    private void OnConnectReturn(BaseEvent evt)
+    {
+        if ((bool) evt.Params[SFSLabel.DefaultResult])
+        {
+            //Debug.LogWarning("Robot connect succeed");
+            Login();
+        }
+        else
+        {
+            //Debug.LogWarning("Robot connect failed");
+            Deactivate(false);
+        }
+    }
+
+    private void OnExtensionResponse(BaseEvent evt)
+    {
+        string cmd = evt.Params[SFSLabel.DefaultCommand].ToString();
+
+        if (cmd == PlazaRoomRep.JoinRoomSucceed.GetHashString())
+        {
+            Activate(evt);
+        }
+        else if (cmd == PlazaRoomRep.MarkRobotError.GetHashString())
+        {
+            Deactivate(false);
+        }
+        else if (cmd == PlazaRoomRep.OtherEnterRoom.GetHashString())
+        {
+            OnOtherEnterRoom(evt);
+        }
+    }
+
+    private void OnOtherEnterRoom(BaseEvent evt)
+    {
+        ISFSObject arg = (ISFSObject) evt.Params[SFSLabel.DefaultParams];
+        int userID = arg.GetInt(SFSLabel.UserID);
+
+        if (userID != User.Id)
+        {
+            SendInstantiateRequest(userID);
+        }
+    }
+
+
+    public bool Update()
+    {
+        if (SmartFox != null)
+        {
+            SmartFox.ProcessEvents();
+        }
+
+        return Behaviour();
+    }
+
+    private bool Activated;
+    private void Activate(BaseEvent evt)
+    {
+        //Debug.LogWarning("Robot Activate");
+        Activated = true;
+        MoveTime = Random.Range(MinMoveTime, MaxMoveTime);
+        LifetimeTime = Random.Range(MinLifetime, MaxLifetime);
+        CreateChestTime = Random.Range(0, LifetimeTime);
+        JoinedTime = DateUtil.GetTimeFromSeconds(((ISFSObject) evt.Params[SFSLabel.DefaultParams]).GetLong(SFSLabel.DateTime).ToString());
+        //Debug.Log(JoinedTime);
+        SendInstantiateRequest(-1);
+    }
+
+    private bool Behaviour()
+    {
+        if (!Activated)
+        {
+            return false;
+        }
+
+        if (!SFSManager.GardenSmartFox.PlazaRoomController.JoinedPlazaRoom)
+        {
+            return false;
+        }
+
+        if (LifetimeBehaviour())
+        {
+            return true;
+        }
+
+        MoveBehaviour();
+        CreateChestBehaviour();
+        GetChestAwardBehaviour();
+        return false;
+    }
+
+    private float MoveTime;
+    private float MoveTimer;
+    private void MoveBehaviour()
+    {
+        MoveTimer += Time.deltaTime;
+        if (MoveTimer >= MoveTime)
+        {
+            MoveTimer = 0;
+            //Debug.LogWarning("Robot move");
+            Vector3? pos = Raycast();
+            if (pos != null)
+            {
+                Position = pos.Value;
+                SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.SendSynchronizeDestination(User.Id, Position);
+            }
+        }
+    }
+
+    private Vector3? Raycast()
+    {
+        Vector3 origin = new Vector3(Random.Range(LeftDownBorder.x, RightTop.x), Random.Range(LeftDownBorder.y, RightTop.y), Camera.transform.position.z);
+        Ray ray = new Ray(origin, Vector3.forward);
+        RaycastHit hitInfo;
+        if (Physics.Raycast(ray, out hitInfo))
+        {
+            if (hitInfo.collider.tag == Tags.PlazaChestTag)
+            {
+                //Debug.LogWarning("射线被箱子阻挡");
+                return null;
+            }
+            else
+            {
+                Vector3 destination = PlazaRoom.HitPositionToDestination(hitInfo.point);
+                return destination;
+            }
+        }
+        else
+        {
+            //Debug.LogWarning("射线检测失败");
+            return null;
+        }
+    }
+
+
+    private float LifetimeTime;
+    private float LifetimeTimer;
+    private bool LifetimeBehaviour()
+    {
+        LifetimeTimer += Time.deltaTime;
+        if (LifetimeTimer >= LifetimeTime)
+        {
+            //Debug.LogWarning("Robot lifetime over");
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    private bool CreateChestLock;
+    private float CreateChestTime;
+    private float CreateChestTimer;
+    private void CreateChestBehaviour()
+    {
+        if (CreateChestLock)
+        {
+            return;
+        }
+
+        CreateChestTimer += Time.deltaTime;
+        if (CreateChestTimer >= CreateChestTime)
+        {
+            CreateChestLock = true;
+            if (Random.Range(0f, 1f) >= CreateChestRate)
+            {
+                //Debug.LogWarning("create chest ran out of luck");
+                return;
+            }
+
+            //Debug.LogWarning("Robot create a chest");
+            RoomData roomData = SFSManager.GardenSmartFox.PlazaRoomController.CurrentRoomData;
+            int round = Random.Range(1, roomData.MaxPlayer + 1);
+            int value = Random.Range(MinChestValue, MaxChestValue);
+            Vector3 playerPos = SFSManager.GardenSmartFox.PlazaRoomController.UserInstanceDictionary[User.Id].Player.transform.position;
+            Vector3 chestPos = ChestManager.PlayerPosToChestPos(playerPos);
+            ChestType type = (ChestType) Random.Range(1, 4);
+            SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.CreateChest(round, value, type, roomData.ID, -2, chestPos);
+        }
+    }
+
+    private float GetChestTime = 3;
+    private float GetChestTimer;
+    private float MaxChestDistance = 8;
+    private List<long> OperatedChestIDs = new List<long>();
+    private void GetChestAwardBehaviour()
+    {
+        GetChestTimer += Time.deltaTime;
+        if (GetChestTimer >= GetChestTime)
+        {
+            GetChestTimer = 0;
+            //Debug.LogWarning("Robot try get some chests");
+            List<PlazaRoomChest> chests = DetectChest();
+            //Debug.LogWarning($"{chests.Count} chest/chests is available");
+            for (int i = 0; i < chests.Count; i++)
+            {
+                TryGetChestAward(chests[i]);
+            }
+        }
+    }
+
+    private List<PlazaRoomChest> DetectChest()
+    {
+        List<PlazaRoomChest> chests = new List<PlazaRoomChest>();
+
+        for (int i = 0; i < ChestManager.PlazaRoomChests.Count; i++)
+        {
+            if (Mathf.Abs(ChestManager.PlazaRoomChests[i].transform.position.x - Position.x) <= MaxChestDistance)
+            {
+                if (OperatedChestIDs.Contains(ChestManager.PlazaRoomChests[i].ChestData.ID))
+                {
+                    //Debug.LogWarning("this chest has been operated");
+                }
+                else
+                {
+                    chests.Add(ChestManager.PlazaRoomChests[i]);
+                }
+            }
+            else
+            {
+                //Debug.LogWarning("this chest is too far");
+                //Debug.LogWarning(Mathf.Abs(ChestMge.PlazaRoomChests[i].transform.position.x - Position.x));
+            }
+        }
+
+        return chests;
+    }
+
+    private void TryGetChestAward(PlazaRoomChest chest)
+    {
+        float rate = Random.Range(0f, 1f);
+        bool get = false;
+        if (chest.ChestData.ChestType == ChestType.GuessColor)
+        {
+            if (rate < ColorChestRate)
+            {
+                get = true;
+            }
+            else
+            {
+                get = false;
+            }
+        }
+        else if (chest.ChestData.ChestType == ChestType.GuessNumber)
+        {
+            if (rate < DigitChestRate)
+            {
+                get = true;
+            }
+            else
+            {
+                get = false;
+            }
+        }
+        else if (chest.ChestData.ChestType == ChestType.System)
+        {
+            if (chest.IsActive)
+            {
+                get = true;
+            }
+            else
+            {
+                get = false;
+            }
+        }
+        else
+        {
+            get = true;
+        }
+
+        OperatedChestIDs.Add(chest.ChestData.ID);
+        if (get)
+        {
+            SendChestAwardRequest(chest.ChestData.ID);
+            //Debug.LogWarning("get a chest");
+        }
+        else
+        {
+            //Debug.LogWarning("get chest ran out of luck");
+        }
+    }
+
+
+    private static float MinDelayTime = 3f;
+    private static float MaxDelayTime = 10f;
+    public void Deactivate(bool delay)
+    {
+        //Debug.LogWarning("Robot disconnect " + delay);
+        Activated = false;
+
+        if (delay)
+        {
+            DelayCall.Call(Random.Range(MinDelayTime, MaxDelayTime), Remove);
+        }
+        else
+        {
+            Remove();
+        }
+    }
+
+    private void Remove()
+    {
+        RobotManager.Robots.Remove(this);
+        SmartFox.Disconnect();
+    }
 }

+ 1 - 1
Assets/Script/Tool/Bundle.cs

@@ -20,7 +20,7 @@ public class Bundle : MonoBehaviour
 {
     #region
 
-    public static string version = "1_3_5";
+    public static string version = "1_3_7";
 
     public static bool CopyComplete
     {

+ 133 - 133
Assets/Script/Tool/DashGame/URLRequest.cs

@@ -1,134 +1,134 @@
-using UnityEngine;
-using LitJson;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-public class URLRequest : MonoBehaviour
-{
-
-
-	public enum Method
-	{
-		GET,
-		POST,
-	}
-
-	public string url;
-	public Method method;
-	public WWWForm form;
-	public URLRequestCallBackDelegate callBack;
-	public URLRequestJsonCallBackDelegate jsonCallBack;
-
-	// Use this for initialization
-	IEnumerator Start() {
-        WWW www = (form == null ? new WWW(url) : new WWW(url, form));
-		yield return www;
-
-		string data = null;
-        
-		Debuger.LogWarning("Url loaded : "+url);
-		if(www.error != null)
-		{
-			data = www.error;
-			Debuger.LogError("Url error : "+www.error);
-		}
-		else
-		{
-			data = www.text;
-			Debuger.LogWarning("Url result : "+www.text);
-		}
-
-		if(callBack != null)
-			callBack(data);
-		if(jsonCallBack != null)
-			jsonCallBack(ParseRecieveJsonData(data));
-
-	    URLGOs.Remove(gameObject);
-
-		Destroy(this.gameObject);
-	}
-
-	public delegate void URLRequestCallBackDelegate(string data);
-	public delegate void URLRequestJsonCallBackDelegate(JsonData data);
-
-	public static URLRequest CreateStrURLRequest(bool important, string url, URLRequestData data = null, URLRequestCallBackDelegate callBack = null, Method method = Method.GET, bool dataEye = false)
-	{
-	    if (URLGOs.Count > MaxNotImportantURLAmt && !important)
-	    {
-	        return null;
-	    }
-		URLRequest urlRequest = CreateBaseURLRequest(url, data, method, dataEye);
-		urlRequest.callBack = callBack;
-		return urlRequest;
-	}
-
-    private static int MaxNotImportantURLAmt = 10;
-    private static List<GameObject> URLGOs = new List<GameObject>();
-	public static URLRequest CreateURLRequest(bool important, string url, URLRequestData data = null, URLRequestJsonCallBackDelegate callBack = null, Method method = Method.GET)
-	{
-        if (URLGOs.Count > MaxNotImportantURLAmt && !important)
-        {
-            return null;
-        }
-        URLRequest urlRequest = CreateBaseURLRequest(url, data, method);
-		urlRequest.jsonCallBack = callBack;
-		return urlRequest;
-	}
-
-	private static URLRequest CreateBaseURLRequest(string url, URLRequestData requestData = null, Method method = Method.GET, bool dataEye = false)
-	{
-		GameObject gameObj = new GameObject("URLRequest");
-        DontDestroyOnLoad(gameObj);
-        URLGOs.Add(gameObj);
-        URLRequest urlRequest = gameObj.AddComponent<URLRequest>();
-
-		Debuger.Log("Url request : "+url);
-        
-		if(!dataEye && requestData.HasData())
-		{
-			if(method == Method.GET)
-			{
-				if(url.IndexOf("?") == -1)
-					url += "?";
-				
-				if(url.Substring(url.Length-1) != "?")
-					url += "&";
-				url += requestData.GetDataString();
-			}
-			else if(method == Method.POST)
-			{
-				urlRequest.form = requestData.GetDataForm();
-			}
-		}
-
-		urlRequest.url = url;
-		return urlRequest;
-	}
-
-
-	public static JsonData ParseRecieveJsonData(string data)
-	{
-        //Debug.LogWarning(data);
-		int index = data.IndexOf("{");
-		if(index >= 0)
-		{
-			data = data.Substring(index);
-		}
-
-		try
-		{
-			return JsonMapper.ToObject(data);
-		}
-		catch(JsonException e)
-		{
-			Debuger.LogException(e);
-            //Debug.Log(e.ToString());
-            //Debug.Log(data);
-        }
-		
-		JsonData json = new JsonData();
-	    json["error"] = 0;
-		return json;
-	}
+using UnityEngine;
+using LitJson;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+public class URLRequest : MonoBehaviour
+{
+
+
+	public enum Method
+	{
+		GET,
+		POST,
+	}
+
+	public string url;
+	public Method method;
+	public WWWForm form;
+	public URLRequestCallBackDelegate callBack;
+	public URLRequestJsonCallBackDelegate jsonCallBack;
+
+	// Use this for initialization
+	IEnumerator Start() {
+        WWW www = (form == null ? new WWW(url) : new WWW(url, form));
+		yield return www;
+
+		string data = null;
+        
+		Debuger.LogWarning("Url loaded : "+url);
+		if(www.error != null)
+		{
+			data = www.error;
+			Debuger.LogError("Url error : "+www.error);
+		}
+		else
+		{
+			data = www.text;
+			Debuger.LogWarning("Url result : "+www.text);
+		}
+
+		if(callBack != null)
+			callBack(data);
+		if(jsonCallBack != null)
+			jsonCallBack(ParseRecieveJsonData(data));
+
+	    URLGOs.Remove(gameObject);
+
+		Destroy(this.gameObject);
+	}
+
+	public delegate void URLRequestCallBackDelegate(string data);
+	public delegate void URLRequestJsonCallBackDelegate(JsonData data);
+
+	public static URLRequest CreateStrURLRequest(bool important, string url, URLRequestData data = null, URLRequestCallBackDelegate callBack = null, Method method = Method.GET, bool dataEye = false)
+	{
+	    if (URLGOs.Count > MaxNotImportantURLAmt && !important)
+	    {
+	        return null;
+	    }
+		URLRequest urlRequest = CreateBaseURLRequest(url, data, method, dataEye);
+		urlRequest.callBack = callBack;
+		return urlRequest;
+	}
+
+    private static int MaxNotImportantURLAmt = 10;
+    private static List<GameObject> URLGOs = new List<GameObject>();
+	public static URLRequest CreateURLRequest(bool important, string url, URLRequestData data = null, URLRequestJsonCallBackDelegate callBack = null, Method method = Method.GET)
+	{
+        if (URLGOs.Count > MaxNotImportantURLAmt && !important)
+        {
+            return null;
+        }
+        URLRequest urlRequest = CreateBaseURLRequest(url, data, method);
+		urlRequest.jsonCallBack = callBack;
+		return urlRequest;
+	}
+
+	private static URLRequest CreateBaseURLRequest(string url, URLRequestData requestData = null, Method method = Method.GET, bool dataEye = false)
+	{
+		GameObject gameObj = new GameObject("URLRequest");
+        DontDestroyOnLoad(gameObj);
+        URLGOs.Add(gameObj);
+        URLRequest urlRequest = gameObj.AddComponent<URLRequest>();
+
+		Debuger.Log("Url request : "+url);
+        
+		if(!dataEye && requestData.HasData())
+		{
+			if(method == Method.GET)
+			{
+				if(url.IndexOf("?") == -1)
+					url += "?";
+				
+				if(url.Substring(url.Length-1) != "?")
+					url += "&";
+				url += requestData.GetDataString();
+			}
+			else if(method == Method.POST)
+			{
+				urlRequest.form = requestData.GetDataForm();
+			}
+		}
+
+		urlRequest.url = url;
+		return urlRequest;
+	}
+
+
+
+	public static JsonData ParseRecieveJsonData(string data)
+	{
+        int index = data.IndexOf("{");
+		if(index >= 0)
+		{
+			data = data.Substring(index);
+		}
+
+		try
+		{
+			return JsonMapper.ToObject(data);
+		}
+		catch(JsonException e)
+		{
+			Debuger.LogException(e);
+            //Debug.Log(e.ToString());
+            //Debug.Log(data);
+        }
+		
+		JsonData json = new JsonData();
+	    json["error"] = 0;
+		return json;
+	}
 }

+ 0 - 1
ProjectSettings/GraphicsSettings.asset

@@ -39,7 +39,6 @@ GraphicsSettings:
   - {fileID: 4800000, guid: ac390d8200b91bd419e2d7b9e580d07d, type: 3}
   - {fileID: 4800000, guid: e73e8e8cfe7b2344abcbf572918e22a1, type: 3}
   - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
-  - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
   m_PreloadedShaders: []
   m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
     type: 0}

+ 5 - 4
ProjectSettings/ProjectSettings.asset

@@ -125,7 +125,7 @@ PlayerSettings:
     16:10: 1
     16:9: 1
     Others: 1
-  bundleVersion: 1.3.5
+  bundleVersion: 1.3.7
   preloadedAssets: []
   metroInputSource: 0
   m_HolographicPauseOnTrackingLoss: 1
@@ -156,8 +156,8 @@ PlayerSettings:
     iOS: com.dashgame.garden
     tvOS: com.dashgame.garden
   buildNumber:
-    iOS: 21
-  AndroidBundleVersionCode: 29
+    iOS: 23
+  AndroidBundleVersionCode: 31
   AndroidMinSdkVersion: 16
   AndroidTargetSdkVersion: 0
   AndroidPreferredInstallLocation: 1
@@ -227,7 +227,7 @@ PlayerSettings:
   appleDeveloperTeamID: Daiqing Gao (dashgamemaster@gmail.com)
   iOSManualSigningProvisioningProfileID: 
   tvOSManualSigningProvisioningProfileID: 
-  appleEnableAutomaticSigning: 0
+  appleEnableAutomaticSigning: 2
   AndroidTargetDevice: 3
   AndroidSplashScreenScale: 0
   androidSplashScreen: {fileID: 0}
@@ -551,6 +551,7 @@ PlayerSettings:
   apiCompatibilityLevelPerPlatform:
     Android: 1
     Standalone: 1
+    iOS: 1
   m_RenderingPath: 1
   m_MobileRenderingPath: 1
   metroPackageName: MyLovelyGarden

+ 2 - 2
ProjectSettings/UnityConnectSettings.asset

@@ -23,7 +23,7 @@ UnityConnectSettings:
     m_TestEventUrl: 
     m_TestConfigUrl: 
   UnityAdsSettings:
-    m_Enabled: 0
+    m_Enabled: 1
     m_InitializeOnStartup: 0
     m_TestMode: 0
     m_IosGameId: 1408492
@@ -31,6 +31,6 @@ UnityConnectSettings:
     m_GameIds:
       AndroidPlayer: 1408493
       iPhonePlayer: 1408492
-    m_GameId: 1408493
+    m_GameId: 
   PerformanceReportingSettings:
     m_Enabled: 0