Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        private static ClusterInfo.Builder BuildCluster()
        {
            ClusterInfo.Builder cluster = ClusterInfo.CreateBuilder();
            cluster.SetClusterId(122)
            .SetClusterName("Cluster 1")
            .SetLobbyHost("127.0.0.1")
            .SetLobbyPort(10622)
            .SetLanguageId(0)
            .SetMaxClusterPop(500)
            .SetClusterPopStatus(ClusterPopStatus.POP_HIGH)
            .SetLanguageId(0)
            .SetClusterStatus(ClusterStatus.STATUS_ONLINE);

            cluster.AddServerList(
                ServerInfo.CreateBuilder().SetServerId(122)
                .SetServerName("Emulator")
                .Build());

            cluster.AddPropertyList(setProp("setting.allow_trials", "1"));
            cluster.AddPropertyList(setProp("setting.charxferavailable", "0"));
            cluster.AddPropertyList(setProp("setting.language", "EN"));
            cluster.AddPropertyList(setProp("setting.legacy", "0"));
            cluster.AddPropertyList(setProp("setting.manualbonus.realm.destruction", "100"));
            cluster.AddPropertyList(setProp("setting.manualbonus.realm.order", "100"));
            cluster.AddPropertyList(setProp("setting.min_cross_realm_account_level", "0"));
            cluster.AddPropertyList(setProp("setting.name", "Emulator"));
            cluster.AddPropertyList(setProp("setting.net.address", "127.0.0.1"));
            cluster.AddPropertyList(setProp("setting.net.port", "10622"));
            cluster.AddPropertyList(setProp("setting.redirect", "0"));
            cluster.AddPropertyList(setProp("setting.region", "STR_REGION_NORTHAMERICA"));
            cluster.AddPropertyList(setProp("setting.retired", "0"));
            cluster.AddPropertyList(setProp("status.queue.Destruction.waiting", "0"));
            cluster.AddPropertyList(setProp("status.queue.Order.waiting", "0"));
            cluster.AddPropertyList(setProp("status.realm.destruction.density", "1"));
            cluster.AddPropertyList(setProp("status.realm.order.density", "1"));
            cluster.AddPropertyList(setProp("status.servertype.openrvr", "0"));
            cluster.AddPropertyList(setProp("status.servertype.rp", "0"));
            cluster.AddPropertyList(setProp("status.status", "0"));

            cluster.Build();
            return(cluster);
        }