tanghai 12 лет назад
Родитель
Сommit
7db2082308
2 измененных файлов с 22 добавлено и 12 удалено
  1. 20 1
      CSharp/App/BossBase/Messages.cs
  2. 2 11
      CSharp/App/BossClient/RealmSession.cs

+ 20 - 1
CSharp/App/BossBase/Messages.cs

@@ -173,11 +173,30 @@ namespace BossBase
 		public float CityLoad { get; set; }
 	}
 
+	[DataContract]
+	public class Realm_List_City
+	{
+		[DataMember(Order = 1, IsRequired = true)]
+		public string Name { get; set; } 
+
+		[DataMember(Order = 2, IsRequired = true)]
+		public float CityLoad { get; set; } 
+
+		[DataMember(Order = 3, IsRequired = true)]
+		public bool IsEnable { get; set; } 
+	}
+
 	[DataContract]
 	public class SMSG_Realm_List
 	{
 		[DataMember(Order = 1, IsRequired = true)]
-		public List<Realm_List_Gate> GateList { get; set; } 
+		public string GateIP { get; set; } 
+
+		[DataMember(Order = 2, IsRequired = true)]
+		public int GatePort { get; set; } 
+
+		[DataMember(Order = 3, IsRequired = true)]
+		public List<Realm_List_City> GateList { get; set; } 
 	}
 
 	[DataContract]

+ 2 - 11
CSharp/App/BossClient/RealmSession.cs

@@ -182,17 +182,8 @@ namespace BossClient
 
 			Logger.Trace("session: {0}, SMSG_Realm_List OK", this.ID);
 
-			string address = smsgRealmList.GateList[0].Address.ToStr();
-			string[] split = address.Split(new[] { ':' });
-
-			if (split.Length != 2)
-			{
-				throw new BossException(
-					string.Format("session: {0}, gate address error, address: {1}",
-					this.ID, address));
-			}
-			string gateIP = split[0];
-			ushort gatePort = UInt16.Parse(split[1]);
+			string gateIP = smsgRealmList.GateIP;
+			ushort gatePort = (ushort)smsgRealmList.GatePort;
 			return Tuple.Create(gateIP, gatePort, srp6Client);
 		}
 	}