private void onGetClusterListReq(PacketIn packet) { PacketOut Out = new PacketOut((byte)Opcodes.SMSG_GetClusterListReply); GetClusterListReply.Builder ClusterListReplay = GetClusterListReply.CreateBuilder(); ClusterListReplay.ResultCode = ResultCode.RES_SUCCESS; ClusterListReplay.AddClusterList(BuildCluster()); byte[] cluster = ClusterListReplay.Build().ToByteArray(); Out.Write(cluster); SendTCPCuted(Out); }
public byte[] BuildClusterList() { GetClusterListReply.Builder ClusterListReplay = GetClusterListReply.CreateBuilder(); lock (_Realms) { Log.Info("BuildRealm", "Sending " + _Realms.Count + " realm(s)"); ClusterInfo.Builder cluster = ClusterInfo.CreateBuilder(); foreach (Realm Rm in _Realms.Values) { Log.Info("BuildRealm", "Realm : " + Rm.RealmId + " IP : " + Rm.Adresse + ":" + Rm.Port + " (" + Rm.Name + ")"); cluster.SetClusterId(Rm.RealmId) .SetClusterName(Rm.Name) .SetLobbyHost(Rm.Adresse) .SetLobbyPort((uint)Rm.Port) .SetLanguageId(0) .SetMaxClusterPop(500) .SetClusterPopStatus(ClusterPopStatus.POP_UNKNOWN) .SetClusterStatus(ClusterStatus.STATUS_ONLINE); cluster.AddServerList( ServerInfo.CreateBuilder().SetServerId(Rm.RealmId) .SetServerName(Rm.Name) .Build()); cluster.AddPropertyList(setProp("setting.allow_trials", Rm.AllowTrials)); cluster.AddPropertyList(setProp("setting.charxferavailable", Rm.CharfxerAvailable)); cluster.AddPropertyList(setProp("setting.language", Rm.Language)); cluster.AddPropertyList(setProp("setting.legacy", Rm.Legacy)); cluster.AddPropertyList(setProp("setting.manualbonus.realm.destruction", Rm.BonusDestruction)); cluster.AddPropertyList(setProp("setting.manualbonus.realm.order", Rm.BonusOrder)); cluster.AddPropertyList(setProp("setting.min_cross_realm_account_level", "0")); cluster.AddPropertyList(setProp("setting.name", Rm.Name)); cluster.AddPropertyList(setProp("setting.net.address", Rm.Adresse)); cluster.AddPropertyList(setProp("setting.net.port", Rm.Port.ToString())); cluster.AddPropertyList(setProp("setting.redirect", Rm.Redirect)); cluster.AddPropertyList(setProp("setting.region", Rm.Region)); cluster.AddPropertyList(setProp("setting.retired", Rm.Retired)); cluster.AddPropertyList(setProp("status.queue.Destruction.waiting", Rm.WaitingDestruction)); cluster.AddPropertyList(setProp("status.queue.Order.waiting", Rm.WaitingOrder)); cluster.AddPropertyList(setProp("status.realm.destruction.density", Rm.DensityDestruction)); cluster.AddPropertyList(setProp("status.realm.order.density", Rm.DensityOrder)); cluster.AddPropertyList(setProp("status.servertype.openrvr", Rm.OpenRvr)); cluster.AddPropertyList(setProp("status.servertype.rp", Rm.Rp)); cluster.AddPropertyList(setProp("status.status", Rm.Status)); cluster.Build(); ClusterListReplay.AddClusterList(cluster); } } ClusterListReplay.ResultCode = ResultCode.RES_SUCCESS; return(ClusterListReplay.Build().ToByteArray()); }