Ver código fonte

更改PlazaRoom逻辑

LiuQilin 8 anos atrás
pai
commit
b35385b125

+ 119 - 119
Assets/Resource/Animations/人物动画/stand_texture.png.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: 8d523bac11c2f3742ab88a2cbd71bf39
-timeCreated: 1505200975
+timeCreated: 1506059783
 licenseType: Pro
 TextureImporter:
   fileIDToRecycleName:
@@ -239,8 +239,8 @@ TextureImporter:
       name: "\u4E0A\u88631\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 4037
-        y: 2904
+        x: 2331
+        y: 1301
         width: 57
         height: 56
       alignment: 0
@@ -382,8 +382,8 @@ TextureImporter:
       name: "\u4E0A\u88631\u8896\u5B50\u5DE6"
       rect:
         serializedVersion: 2
-        x: 2269
-        y: 1298
+        x: 3108
+        y: 2609
         width: 60
         height: 59
       alignment: 0
@@ -405,6 +405,19 @@ TextureImporter:
       outline: []
       tessellationDetail: -1
     - serializedVersion: 2
+      name: 2
+      rect:
+        serializedVersion: 2
+        x: 1800
+        y: 2225
+        width: 28
+        height: 38
+      alignment: 0
+      pivot: {x: 0, y: 0}
+      border: {x: 0, y: 0, z: 0, w: 0}
+      outline: []
+      tessellationDetail: -1
+    - serializedVersion: 2
       name: "\u4E0A\u88632"
       rect:
         serializedVersion: 2
@@ -422,7 +435,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 3938
-        y: 3188
+        y: 2962
         width: 119
         height: 111
       alignment: 0
@@ -512,8 +525,8 @@ TextureImporter:
       name: "\u978B\u5B502"
       rect:
         serializedVersion: 2
-        x: 4058
-        y: 3548
+        x: 2440
+        y: 2943
         width: 37
         height: 46
       alignment: 0
@@ -590,8 +603,8 @@ TextureImporter:
       name: "\u5934\u53D14\uFF08\u84DD\u8272\uFF09"
       rect:
         serializedVersion: 2
-        x: 1948
-        y: 2991
+        x: 2789
+        y: 3442
         width: 570
         height: 653
       alignment: 0
@@ -603,8 +616,8 @@ TextureImporter:
       name: "\u5934\u53D14\uFF08\u7EFF\u8272\uFF09"
       rect:
         serializedVersion: 2
-        x: 2789
-        y: 3442
+        x: 1948
+        y: 2991
         width: 570
         height: 653
       alignment: 0
@@ -616,7 +629,7 @@ TextureImporter:
       name: "\u5934\u53D15\uFF08\u68D5\u8272\uFF09"
       rect:
         serializedVersion: 2
-        x: 1221
+        x: 1
         y: 2505
         width: 608
         height: 504
@@ -642,7 +655,7 @@ TextureImporter:
       name: "\u5934\u53D15\uFF08\u9EC4\u8272\uFF09"
       rect:
         serializedVersion: 2
-        x: 1
+        x: 1221
         y: 2505
         width: 608
         height: 504
@@ -681,7 +694,7 @@ TextureImporter:
       name: "\u5934\u53D16+\u4E0B\uFF08\u7EFF\uFF09"
       rect:
         serializedVersion: 2
-        x: 383
+        x: 1
         y: 1735
         width: 380
         height: 768
@@ -694,8 +707,8 @@ TextureImporter:
       name: "\u5934\u53D16+\u4E0A\uFF08\u7EFF\uFF09"
       rect:
         serializedVersion: 2
-        x: 549
-        y: 602
+        x: 1599
+        y: 850
         width: 447
         height: 446
       alignment: 0
@@ -707,7 +720,7 @@ TextureImporter:
       name: "\u5934\u53D16+\u4E0B\uFF08\u9EC4\uFF09"
       rect:
         serializedVersion: 2
-        x: 1
+        x: 765
         y: 1735
         width: 380
         height: 768
@@ -720,8 +733,8 @@ TextureImporter:
       name: "\u5934\u53D16+\u4E0A\uFF08\u9EC4\uFF09"
       rect:
         serializedVersion: 2
-        x: 1599
-        y: 850
+        x: 1419
+        y: 3063
         width: 447
         height: 446
       alignment: 0
@@ -733,7 +746,7 @@ TextureImporter:
       name: "\u5934\u53D16+\u4E0B\uFF08\u7C89\uFF09"
       rect:
         serializedVersion: 2
-        x: 765
+        x: 383
         y: 1735
         width: 380
         height: 768
@@ -746,8 +759,8 @@ TextureImporter:
       name: "\u5934\u53D16+\u4E0A\uFF08\u7C89\uFF09"
       rect:
         serializedVersion: 2
-        x: 1419
-        y: 3063
+        x: 549
+        y: 602
         width: 447
         height: 446
       alignment: 0
@@ -759,7 +772,7 @@ TextureImporter:
       name: "\u5934\u53D17(\u6A59)"
       rect:
         serializedVersion: 2
-        x: 1299
+        x: 1
         y: 3511
         width: 647
         height: 584
@@ -772,7 +785,7 @@ TextureImporter:
       name: "\u5934\u53D17(\u7C73\u767D)"
       rect:
         serializedVersion: 2
-        x: 650
+        x: 1299
         y: 3511
         width: 647
         height: 584
@@ -785,7 +798,7 @@ TextureImporter:
       name: "\u5934\u53D17(\u84DD\u8272)"
       rect:
         serializedVersion: 2
-        x: 1
+        x: 650
         y: 3511
         width: 647
         height: 584
@@ -798,8 +811,8 @@ TextureImporter:
       name: "\u5934\u53D18(\u7C89)"
       rect:
         serializedVersion: 2
-        x: 1
-        y: 3011
+        x: 3229
+        y: 2942
         width: 707
         height: 498
       alignment: 0
@@ -811,8 +824,8 @@ TextureImporter:
       name: "\u5934\u53D18(\u7D2B)"
       rect:
         serializedVersion: 2
-        x: 2520
-        y: 2942
+        x: 1
+        y: 3011
         width: 707
         height: 498
       alignment: 0
@@ -837,7 +850,7 @@ TextureImporter:
       name: "\u5934\u53D18(\u9ED1)"
       rect:
         serializedVersion: 2
-        x: 3229
+        x: 2520
         y: 2942
         width: 707
         height: 498
@@ -850,8 +863,8 @@ TextureImporter:
       name: "\u8111\u58F31(\u68D5\u8272)"
       rect:
         serializedVersion: 2
-        x: 2099
-        y: 1830
+        x: 953
+        y: 1050
         width: 644
         height: 389
       alignment: 0
@@ -863,8 +876,8 @@ TextureImporter:
       name: "\u8111\u58F31(\u7C89\u8272)"
       rect:
         serializedVersion: 2
-        x: 953
-        y: 1050
+        x: 2099
+        y: 1830
         width: 644
         height: 389
       alignment: 0
@@ -876,8 +889,8 @@ TextureImporter:
       name: "\u8111\u58F32(\u7C89\u8272)"
       rect:
         serializedVersion: 2
-        x: 2213
-        y: 2518
+        x: 1
+        y: 779
         width: 546
         height: 422
       alignment: 0
@@ -889,8 +902,8 @@ TextureImporter:
       name: "\u8111\u58F32(\u9EC4\u8272)"
       rect:
         serializedVersion: 2
-        x: 1
-        y: 779
+        x: 2213
+        y: 2518
         width: 546
         height: 422
       alignment: 0
@@ -902,8 +915,8 @@ TextureImporter:
       name: "\u8111\u58F32+\u4E0B\uFF08\u68D5\u8272\uFF09\u53E6\u4E00\u79CD\u53D1\u578B"
       rect:
         serializedVersion: 2
-        x: 1147
-        y: 1441
+        x: 1623
+        y: 1689
         width: 474
         height: 530
       alignment: 0
@@ -928,8 +941,8 @@ TextureImporter:
       name: "\u8111\u58F33+\u4E0B\uFF08\u9EC4\u8272\uFF09\u8111\u58F32\u2014\u2014\u4E0B"
       rect:
         serializedVersion: 2
-        x: 1623
-        y: 1689
+        x: 1147
+        y: 1973
         width: 474
         height: 530
       alignment: 0
@@ -954,7 +967,7 @@ TextureImporter:
       name: "\u8111\u58F33+\u4E0A\uFF08\u7C89\u8272\uFF09"
       rect:
         serializedVersion: 2
-        x: 549
+        x: 1442
         y: 216
         width: 442
         height: 384
@@ -968,7 +981,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 1147
-        y: 1973
+        y: 1441
         width: 474
         height: 530
       alignment: 0
@@ -980,7 +993,7 @@ TextureImporter:
       name: "\u8111\u58F33+\u4E0A\uFF08\u7D2B\u8272\uFF09"
       rect:
         serializedVersion: 2
-        x: 1442
+        x: 998
         y: 216
         width: 442
         height: 384
@@ -993,7 +1006,7 @@ TextureImporter:
       name: "\u8111\u58F33+\u4E0A\uFF08\u9EC4\u8272\uFF09"
       rect:
         serializedVersion: 2
-        x: 998
+        x: 549
         y: 216
         width: 442
         height: 384
@@ -1006,8 +1019,8 @@ TextureImporter:
       name: "\u8863\u670D10\uFF08\u9EC4\uFF09"
       rect:
         serializedVersion: 2
-        x: 2761
-        y: 2608
+        x: 1
+        y: 21
         width: 345
         height: 332
       alignment: 0
@@ -1032,8 +1045,8 @@ TextureImporter:
       name: "\u8863\u670D10"
       rect:
         serializedVersion: 2
-        x: 1
-        y: 21
+        x: 2761
+        y: 2608
         width: 345
         height: 332
       alignment: 0
@@ -1058,8 +1071,8 @@ TextureImporter:
       name: "\u8863\u670D11(\u7C89)"
       rect:
         serializedVersion: 2
-        x: 2048
-        y: 997
+        x: 1886
+        y: 549
         width: 383
         height: 299
       alignment: 0
@@ -1071,7 +1084,7 @@ TextureImporter:
       name: "\u88D9\u5B5011(\u7C89)"
       rect:
         serializedVersion: 2
-        x: 650
+        x: 348
         y: 19
         width: 300
         height: 195
@@ -1084,8 +1097,8 @@ TextureImporter:
       name: "\u8863\u670D11"
       rect:
         serializedVersion: 2
-        x: 1886
-        y: 549
+        x: 2048
+        y: 997
         width: 383
         height: 299
       alignment: 0
@@ -1097,7 +1110,7 @@ TextureImporter:
       name: "\u88D9\u5B5011"
       rect:
         serializedVersion: 2
-        x: 348
+        x: 650
         y: 19
         width: 300
         height: 195
@@ -1150,7 +1163,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 3687
-        y: 2709
+        y: 2476
         width: 285
         height: 231
       alignment: 0
@@ -1163,7 +1176,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 3687
-        y: 2476
+        y: 2709
         width: 285
         height: 231
       alignment: 0
@@ -1237,7 +1250,7 @@ TextureImporter:
       outline: []
       tessellationDetail: -1
     - serializedVersion: 2
-      name: 2
+      name: 3
       rect:
         serializedVersion: 2
         x: 4064
@@ -1250,7 +1263,7 @@ TextureImporter:
       outline: []
       tessellationDetail: -1
     - serializedVersion: 2
-      name: 3
+      name: 4
       rect:
         serializedVersion: 2
         x: 4064
@@ -1263,19 +1276,6 @@ TextureImporter:
       outline: []
       tessellationDetail: -1
     - serializedVersion: 2
-      name: 4
-      rect:
-        serializedVersion: 2
-        x: 1800
-        y: 2225
-        width: 28
-        height: 38
-      alignment: 0
-      pivot: {x: 0, y: 0}
-      border: {x: 0, y: 0, z: 0, w: 0}
-      outline: []
-      tessellationDetail: -1
-    - serializedVersion: 2
       name: 5
       rect:
         serializedVersion: 2
@@ -1370,8 +1370,8 @@ TextureImporter:
       name: 12
       rect:
         serializedVersion: 2
-        x: 2479
-        y: 2943
+        x: 4058
+        y: 3548
         width: 37
         height: 46
       alignment: 0
@@ -1383,7 +1383,7 @@ TextureImporter:
       name: 13
       rect:
         serializedVersion: 2
-        x: 2440
+        x: 2479
         y: 2943
         width: 37
         height: 46
@@ -1435,8 +1435,8 @@ TextureImporter:
       name: "\u5934\u99707"
       rect:
         serializedVersion: 2
-        x: 3225
-        y: 2398
+        x: 3108
+        y: 2670
         width: 268
         height: 270
       alignment: 0
@@ -1448,8 +1448,8 @@ TextureImporter:
       name: "\u5934\u99708"
       rect:
         serializedVersion: 2
-        x: 3108
-        y: 2670
+        x: 3225
+        y: 2398
         width: 268
         height: 270
       alignment: 0
@@ -1540,7 +1540,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 3938
-        y: 3414
+        y: 3188
         width: 119
         height: 111
       alignment: 0
@@ -1553,7 +1553,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 3938
-        y: 2962
+        y: 3075
         width: 119
         height: 111
       alignment: 0
@@ -1591,7 +1591,7 @@ TextureImporter:
       name: "\u4E0A\u886310"
       rect:
         serializedVersion: 2
-        x: 2227
+        x: 2048
         y: 853
         width: 177
         height: 142
@@ -1604,8 +1604,8 @@ TextureImporter:
       name: "\u4E0A\u886311"
       rect:
         serializedVersion: 2
-        x: 3495
-        y: 2409
+        x: 953
+        y: 1454
         width: 184
         height: 119
       alignment: 0
@@ -1630,8 +1630,8 @@ TextureImporter:
       name: "\u4E0A\u886313"
       rect:
         serializedVersion: 2
-        x: 1447
-        y: 886
+        x: 2269
+        y: 1359
         width: 124
         height: 162
       alignment: 0
@@ -1643,7 +1643,7 @@ TextureImporter:
       name: "\u4E0A\u886310\uFF08\u9EC4\uFF09"
       rect:
         serializedVersion: 2
-        x: 2048
+        x: 2227
         y: 853
         width: 177
         height: 142
@@ -1656,8 +1656,8 @@ TextureImporter:
       name: "\u4E0A\u886311(\u7C89)"
       rect:
         serializedVersion: 2
-        x: 953
-        y: 1454
+        x: 3495
+        y: 2409
         width: 184
         height: 119
       alignment: 0
@@ -1669,8 +1669,8 @@ TextureImporter:
       name: "\u4E0A\u886313(\u7D2B)"
       rect:
         serializedVersion: 2
-        x: 2269
-        y: 1359
+        x: 1447
+        y: 886
         width: 124
         height: 162
       alignment: 0
@@ -1683,7 +1683,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 3938
-        y: 3075
+        y: 3414
         width: 119
         height: 111
       alignment: 0
@@ -1734,8 +1734,8 @@ TextureImporter:
       name: "\u4E0A\u886312\u8896\u5B50\u5DE6"
       rect:
         serializedVersion: 2
-        x: 1831
-        y: 2995
+        x: 1868
+        y: 3096
         width: 66
         height: 66
       alignment: 0
@@ -1747,8 +1747,8 @@ TextureImporter:
       name: "\u4E0A\u886312\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 2060
-        y: 423
+        x: 3974
+        y: 2899
         width: 61
         height: 61
       alignment: 0
@@ -1760,8 +1760,8 @@ TextureImporter:
       name: "\u4E0A\u886313\u84DD\u8896\u5B50\u5DE6"
       rect:
         serializedVersion: 2
-        x: 1744
-        y: 2265
+        x: 1831
+        y: 2995
         width: 66
         height: 66
       alignment: 0
@@ -1773,8 +1773,8 @@ TextureImporter:
       name: "\u4E0A\u886313\u84DD\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 3974
-        y: 2899
+        x: 1809
+        y: 602
         width: 61
         height: 61
       alignment: 0
@@ -1787,7 +1787,7 @@ TextureImporter:
       rect:
         serializedVersion: 2
         x: 4026
-        y: 3664
+        y: 3732
         width: 66
         height: 66
       alignment: 0
@@ -1799,8 +1799,8 @@ TextureImporter:
       name: "\u4E0A\u886313\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 3974
-        y: 2836
+        x: 2060
+        y: 486
         width: 61
         height: 61
       alignment: 0
@@ -1812,8 +1812,8 @@ TextureImporter:
       name: "\u4E0A\u88632\u8896\u5B50\u5DE6"
       rect:
         serializedVersion: 2
-        x: 3108
-        y: 2609
+        x: 2269
+        y: 1298
         width: 60
         height: 59
       alignment: 0
@@ -1825,8 +1825,8 @@ TextureImporter:
       name: "\u4E0A\u88632\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 2331
-        y: 1301
+        x: 4037
+        y: 2904
         width: 57
         height: 56
       alignment: 0
@@ -1838,8 +1838,8 @@ TextureImporter:
       name: "\u4E0A\u88636\u8896\u5B50\u5DE6"
       rect:
         serializedVersion: 2
-        x: 4026
-        y: 3732
+        x: 1744
+        y: 2265
         width: 66
         height: 66
       alignment: 0
@@ -1851,8 +1851,8 @@ TextureImporter:
       name: "\u4E0A\u88636\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 4021
-        y: 3966
+        x: 2060
+        y: 423
         width: 61
         height: 61
       alignment: 0
@@ -1877,8 +1877,8 @@ TextureImporter:
       name: "\u4E0A\u88637\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 2060
-        y: 486
+        x: 4021
+        y: 3966
         width: 61
         height: 61
       alignment: 0
@@ -1890,8 +1890,8 @@ TextureImporter:
       name: "\u4E0A\u88637\u7C89\u8896\u5B50\u53F3"
       rect:
         serializedVersion: 2
-        x: 1809
-        y: 602
+        x: 3974
+        y: 2836
         width: 61
         height: 61
       alignment: 0
@@ -1903,8 +1903,8 @@ TextureImporter:
       name: "\u4E0A\u88637\u7C89\u8896\u5B50\u5DE6"
       rect:
         serializedVersion: 2
-        x: 1868
-        y: 3096
+        x: 4026
+        y: 3664
         width: 66
         height: 66
       alignment: 0

+ 1 - 1
Assets/Script/Manage/Initializer.cs

@@ -276,7 +276,7 @@ public class Initializer : MonoBehaviour
         ManaCenter.LoginCallbackInitial(new JsonData());
 
         debugLab.text = "Error code : 9";
-        GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SyncClose();
+        //GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SyncClose();
 
         debugLab.text = "Error code : 10";
         StringFilter.Init();

+ 5 - 1
Assets/Script/Manage/ManaCenter.cs

@@ -1013,10 +1013,14 @@ public class ManaCenter : Regist
             if (ManaData.GetPlayerString("ID") == "Default")
             {
                 ManaServer.ID = ManaServer.JsonData["o"].ToString();
-                ManaServer.SerialNumber = ManaServer.JsonData["i"].ToString();
 
                 ManaReso.SetText("L_UserLab", ManaServer.ID);
             }
+
+            if (ManaData.GetPlayerString("SerialNumber") == "Default")
+            {
+                ManaServer.SerialNumber = ManaServer.JsonData["i"].ToString();
+            }
         }
 
         ManaSocial.UpdatePage(true);

+ 62 - 41
Assets/Script/Manage/ManaData.cs

@@ -1169,47 +1169,68 @@ public class ManaData : Regist
 		return nativeDoc;
 	}
 
-	public static List<string> GetSleeveListByTop(string topName)
-	{
-		List<string> sleeveList = new List<string> (){ "Empty", "Empty", "Empty", "Empty" };
-
-		if (topName == "上衣1") {
-			sleeveList [1] = "短袖1左";
-			sleeveList [3] = "短袖1右";
-		} else if (topName == "上衣2") {
-			sleeveList [1] = "短袖2左";
-			sleeveList [3] = "短袖2右";
-		} else if (topName == "上衣3") {
-			sleeveList [1] = "短袖2左";
-			sleeveList [3] = "短袖2右";
-		} else if (topName == "上衣5") {
-			sleeveList [1] = "短袖2左";
-			sleeveList [3] = "短袖2右";
-		} else if (topName == "上衣6") {
-			sleeveList [1] = "短袖6左";
-			sleeveList [3] = "短袖6右";
-		} else if (topName == "上衣7") {
-			sleeveList [1] = "短袖7左";
-			sleeveList [3] = "短袖7右";
-		} else if (topName == "上衣7(粉)") {
-			sleeveList [1] = "短袖7粉左";
-			sleeveList [3] = "短袖7粉右";
-		} else if (topName == "上衣12") {
-			sleeveList [1] = "短袖12左";
-			sleeveList [3] = "短袖12右";
-		} else if (topName == "上衣13") {
-			sleeveList [1] = "短袖13左";
-			sleeveList [3] = "短袖13右";
-		} else if (topName == "上衣13(紫)") {
-			sleeveList [1] = "短袖13蓝左";
-			sleeveList [3] = "短袖13蓝右";
-		} else {
-			sleeveList [0] = "长袖9左";
-			sleeveList [2] = "长袖9右";
-		}
-	
-		return sleeveList;
-	}
+    public static List<string> GetSleeveListByTop(string topName)
+    {
+        List<string> sleeveList = new List<string>() {"Empty", "Empty", "Empty", "Empty"};
+
+        if (topName == "上衣1")
+        {
+            sleeveList[1] = "短袖1左";
+            sleeveList[3] = "短袖1右";
+        }
+        else if (topName == "上衣2")
+        {
+            sleeveList[1] = "短袖2左";
+            sleeveList[3] = "短袖2右";
+        }
+        else if (topName == "上衣3")
+        {
+            sleeveList[1] = "短袖2左";
+            sleeveList[3] = "短袖2右";
+        }
+        else if (topName == "上衣5")
+        {
+            sleeveList[1] = "短袖2左";
+            sleeveList[3] = "短袖2右";
+        }
+        else if (topName == "上衣6")
+        {
+            sleeveList[1] = "短袖6左";
+            sleeveList[3] = "短袖6右";
+        }
+        else if (topName == "上衣7")
+        {
+            sleeveList[1] = "短袖7左";
+            sleeveList[3] = "短袖7右";
+        }
+        else if (topName == "上衣7(粉)")
+        {
+            sleeveList[1] = "短袖7粉左";
+            sleeveList[3] = "短袖7粉右";
+        }
+        else if (topName == "上衣12")
+        {
+            sleeveList[1] = "短袖12左";
+            sleeveList[3] = "短袖12右";
+        }
+        else if (topName == "上衣13")
+        {
+            sleeveList[1] = "短袖13左";
+            sleeveList[3] = "短袖13右";
+        }
+        else if (topName == "上衣13(紫)")
+        {
+            sleeveList[1] = "短袖13蓝左";
+            sleeveList[3] = "短袖13蓝右";
+        }
+        else
+        {
+            sleeveList[0] = "长袖9左";
+            sleeveList[2] = "长袖9右";
+        }
+
+        return sleeveList;
+    }
 
     public static XmlDocument To5(XmlDocument nativeDoc, XmlDocument defaultDoc)
     {

+ 5 - 1
Assets/Script/Manage/ManaServer.cs

@@ -948,13 +948,17 @@ public class ManaServer : Regist
                 if (ManaData.GetPlayerString("ID") == "Default")
                 {
                     ID = jsonData["o"].ToString();
-                    SerialNumber = jsonData["i"].ToString();
 
                     if (Initializer.Complete)
                     {
                         ManaReso.SetText("L_UserLab", ID);
                     }
                 }
+
+                if (ManaData.GetPlayerString("SerialNumber") == "Default")
+                {
+                    SerialNumber = JsonData["i"].ToString();
+                }
             }
 
             if (FirstConnect)

+ 21 - 24
Assets/Script/Object/Player.cs

@@ -16,22 +16,22 @@ using Transform = UnityEngine.Transform;
 
 public enum BodyPart
 {
-    Leg,
-    LeftHand,
-    RightHand,
-	LeftLongSleeve,
-	LeftShortSleeve,
-	RightLongSleeve,
-	RightShortSleeve,
-    Neck,
-    Eye,
-    Top,
-    Shoe,
-    Head,
-    Wing,
-    Dress,
-    Mouse,
-    Headwear,
+    Leg = 0,
+    LeftHand = 1,
+    RightHand = 2,
+	LeftLongSleeve = 3,
+    LeftShortSleeve = 4,
+    RightLongSleeve = 5,
+    RightShortSleeve = 6,
+    Neck = 7,
+    Eye = 8,
+    Top = 9,
+    Shoe = 10,
+    Head = 11,
+    Wing = 12,
+    Dress = 13,
+    Mouse = 14,
+    Headwear = 15,
 }
 
 public class CloseUnit
@@ -403,6 +403,8 @@ public class CloseUnit
                     ManaPlayer.BoughtCloseList.UniqueAdd(ID);
 
                     ManaReso.Get("Pa_Info").TweenBacCG();
+
+                    ManaServer.Save();
                 },
                 StaticsManager.ItemID.解锁服装,
                 StaticsManager.ConsumeModule.Shop,
@@ -443,8 +445,8 @@ public class CloseUnit
 
 public enum PlayerDirection
 {
-    Left,
-    Right,
+    Left = 0,
+    Right = 1,
 }
 
 public class Player : Regist , IPointerClickHandler
@@ -603,7 +605,6 @@ public class Player : Regist , IPointerClickHandler
         }
     }
 
-    public bool AnimationDirty;
     public string CurrentAnimationName;
     public void PlayAnim(string animName)
     {
@@ -619,7 +620,6 @@ public class Player : Regist , IPointerClickHandler
 
         if (GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.InPlazaRoom)
         {
-            AnimationDirty = true;
             CurrentAnimationName = animName;
         }
 
@@ -657,11 +657,8 @@ public class Player : Regist , IPointerClickHandler
     }
 
 
-    public bool DirectionDirty;
     public void Flip(PlayerDirection direction)
     {
-        DirectionDirty = true;
-
         if (direction == PlayerDirection.Left)
         {
             UAC.armature.flipX = false;
@@ -716,7 +713,7 @@ public class Player : Regist , IPointerClickHandler
         ManaPlayer.DressData[10] = RightLongSleeve;
         ManaPlayer.DressData[11] = RightShortSleeve;
 
-        GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SyncClose();
+        //GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SyncClose();
     }
 
     public void Reset()

+ 2 - 0
Assets/Script/Object/PlazaRoom.cs

@@ -8,5 +8,7 @@ public class PlazaRoom : MonoBehaviour, IPointerClickHandler
     public void OnPointerClick(PointerEventData eventData)
     {
         GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SelfInstance.MoveTo(eventData.pointerCurrentRaycast.worldPosition);
+
+        GardenSmartFoxManager.GardenSmartFox.ExtensionManager.PlazaRoomExtension.SendSynchronize(eventData.pointerCurrentRaycast.worldPosition);
     }
 }

+ 19 - 0
Assets/Script/SFS/CSharpExtension/DataParse.cs

@@ -10,6 +10,25 @@ public static class DataParse
         return new Color(float.Parse(strings[0]), float.Parse(strings[1]), float.Parse(strings[2]), float.Parse(strings[3]));
     }
 
+
+    public static string VectorToString(this Vector3 vector)
+    {
+        return $"{vector.x} {vector.y} {vector.z}";
+    }
+
+    public static Vector3 StringToVector(this string str)
+    {
+        string[] strings = str.Split(' ');
+        
+        return new Vector3(float.Parse(strings[0]), float.Parse(strings[1]), float.Parse(strings[2]));
+    }
+
+
+    public static string TransformToString(this Transform transform)
+    {
+        return $"{transform.position.x} {transform.position.y} {transform.position.z} {transform.eulerAngles.x} {transform.eulerAngles.y} {transform.eulerAngles.z}";
+    }
+
     public static Vector3[] StringToTransform(this string str)
     {
         string[] strings = str.Split(' ');

+ 0 - 5
Assets/Script/SFS/Command/Request.cs

@@ -1,5 +0,0 @@
-public enum Request
-{
-    SendPlazaRoomPublicMessage=0,
-    KeepAlive=1,
-}

+ 0 - 4
Assets/Script/SFS/Command/Response.cs

@@ -1,4 +0,0 @@
-public enum Response
-{
-    ReceivePlazaRoomPublicMessage = 0,
-}

+ 0 - 0
Assets/Script/SFS/Command.meta → Assets/Script/SFS/ID.meta


+ 6 - 0
Assets/Script/SFS/ID/CommandID.cs

@@ -0,0 +1,6 @@
+public enum CommandID
+{
+    KeepAlive = 0,
+    ReceivePublicMessage = 1,
+    Synchronize = 2,
+}

+ 2 - 2
Assets/Script/SFS/Command/Response.cs.meta → Assets/Script/SFS/ID/CommandID.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 1b213feed117bda468ab8882aab83a97
-timeCreated: 1505374881
+guid: 756a6b241f60ccf43b8e095fdf13f3f1
+timeCreated: 1506064923
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 7 - 0
Assets/Script/SFS/ID/DataID.cs

@@ -0,0 +1,7 @@
+public enum DataID
+{
+    SenderID = 0,
+    Message = 1,
+    JsonString = 2,
+    Destination = 3,
+}

+ 2 - 2
Assets/Script/SFS/Command/Request.cs.meta → Assets/Script/SFS/ID/DataID.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 87c69273b4c116745a1e62e505bd90eb
-timeCreated: 1505374889
+guid: 6d3f67d9896ba224dbcd44f48abfa65f
+timeCreated: 1506070985
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 1 - 1
Assets/Script/SFS/Manager/BaseLoggor.cs

@@ -45,7 +45,7 @@ public abstract class BaseLoggor
 
     public void OnLoginError(BaseEvent baseEvent)
     {
-        //PrintKeysAndValuesOfBaseEvent("OnLoginError", baseEvent);
+        DebugManager.PrintKeysAndValuesOfBaseEvent("OnLoginError", baseEvent);
 
         Debug.Log("Login has error");
 

+ 112 - 1
Assets/Script/SFS/Manager/GardenSmartFox.cs

@@ -1,8 +1,19 @@
 using System;
-
+using System.Collections.Generic;
+using System.Linq;
 using Sfs2X;
 using Sfs2X.Core;
 using Sfs2X.Entities;
+using Sfs2X.Entities.Data;
+using Sfs2X.Requests;
+using UnityEngine;
+
+public enum RequestType
+{
+    Batch,
+    BatchAndOverride,
+    Immediate,
+}
 
 public enum RequestStatus
 {
@@ -15,6 +26,12 @@ public class GardenSmartFox
 {
     #region Variable
 
+    public const string CommandRequestLabel = "0";
+    public const string CommandArrayLabel = "A";
+	public const string CommandLabel = "C";
+	public const string ParameterLabel = "P";
+	public const string TargetUserLabel = "U";
+
     public User User;
     public SmartFox SmartFox;
 
@@ -23,6 +40,11 @@ public class GardenSmartFox
     public SFSExtensionManager ExtensionManager;
     public PlazaRoomManager PlazaRoomManager;
 
+    public float RequestTime = 0.5f;
+    public float RequestTimer = 0f;
+    public List<SFSObject> BatchRequestList = new List<SFSObject>();
+    public Dictionary<string, SFSObject> BatchAndOverrideRequestDictionary = new Dictionary<string, SFSObject>();
+
     #endregion
 
     public GardenSmartFox(BaseLoggor baseLoggor, BaseConnector baseConnector)
@@ -79,6 +101,7 @@ public class GardenSmartFox
         }
     }
 
+
     public void Reset()
     {
         SmartFox = new SmartFox();
@@ -88,4 +111,92 @@ public class GardenSmartFox
         ExtensionManager = new SFSExtensionManager(this);
         PlazaRoomManager = new PlazaRoomManager(this);
     }
+
+    public void ProcessRequest()
+    {
+        RequestTimer += Time.deltaTime;
+
+        if (RequestTimer >= RequestTime)
+        {
+            RequestTimer = 0;
+
+            if (BatchRequestList.Count > 0 || BatchAndOverrideRequestDictionary.Count > 0)
+            {
+                BatchRequestList.AddRange(BatchAndOverrideRequestDictionary.Values.ToList());
+
+                SFSObject parameter = ConstructRequestParameter(BatchRequestList);
+
+                BatchRequestList = new List<SFSObject>();
+                BatchAndOverrideRequestDictionary = new Dictionary<string, SFSObject>();
+
+                SendRequest(parameter);
+            }
+        }
+    }
+
+    public void AddRequest(SFSObject sfsObject, RequestType requestType, string requestName = null)
+    {
+        if (requestType == RequestType.Immediate)
+        {
+            SFSObject parameter = ConstructRequestParameter(new List<SFSObject>() { sfsObject });
+
+            SendRequest(parameter);
+
+            Debug.Log("Send request immediately");
+        }
+        else if (requestType == RequestType.Batch)
+        {
+            BatchRequestList.Add(sfsObject);
+
+            Debug.Log("Add batch request");
+        }
+        else if (requestType == RequestType.BatchAndOverride)
+        {
+            Debug.Log("Override batch request");
+
+            if (BatchAndOverrideRequestDictionary.ContainsKey(requestName))
+            {
+                BatchAndOverrideRequestDictionary[requestName] = sfsObject;
+            }
+            else
+            {
+                BatchAndOverrideRequestDictionary.Add(requestName, sfsObject);
+            }
+        }
+        else
+        {
+            throw new Exception();
+        }
+    }
+
+    public void SendRequest(SFSObject parameter)
+    {
+        SmartFox.Send(new ExtensionRequest(CommandRequestLabel, parameter));
+    }
+
+    public static SFSObject ConstructRequestParameter(List<SFSObject> sfsObjects)
+    {
+        SFSObject parameter = new SFSObject();
+
+        SFSArray sfsArray = new SFSArray();
+        foreach (var sfsObject in sfsObjects)
+        {
+            sfsArray.AddSFSObject(sfsObject);
+        }
+
+        parameter.PutSFSArray(CommandArrayLabel, sfsArray);
+
+        return parameter;
+    }
+
+    public static SFSObject ConstructCommandParameter(int commandID, SFSObject sfsObject, int targetUserID)
+    {
+        SFSObject parameter = new SFSObject();
+
+        parameter.PutInt("C", commandID);
+        parameter.PutSFSObject("P", sfsObject);
+        parameter.PutInt("U", targetUserID);
+
+        return parameter;
+    }
 }

+ 7 - 3
Assets/Script/SFS/Manager/GardenSmartFoxManager.cs

@@ -1,5 +1,6 @@
 using System;
-
+using System.Collections.Generic;
+using Sfs2X.Requests;
 using UnityEngine;
 
 public class CounterAction
@@ -85,7 +86,7 @@ public class GardenSmartFoxManager : Regist
     #region Variable
 
     public static Transform PlazaRoom;
-    public static GardenSmartFox GardenSmartFox;
+    public static GardenSmartFox GardenSmartFox;    
 
     #endregion
 
@@ -117,9 +118,12 @@ public class GardenSmartFoxManager : Regist
             GardenSmartFox.Connector.Disconnect();
     }
 
+
     public void Update()
     {
         GardenSmartFox.SmartFox.ProcessEvents();
-        GardenSmartFox.PlazaRoomManager.Sync();
+        GardenSmartFox.PlazaRoomManager.Update();
+        
+        GardenSmartFox.ProcessRequest();
     }
 }

+ 43 - 127
Assets/Script/SFS/Manager/PlazaRoomManager.cs

@@ -1,9 +1,10 @@
 using UnityEngine;
 
 using System.Collections.Generic;
-
+using LitJson;
 using Sfs2X.Core;
 using Sfs2X.Entities;
+using Sfs2X.Entities.Data;
 using Sfs2X.Requests;
 using Sfs2X.Entities.Variables;
 
@@ -77,6 +78,7 @@ public class PlazaRoomManager
         get { return CurrentPlazaRoom != null; }
     }
 
+    public bool EnteringPlazaRoom;
     public bool IsBlackMaskFinish;
     public RequestStatus JoinRoomStatus;
 
@@ -87,6 +89,7 @@ public class PlazaRoomManager
     public void OnEnterPlazaButton()
     {
         IsBlackMaskFinish = false;
+        EnteringPlazaRoom = true;
 
         ManaCenter.SceneSwitchLock = true;
 
@@ -118,7 +121,7 @@ public class PlazaRoomManager
                     }
                     else
                     {
-                        GardenSmartFox.PlazaRoomManager.SyncClose();
+                        //GardenSmartFox.PlazaRoomManager.SyncClose();
                     }
                 }
             );
@@ -131,13 +134,22 @@ public class PlazaRoomManager
             return;
         }
 
+        if (!EnteringPlazaRoom)
+        {
+            return;
+        }
+
         if (GardenSmartFox.PlazaRoomManager.JoinRoomStatus == RequestStatus.Failed)
         {
             Bubble.Show(null, Language.GetStr("UI", "加入房间失败"), null, null, () => { ManaReso.Get("V_BlackMask").TweenForCG();},null,false);
+
+            EnteringPlazaRoom = false;
         }
         else if (GardenSmartFox.PlazaRoomManager.JoinRoomStatus == RequestStatus.Succeed)
         {
-            EnterPlazaRoom();   
+            EnterPlazaRoom();
+
+            EnteringPlazaRoom = false;
         }
     }
 
@@ -195,62 +207,15 @@ public class PlazaRoomManager
         GardenSmartFox.Connector.onConnectionLost += OnConectionLost;
     }
 
-    public void Sync()
+    public void Update()
     {
-        SyncCloseThread();
-
         if (!InPlazaRoom)
             return;
 
-        if (SelfInstance.Player.transform.hasChanged)
-            SyncTransform();
-
-        //if (CloseDirty)
-        //    SyncClose();
-
-        if (SelfInstance.Player.DirectionDirty)
-            SyncDirection();
-
-        if (SelfInstance.Player.AnimationDirty)
-            SyncAnimation();
-
         KeepAliveThread();
 
         CameraControllThread();
     }
-    public void SyncDirection()
-    {
-        List<UserVariable> userVariables = new List<UserVariable>();
-        userVariables.Add(new SFSUserVariable("direction", $"{SelfInstance.Player.PlayerDirection.ToString()}"));
-        GardenSmartFox.SmartFox.Send(new SetUserVariablesRequest(userVariables));
-        SelfInstance.Player.DirectionDirty = false;
-    }
-    public void SyncTransform()
-    {
-        List<UserVariable> userVariables = new List<UserVariable>();
-        userVariables.Add(new SFSUserVariable("transform", $"{SelfInstance.Player.transform.position.x} {SelfInstance.Player.transform.position.y} {SelfInstance.Player.transform.position.z} {SelfInstance.Player.transform.eulerAngles.x} {SelfInstance.Player.transform.eulerAngles.y} {SelfInstance.Player.transform.eulerAngles.z}"));
-        GardenSmartFox.SmartFox.Send(new SetUserVariablesRequest(userVariables));
-        SelfInstance.Player.transform.hasChanged = false;
-    }
-    public void SyncAnimation()
-    {
-        List<UserVariable> userVariables = new List<UserVariable>();
-        userVariables.Add(new SFSUserVariable("animation", $"{SelfInstance.Player.CurrentAnimationName}"));
-        GardenSmartFox.SmartFox.Send(new SetUserVariablesRequest(userVariables));
-        SelfInstance.Player.AnimationDirty = false;
-    }
-
-    public bool CloseDirty;
-    public void SyncClose()
-    {
-        if (ManaPlayer.Player == null)
-            return;
-
-        List<UserVariable> userVariables = new List<UserVariable>();
-        userVariables.Add(new SFSUserVariable("dressData", $"{ManaPlayer.Player.Head} {ManaPlayer.Player.Dress} {ManaPlayer.Player.Shoe} {ManaPlayer.Player.HeadWear} {ManaPlayer.Player.Top} {ManaPlayer.Player.Eye} {ManaPlayer.Player.Mouse} {ManaPlayer.Player.Wing} {ManaPlayer.Player.LeftLongSleeve} {ManaPlayer.Player.LeftShortSleeve} {ManaPlayer.Player.RightLongSleeve} {ManaPlayer.Player.RightShortSleeve}"));
-        GardenSmartFox.SmartFox.Send(new SetUserVariablesRequest(userVariables));
-        CloseDirty = false;
-    }
 
     public float KeepAliveTime = 30;
     public float KeepAliveTimer;
@@ -262,21 +227,7 @@ public class PlazaRoomManager
         {
             KeepAliveTimer = 0;
 
-            GardenSmartFox.ExtensionManager.BaseSFSExtension.SendRequest(Request.KeepAlive.GetHashCode());
-        }
-    }
-
-    public float SyncCloseTime = 10;
-    public float SyncCloseTimer;
-    public void SyncCloseThread()
-    {
-        SyncCloseTimer += Time.deltaTime;
-
-        if (SyncCloseTimer > SyncCloseTime)
-        {
-            SyncCloseTimer = 0;
-
-            GardenSmartFox.PlazaRoomManager.SyncClose();
+            GardenSmartFox.AddRequest(GardenSmartFox.ConstructCommandParameter(CommandID.KeepAlive.GetHashCode(), new SFSObject(), 0), RequestType.Immediate);
         }
     }
 
@@ -309,42 +260,12 @@ public class PlazaRoomManager
         PlazaRoomCamera.transform.SetX(x);
     }
 
-    public void ChangeUserClose(User user, List<string> dressData)
-    {
-        ManaPlayer.BuildPlayer(dressData, UserInstanceDictionary[user].Player);
-    }
-
-    public void ChangeUserDirection(User user, PlayerDirection direction)
-    {
-        UserInstanceDictionary[user].Player.Flip(direction);
-    }
-
-    public void ChangeUserTransform(User user, Vector3 position, Vector3 eulerAngles)
-    {
-        Player player = UserInstanceDictionary[user].Player;
-
-        TweenRoot tweenPosition = player.CreateTweenVec3D(position, 0.1f, false, true, true, Curve.Linear);
-        TweenRoot tweenEuler = player.CreateTweenEuler(eulerAngles, 0.1f, false, true, true, Curve.Linear);
-
-        tweenPosition.StartForward();
-        tweenEuler.StartForward();
-
-        UserInstanceDictionary[user].TweenRoots.Add(tweenPosition);
-        UserInstanceDictionary[user].TweenRoots.Add(tweenEuler);
-
-        //UserInstanceDictionary[user].transform.position = position;
-        //UserInstanceDictionary[user].transform.eulerAngles = eulerAngles;
-    }
-
-    public void ChangeUserAnimation(User user, string animationName)
-    {
-        UserInstanceDictionary[user].Player.PlayAnim(animationName);
-    }
-
-
     public void OnConectionLost(BaseEvent baseEvent)
     {
-        OnExitPlazaRoom();
+        if (InPlazaRoom)
+        {
+            OnExitPlazaRoom();
+        }
     }
 
 
@@ -392,39 +313,34 @@ public class PlazaRoomManager
     }
 
 
-    public void OnUserVariablesUpdate(User user, List<string> changeVars)
+    public void Synchronize(JsonData jsonData, User sender)
     {
-        if (!user.IsItMe)
+        if (sender.IsItMe)
+            return;
+
+        if (jsonData.Inst_Object.ContainsKey(DataID.Destination.GetHashCode().ToString()))
         {
-            for (int i = 0; i < changeVars.Count; i++)
-            {
-                if (changeVars[i] == "transform")
-                {
-                    Vector3[] vectors = (user.GetVariable(changeVars[i]).Value as string).StringToTransform();
+            Vector3 destination = jsonData[DataID.Destination.GetHashCode().ToString()].ToString().StringToVector();
 
-                    Vector3 position = vectors[0];
-                    Vector3 eulerAngles = vectors[1];
+            SynchronizeDestination(destination, sender);
+        }
 
-                    ChangeUserTransform(user, position, eulerAngles);
-                }
-                else if (changeVars[i] == "dressData")
-                {
-                    List<string> dressData = ManaData.GetDressData(user);
+        //Debug.LogWarning(sender.IsItMe + " : " + jsonData.ToJson());
+    }
 
-                    ChangeUserClose(user, dressData);
-                }
-                else if (changeVars[i] == "direction")
-                {
-                    PlayerDirection playerDirection = (user.GetVariable(changeVars[i]).Value as string).ToEnum<PlayerDirection>();
+    public void SynchronizeClose()
+    {
 
-                    ChangeUserDirection(user, playerDirection);
-                }
-                else if (changeVars[i] == "animation")
-                {
-                    ChangeUserAnimation(user, user.GetVariable(changeVars[i]).Value as string);
-                }
-            }
-        }
+    }
+
+    public void SynchronizeDestination(Vector3 destination, User sender)
+    {
+        Debug.Log(destination);
+    }
+
+    public void ReceivePublicMessage(string message, User sender)
+    {
+        Debug.LogWarning(sender.IsItMe + " : " + message);
     }
 
 

+ 1 - 50
Assets/Script/SFS/SFSExtension/BaseSFSExtension.cs

@@ -21,8 +21,6 @@ public class BaseSFSExtension
         
         GardenSmartFox.SmartFox.AddEventListener(SFSEvent.EXTENSION_RESPONSE, OnExtensionResponse);
 
-        GardenSmartFox.SmartFox.AddEventListener(SFSEvent.USER_VARIABLES_UPDATE, OnUserVariablesUpdate);
-
         GardenSmartFox.SmartFox.AddEventListener(SFSEvent.ROOM_JOIN, OnRoomJoin);
         GardenSmartFox.SmartFox.AddEventListener(SFSEvent.ROOM_JOIN_ERROR, OnRoomJoinError);
         GardenSmartFox.SmartFox.AddEventListener(SFSEvent.USER_ENTER_ROOM, OnUserEnterRoom);
@@ -52,7 +50,7 @@ public class BaseSFSExtension
     {
         for (int i = 0; i < Instances.Count; i++)
         {
-            Action<BaseEvent> method = (Action<BaseEvent>)Delegate.CreateDelegate(typeof(Action<BaseEvent>), Instances[i], Enum.GetName(typeof(Response), requestID), false, false);
+            Action<BaseEvent> method = (Action<BaseEvent>)Delegate.CreateDelegate(typeof(Action<BaseEvent>), Instances[i], Enum.GetName(typeof(CommandID), requestID), false, false);
 
             if (method != null)
                 return method;
@@ -62,21 +60,6 @@ public class BaseSFSExtension
     }
 
 
-    public void OnUserVariablesUpdate(BaseEvent baseEvent)
-    {
-        //DebugManager.PrintKeysAndValuesOfBaseEvent("OnUserVariablesUpdate", baseEvent);
-
-        User user = (User)baseEvent.Params["user"];
-
-        if (GardenSmartFox.PlazaRoomManager.CurrentPlazaRoom != null && GardenSmartFox.PlazaRoomManager.CurrentPlazaRoom.UserList.Contains(user))
-        {
-            List<string> changedVars = (List<string>)baseEvent.Params["changedVars"];
-
-            GardenSmartFox.PlazaRoomManager.OnUserVariablesUpdate(user, changedVars);
-        }
-    }
-
-
     public void OnRoomJoin(BaseEvent baseEvent)
     {
         //DebugManager.PrintKeysAndValuesOfBaseEvent("OnRoomJoin", baseEvent);
@@ -119,36 +102,4 @@ public class BaseSFSExtension
             GardenSmartFox.ExtensionManager.PlazaRoomExtension.OnUserEnterPlazaRoom(room, user);
         }
     }
-
-
-    public void SendRequest(int requestID, SFSObject parameter)
-    {
-        GardenSmartFox.SmartFox.Send(new ExtensionRequest(requestID.ToString(), parameter));
-
-        Debug.Log("Send request : " + Enum.GetName(typeof(Request), requestID));
-    }
-
-    public void SendRequest(string requestID, SFSObject parameter)
-    {
-        SendRequest(int.Parse(requestID), parameter);
-    }
-
-    public void SendRequest(int requestID, params Action<SFSObject>[] paramsConstructors)
-    {
-        SFSObject Params = new SFSObject();
-
-        for (int i = 0; i < paramsConstructors.Length; i++)
-        {
-            paramsConstructors[i].Invoke(Params);
-        }
-
-        GardenSmartFox.SmartFox.Send(new ExtensionRequest(requestID.ToString(), Params));
-
-        Debug.Log("Send request : " + Enum.GetName(typeof(Request), requestID));
-    }
-
-    public void SendRequest(string requestID, params Action<SFSObject>[] paramsConstructors)
-    {
-        SendRequest(int.Parse(requestID), paramsConstructors);
-    }
 }

+ 41 - 16
Assets/Script/SFS/SFSExtension/PlazaRoomExtension.cs

@@ -2,7 +2,7 @@
 
 using System;
 using System.Collections.Generic;
-
+using LitJson;
 using Sfs2X.Core;
 using Sfs2X.Entities;
 using Sfs2X.Requests;
@@ -61,44 +61,69 @@ public class PlazaRoomExtension
 
     private void CreateAndJoinPlazaRoom(int index)
     {
-        //Debug.Log("A");
-        //Room room = new SFSRoom(999, "123");
-        //BaseSFSExtension.GardenSmartFox.SmartFox.Send(new JoinRoomRequest(room));
-
-        //return;
         string roomName = BasePlazaRoomName + index;
 
         RoomSettings roomSettings = new RoomSettings(roomName);
         roomSettings.GroupId = PlazaRoomGroupID;
         roomSettings.MaxUsers = PlazaRoomCapacity;
-        roomSettings.MaxVariables = 30;
 
         BaseSFSExtension.GardenSmartFox.SmartFox.Send(new CreateRoomRequest(roomSettings, true));
     }
 
 
+    public void SendSynchronize(Vector3 destination)
+    {
+        JsonData jsonData = new JsonData();
+        jsonData[DataID.Destination.GetHashCode().ToString()] = destination.VectorToString();
+        
+        SFSObject sfsObject = new SFSObject();
+        sfsObject.PutInt(DataID.SenderID.GetHashCode().ToString(), BaseSFSExtension.GardenSmartFox.User.Id);
+        sfsObject.PutText(DataID.JsonString.GetHashCode().ToString(), jsonData.ToJson());
+
+        SFSObject parameter = GardenSmartFox.ConstructCommandParameter(CommandID.Synchronize.GetHashCode(), sfsObject, -1);
+
+        BaseSFSExtension.GardenSmartFox.AddRequest(parameter, RequestType.BatchAndOverride, CommandID.Synchronize.ToString());
+    }
+
     public void SendPublicMessage(string message)
     {
-        SFSObject parameter = new SFSObject();
+        SFSObject sfsObject = new SFSObject();
+        sfsObject.PutInt(DataID.SenderID.GetHashCode().ToString(), BaseSFSExtension.GardenSmartFox.User.Id);
+        sfsObject.PutText(DataID.Message.GetHashCode().ToString(), message);
+
+        SFSObject parameter = GardenSmartFox.ConstructCommandParameter(CommandID.ReceivePublicMessage.GetHashCode(), sfsObject, -1);
 
-        parameter.PutInt("RoomID", CurrentPlazaRoom.Id);
-        parameter.PutText("Message", message);
+        BaseSFSExtension.GardenSmartFox.AddRequest(parameter, RequestType.Immediate);
+    }
+
+
+    public void Synchronize(BaseEvent baseEvent)
+    {
+        //DebugManager.PrintKeysAndValuesOfBaseEvent("Synchronize", baseEvent);
+
+        SFSObject parameter = (SFSObject)baseEvent.Params["params"];
         
-        BaseSFSExtension.SendRequest(Request.SendPlazaRoomPublicMessage.GetHashCode(), parameter);
+        int senderID = parameter.GetInt(DataID.SenderID.GetHashCode().ToString());
+        string jsonString = parameter.GetText(DataID.JsonString.GetHashCode().ToString());
+
+        User sender = CurrentPlazaRoom.GetUserById(senderID);
+        JsonData jsonData = JsonMapper.ToObject(jsonString);
+
+        BaseSFSExtension.GardenSmartFox.PlazaRoomManager.Synchronize(jsonData, sender);
     }
 
-    public void ReceivePlazaRoomPublicMessage(BaseEvent baseEvent)
+    public void ReceivePublicMessage(BaseEvent baseEvent)
     {
         //DebugManager.PrintKeysAndValuesOfBaseEvent("ReceivePlazaRoomPublicMessage", baseEvent);
 
-        SFSObject parameter = (SFSObject) baseEvent.Params["params"];
+        SFSObject parameter = (SFSObject)baseEvent.Params["params"];
 
-        int senderID = parameter.GetInt("SenderID");
-        string message = parameter.GetText("Message");
+        int senderID = parameter.GetInt(DataID.SenderID.GetHashCode().ToString());
+        string message = parameter.GetText(DataID.Message.GetHashCode().ToString());
 
         User sender = CurrentPlazaRoom.GetUserById(senderID);
 
-        Debug.LogWarning(sender.IsItMe + " : " + message);
+        BaseSFSExtension.GardenSmartFox.PlazaRoomManager.ReceivePublicMessage(message, sender);
     }
 
 

+ 5 - 1
Assets/Script/Tool/Auxiliary.cs

@@ -19,13 +19,15 @@ using System.Text;
 using System.Collections;
 using System.Diagnostics;
 using System.Collections.Generic;
+using System.ComponentModel.Design;
 using System.Security.Cryptography;
 using System.Runtime.Serialization.Formatters.Binary;
 
 using System.Security;
 using System.Text.RegularExpressions;
 using System.Security.Cryptography.Xml;
-
+using Sfs2X.Entities.Data;
+using Sfs2X.Requests;
 using Debug = UnityEngine.Debug;
 using Random = UnityEngine.Random;
 using Transform = UnityEngine.Transform;
@@ -158,6 +160,8 @@ public class Auxiliary : Regist
 
         if (Input.GetKeyDown(KeyCode.X))
         {
+            GardenSmartFoxManager.GardenSmartFox.ExtensionManager.PlazaRoomExtension.SendSynchronize(new Vector3(1, 2, 3));
+
             //ManaPlayer.Player.PlayAnim("newAnimation");
 
             //StartCoroutine(ManaServer.DownloadAllAsset(new List<string>() { "http://or5zgoeui.bkt.clouddn.com/game_icon.png", "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3853411417,2245648913&fm=26&gp=0.jpg" }, ManaServer.DownloadAllTexture));

+ 18 - 5
ToDoList.txt → 第三期.txt

@@ -1,3 +1,20 @@
+同步位置
+
+同步动画
+
+同步方向
+
+同步服装(SyncClose)
+
+位置和服装不能被覆盖
+
+增加玩家昵称
+
+增加消息
+
+换装同步
+
+
 SFS使用的随机用户名
 
 服务器新旧版存取档兼容
@@ -7,8 +24,6 @@ SFS使
 在别人花园点击访问时红色桃心马上被刷白了
 
 
-有时拉取评论会报错?
-
 DressRoom被Destroy?
 
 第二期合并到第三期的时候会出现遮罩Bug?
@@ -29,8 +44,6 @@ DressRoom
 IOS设置Team
 
 
-广场背景图片 宝箱 评论 点赞 公告 截图按钮 上衣按钮需要打入图集
-
-Drawcall优化
+Drawcall优化(广场背景图片 宝箱 评论 点赞 公告 截图按钮 上衣按钮需要打入图集)
 
 图片尺寸优化(人物 广场背景 新Logo)