public override void OnServerInfo(CServerInfo serverInfo) { // サーバ情報保持 this.serverInfo.ServerInfo = serverInfo; //ConsoleWrite("OnServerInfo: Debug level = " + fDebugLevel); }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { this.cboPlayerList.BeginUpdate(); int iTotalTeams = this.m_prcClient.GetLocalizedTeamNameCount(csiServerInfo.Map, csiServerInfo.GameMode); this.m_strCurrentMapFileName = csiServerInfo.Map; // Add all the teams. for (int i = 1; i < iTotalTeams; i++) { int iTeamIndex = -1; if ((iTeamIndex = this.ListContainsTeam(i)) == -1) { this.cboPlayerList.Items.Insert(1, new CPlayerInfo(this.m_prcClient.GetLocalizedTeamName(i, csiServerInfo.Map, csiServerInfo.GameMode), String.Empty, i, -10)); } else if (iTeamIndex >= 0 && iTeamIndex < this.cboPlayerList.Items.Count) { this.cboPlayerList.Items[iTeamIndex] = new CPlayerInfo(this.m_prcClient.GetLocalizedTeamName(i, csiServerInfo.Map, csiServerInfo.GameMode), String.Empty, i, -10); } } // Remove any excess teams (change gamemode) for (int i = 0; i < this.cboPlayerList.Items.Count; i++) { if (((CPlayerInfo)cboPlayerList.Items[i]).SquadID == -10 && ((CPlayerInfo)cboPlayerList.Items[i]).TeamID > iTotalTeams) { cboPlayerList.Items.RemoveAt(i); i--; } } this.cboPlayerList.EndUpdate(); }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { if (csiServerInfo.MaxPlayerCount > 0 && csiServerInfo.MaxPlayerCount <= this.numSettingsPlayerLimit.Maximum) { this.numSettingsPlayerLimit.Value = (decimal)csiServerInfo.MaxPlayerCount; } }
public async Task RefreshServerInfo() { var call = await Manager.AsyncSendCall(GbxParam.Create("GetMainServerPlayerInfo")); var hash = (Dictionary <string, object>)call.Parameters[0]; ServerInfo = new CServerInfo(); ServerInfo.Login = (string)hash["Login"]; if (CManiaNextControl.XmlRPC_Clients.ContainsValue(this)) { var keys = new List <string>(); foreach (var kvp in CManiaNextControl.XmlRPC_Clients) { if (ServerInfo.Login == kvp.Key && this != kvp.Value) { CManiaNextControl.XmlRPC_Clients[kvp.Key] = this; } else if (kvp.Key != ServerInfo.Login && this == kvp.Value) { keys.Add(kvp.Key); } } for (int i = 0; i < keys.Count; i++) { CManiaNextControl.XmlRPC_Clients.Remove(keys[i]); } CManiaNextControl.XmlRPC_Clients[ServerInfo.Login] = this; } }
protected override void DispatchServerInfoResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) { if (this.ServerInfo != null) { CServerInfo newServerInfo = new CServerInfo( new List <string>() { "ServerName", "PlayerCount", "MaxPlayerCount", "GameMode", "Map", "CurrentRound", "TotalRounds", "TeamScores", "ConnectionState", "Ranked", "PunkBuster", "Passworded", "ServerUptime", "RoundTime", "GameMod", // Note: if another variable is affixed to both games this method "Mappack", // will need to be split into MoHClient and BFBC2Client. "ExternalGameIpandPort", // "PunkBusterVersion", //"JoinQueueEnabled", //"ServerRegion" }, cpRecievedPacket.Words.GetRange(1, cpRecievedPacket.Words.Count - 1) ); FrostbiteConnection.RaiseEvent(this.ServerInfo.GetInvocationList(), this, newServerInfo); } }
public override void OnServerInfo(CServerInfo serverInfo) { this.csiServerInfo = serverInfo; if (!this.blStartupTests) { this.blStartupTests = true; if (this.csiServerInfo.ExternalGameIpandPort != null && this.csiServerInfo.ExternalGameIpandPort.CompareTo(String.Empty) != 0) { String[] ipPort = this.csiServerInfo.ExternalGameIpandPort.Split(':'); this.strGameserverIP = ipPort[0]; if (this.ebDebugMessages == enumBoolYesNo.Yes) { this.PluginConsoleWrite("Plugin seems to be running on a Procon Layer. Assuming " + this.strGameserverIP + " is your gameserver's IP/Hostname."); } } else { this.strGameserverIP = this.strHostName; if (this.ebDebugMessages == enumBoolYesNo.Yes) { this.PluginConsoleWrite("Plugin seems to be connected to a gameserver directly. Assuming " + this.strGameserverIP + " is your gameserver's IP/Hostname."); } } } }
//Special public override void OnServerInfo(CServerInfo csiServerInfo) { playerCount = csiServerInfo.PlayerCount; currentMap = csiServerInfo.Map; currentGM = csiServerInfo.GameMode; currentRT = csiServerInfo.RoundTime; serverUT = csiServerInfo.ServerUptime; toConsole(3, "Server Info Report: " + playerCount + " playing " + currentMap + " on " + currentGM + " with roundtime " + currentRT + ". Server uptime is " + serverUT); }
internal ServerInfo(CServerInfo serverInfo, CNetLayer netLayer) { this.serverInfo = serverInfo; this.netLayer = netLayer; PlayOptions = new PlayOptions(serverInfo.m_PlayOptions); PersistentWorldOptions = new PersistentWorldOptions(serverInfo.m_PersistantWorldOptions); JoiningRestrictions = new JoiningRestrictions(serverInfo.m_JoiningRestrictions); DebugOptions = new DebugOptions(); }
private void Game_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { if (this.cboServerList.SelectedItem is uscServerConnection) { if (((uscServerConnection)this.cboServerList.SelectedItem).Client.Game == sender) { this.cboServerList.ComboBox.Refresh(); } } }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { if (csiServerInfo.MaxPlayerCount > 0 && csiServerInfo.MaxPlayerCount <= this.numSettingsPlayerLimit.Maximum) { this.numSettingsPlayerLimit.Value = (decimal)csiServerInfo.MaxPlayerCount; } this.chkSettingsPunkbuster.Checked = csiServerInfo.PunkBuster; this.chkSettingsRanked.Checked = csiServerInfo.Ranked; }
public override void OnServerInfo(CServerInfo serverInfo) { if (serverInfo.PlayerCount >= this.intPlayerLimit) { this.boolPlayerLimitReached = true; } else { this.boolPlayerLimitReached = false; } }
public override void OnServerInfo(CServerInfo serverInfo) { if (bf4db_IsValid == true) { this.bf4db_currentMap = serverInfo.Map; ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state) { threadServerUpdate(); }), null); } }
public override void OnServerInfo(CServerInfo serverInfo) { List <ELO> ELOObjects = ELOList.Values.ToList(); ELOObjects.Sort(); StringBuilder s = new StringBuilder($"\n^4---Top {TopNRanks} ELO Rank---^0\n"); for (int i = 0, rank = 1; i < TopNRanks; i++) { ELO player = ELOObjects[i]; s.AppendLine($"#{rank++} {player.Name} --> {player.Rating}".PadRight(75) + $"KD({player.Kills}/{player.Deaths}) |{ player.KDR.ToString("F2")}|"); } ConsoleWrite(s.ToString()); }
public override void OnServerInfo(CServerInfo serverInfo) { playerCount = serverInfo.PlayerCount; maxPlayerCount = serverInfo.MaxPlayerCount; if (isPluginEnabled) { if (playerCount >= disable_spectators_PlayerCount) { DisableSpectators(); } if (playerCount <= enable_spectators_PlayerCount) { EnableSpectators(); } } }
public void OnServerInfo(CServerInfo csiServerInfo) { this.m_csiLatestServerInfo = csiServerInfo; if (this.m_csiLatestServerInfo.CurrentRound == this.m_csiLatestServerInfo.TotalRounds) { if (this.m_blFinalRoundSet == false) { this.SetNextMap(); this.m_blFinalRoundSet = true; } } else { this.m_blFinalRoundSet = false; } }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { if (this.LoadedMapImagePack != null) { if (this.LoadedMapImagePack.LoadedMapFileName.Length == 0 && String.Compare(this.LoadedMapImagePack.LoadedMapFileName, csiServerInfo.Map, true) != 0) { // Load new map. //this.CurrentMapFilename = csiServerInfo.Map.ToLower(); if (this.LoadedMapImagePack != null) { this.LoadedMapImagePack.LoadMap(csiServerInfo.Map.ToLower(), this.FullyLoadMap); this.MapLoaded(csiServerInfo.Map.ToLower()); } } } //this.CurrentMapFilename = csiServerInfo.Map.ToLower(); }
public override void OnServerInfo(CServerInfo serverInfo) { //ConsoleWrite("Debug level = " + fDebugLevel); if (this.isChangeServerNameSetting) { // 万が一サーバ名設定が空の場合は、デフォルトの名前にする if (String.IsNullOrEmpty(this.warmupModeServerNameSetting)) { this.warmupModeServerNameSetting = serverInfo.ServerName; } if (String.IsNullOrEmpty(this.fullModeServerNameSetting)) { this.fullModeServerNameSetting = serverInfo.ServerName; } /* * サーバ名の変更 */ if (serverInfo.PlayerCount < this.warmupModeBoundarySetting) { if (serverInfo.ServerName != this.warmupModeServerNameSetting) { // ウォーミングアップモード時のサーバ名に変更 SetServerName(this.warmupModeServerNameSetting); } } else if (serverInfo.PlayerCount > this.fullModeBoundarySetting) { if (serverInfo.ServerName != this.fullModeServerNameSetting) { // フルモード時のサーバ名に変更 SetServerName(this.fullModeServerNameSetting); } } } }
public override void OnServerInfo(CServerInfo serverInfo) { // サーバ上のプレイヤー数を保持 this.serverPlayerCount = serverInfo.PlayerCount; // サーバの最大人数を保持(コマンダーを除いた数) this.serverMaxPlayerCount = serverInfo.MaxPlayerCount; /* * サーバ名の変更 */ if (this.serverPlayerCount < this.limitEnabledPlayerNumSetting) { if (serverInfo.ServerName != this.limiterOffServerNameSetting) { // リミッターOFF時のサーバ名に変更 setServerName(this.limiterOffServerNameSetting); } // ゴミが残っている可能性があるのでクリアする if (kickTargetPlayer.Count != 0) { kickTargetPlayer.Clear(); } } else { // リミッターON時のサーバ名 //string newServerName = String.Format(this.limiterOnServerNameSetting, this.currentSkillLimit); string newServerName = String.Format(this.limiterOnServerNameSetting, this.currentRspmLimit); if (serverInfo.ServerName != newServerName) { // リミッターON時のサーバ名に変更 setServerName(newServerName); } } }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { this.m_currentMapFileName = csiServerInfo.Map; /* * if (this.LoadedMapImagePack != null) { * * if (this.LoadedMapImagePack.LoadedMapFileName.Length == 0 && String.Compare(this.LoadedMapImagePack.LoadedMapFileName, csiServerInfo.Map, true) != 0) { * // Load new map. * //this.CurrentMapFilename = csiServerInfo.Map.ToLower(); * * if (this.LoadedMapImagePack != null) { * this.LoadedMapImagePack.LoadMap(csiServerInfo.Map.ToLower()); * * if (this.MapLoaded != null) { * FrostbiteConnection.RaiseEvent(this.MapLoaded.GetInvocationList(), csiServerInfo.Map.ToLower()); * } * } * * } * } */ //this.CurrentMapFilename = csiServerInfo.Map.ToLower(); }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { CurrentMapFileName = csiServerInfo.Map; }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { InvokeOnAllEnabled("OnServerInfo", csiServerInfo); }
private void m_prcClient_Serverinfo_EndRound_Update(FrostbiteClient sender, CServerInfo csiServerInfo) { // int iTeams = this.m_prcClient.GetLocalizedTeamNameCount(this.m_prcClient.CurrentServerInfo.Map, this.m_prcClient.CurrentServerInfo.GameMode); this.cboEndRound.Items.Clear(); this.cboEndRound.Items.AddRange(new object[] { this.m_clocLanguage.GetDefaultLocalized("Select winning team to end round:", "uscPlayerListPanel.ctxPlayerOptions.EndRound.Label") }); this.cboEndRound.SelectedIndex = 0; for (int i = 1; i < iTeams; i++) { this.cboEndRound.Items.AddRange(new object[] { String.Format("{0} - {1}", this.m_clocLanguage.GetDefaultLocalized("Team " + i.ToString(), "uscPlayerListPanel.ctxPlayerOptions.EndRound.Team"+i.ToString()), this.m_prcClient.GetLocalizedTeamName(i, this.m_prcClient.CurrentServerInfo.Map, this.m_prcClient.CurrentServerInfo.GameMode) ) }); } Graphics cboEndRoundGrafphics = cboEndRound.CreateGraphics(); this.cboEndRound.Width = 18 + (int)cboEndRoundGrafphics.MeasureString(this.cboEndRound.Text, this.cboEndRound.Font).Width; }
protected void OnServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { GameMods oldGameMod = this.CurrentServerInfo != null ? this.CurrentServerInfo.GameMod : GameMods.None; if (this.CurrentServerInfo != null && oldGameMod != csiServerInfo.GameMod) { this.m_gameModModified = true; } else { this.m_gameModModified = false; } this.CurrentServerInfo = csiServerInfo; }
public override void OnServerInfo(CServerInfo serverInfo) { this.ServerData = serverInfo; }
private void InitialSetup() { if (Game != null) { IsLoadingSavingConnectionConfig = true; AssignEventHandlers(); // Assume full access until we're told otherwise. Layer.Initialize(Parent, this); // I may move these events to within Layer, depends on the end of the restructure. Layer.LayerStarted += Layer_LayerOnline; Layer.LayerShutdown += Layer_LayerOffline; Layer.AccountPrivileges.AccountPrivilegeAdded += new AccountPrivilegeDictionary.AccountPrivilegeAlteredHandler(AccountPrivileges_AccountPrivilegeAdded); Layer.AccountPrivileges.AccountPrivilegeRemoved += new AccountPrivilegeDictionary.AccountPrivilegeAlteredHandler(AccountPrivileges_AccountPrivilegeRemoved); foreach (AccountPrivilege apPriv in Layer.AccountPrivileges) { apPriv.AccountPrivilegesChanged += new AccountPrivilege.AccountPrivilegesChangedHandler(item_AccountPrivilegesChanged); } Privileges = new CPrivileges(CPrivileges.FullPrivilegesFlags); EventsLogging = new EventCaptures(this); Console = new ConnectionConsole(this); PunkbusterConsole = new PunkbusterConsole(this); ChatConsole = new ChatConsole(this); PluginConsole = new PluginConsole(this); MapGeometry = new MapGeometry(this); MapGeometry.MapZones.MapZoneAdded += new MapZoneDictionary.MapZoneAlteredHandler(MapZones_MapZoneAdded); MapGeometry.MapZones.MapZoneChanged += new MapZoneDictionary.MapZoneAlteredHandler(MapZones_MapZoneChanged); MapGeometry.MapZones.MapZoneRemoved += new MapZoneDictionary.MapZoneAlteredHandler(MapZones_MapZoneRemoved); if (CurrentServerInfo == null) { CurrentServerInfo = new CServerInfo(); } ListSettings = new ListsSettings(this); ServerSettings = new ServerSettings(this); PlayerListSettings = new PlayerListSettings(); PlayerList = new PlayerDictionary(); TeamNameList = new List<CTeamName>(); MapListPool = new NotificationList<CMap>(); ReservedSlotList = new NotificationList<string>(); SpectatorList = new NotificationList<string>(); Variables = new VariableDictionary(); SV_Variables = new VariableDictionary(); Reasons = new NotificationList<string>(); FullVanillaBanList = new List<CBanInfo>(); FullTextChatModerationList = new TextChatModerationDictionary(); Weapons = new WeaponDictionary(); Specializations = new SpecializationDictionary(); if (Regex.Match(HostName, @"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$").Success == true) { Variables.SetVariable("SERVER_COUNTRY", Parent.GetCountryName(HostName)); Variables.SetVariable("SERVER_COUNTRY_CODE", Parent.GetCountryCode(HostName)); } else { IPAddress ipServer = FrostbiteConnection.ResolveHostName(HostName); Variables.SetVariable("SERVER_COUNTRY", Parent.GetCountryName(ipServer.ToString())); Variables.SetVariable("SERVER_COUNTRY_CODE", Parent.GetCountryCode(ipServer.ToString())); } Console.Logging = Parent.OptionsSettings.ConsoleLogging; EventsLogging.Logging = Parent.OptionsSettings.EventsLogging; ChatConsole.Logging = Parent.OptionsSettings.ChatLogging; PluginConsole.Logging = Parent.OptionsSettings.PluginLogging; //this.m_blLoadingSavingConnectionConfig = true; if (CurrentServerInfo.GameMod == GameMods.None) { ExecuteConnectionConfig(Game.GameType + ".def", 0, null, false); } else { ExecuteConnectionConfig(Game.GameType + "." + CurrentServerInfo.GameMod + ".def", 0, null, false); } // load override global_vars.def ExecuteGlobalVarsConfig("global_vars.def", 0, null); ExecuteConnectionConfig("reasons.cfg", 0, null, false); lock (Parent) { if (Username.Length == 0 || Parent.OptionsSettings.LayerHideLocalPlugins == false) { CompilePlugins(Parent.OptionsSettings.PluginPermissions); } } string configDirectoryPath = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"), FileHostNamePort); string oldConfigFilePath = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"), string.Format("{0}.cfg", FileHostNamePort)); if (File.Exists(oldConfigFilePath) == false && Directory.Exists(configDirectoryPath) == true) { string[] pluginConfigPaths = Directory.GetFiles(configDirectoryPath, "*.cfg"); if (Parent.OptionsSettings.UsePluginOldStyleLoad == true) { foreach (string pluginConfigPath in pluginConfigPaths) { ExecuteConnectionConfig(pluginConfigPath, 0, null, false); } } BeginLoginSequence(); if (Parent.OptionsSettings.UsePluginOldStyleLoad == false) { foreach (string pluginConfigPath in pluginConfigPaths) { ExecuteConnectionConfig(pluginConfigPath, 0, null, true); } } IsLoadingSavingConnectionConfig = false; } else { if (Parent.OptionsSettings.UsePluginOldStyleLoad == true) { ExecuteConnectionConfig(FileHostNamePort + ".cfg", 0, null, false); } BeginLoginSequence(); if (Parent.OptionsSettings.UsePluginOldStyleLoad == false) { ExecuteConnectionConfig(FileHostNamePort + ".cfg", 0, null, true); } IsLoadingSavingConnectionConfig = false; SaveConnectionConfig(); try { if (Directory.Exists(configDirectoryPath) == true && File.Exists(Path.Combine(configDirectoryPath, string.Format("{0}.cfg", FileHostNamePort))) == true) { try { if (File.Exists(oldConfigFilePath) == true) { File.Delete(oldConfigFilePath); } } catch (Exception e) { FrostbiteConnection.LogError("RemoveOldConfig", String.Empty, e); } } } catch (Exception e) { FrostbiteConnection.LogError("MigrateConfig", "Error writing new config structure during migration", e); } } } }
private void SetServerInfoLabels(CServerInfo csiServerInfo) { //this.lblServerName.Text = String.Format("{0} [{1}]", csiServerInfo.ServerName, this.m_prcConnection.HostNamePort); this.uscAccounts.ServerName = csiServerInfo.ServerName; //this.lblCurrentMapName.Text = String.Format("{0} - {1}", this.m_prcConnection.GetFriendlyGamemode(csiServerInfo.GameMode), this.m_prcConnection.GetFriendlyMapname(csiServerInfo.Map)); // add enhanced detection CMap tmpMap = null; tmpMap = this.m_prcConnection.GetFriendlyMapByFilenamePlayList(csiServerInfo.Map, csiServerInfo.GameMode); this.lblCurrentMapName.Text = String.Format("{0} - {1}", tmpMap.GameMode, tmpMap.PublicLevelName); this.toolTipMapControls.SetToolTip(this.lblCurrentMapName, csiServerInfo.Map); if (this.Client.Game is BF3Client) { this.lblCurrentRound.Text = this.m_clocLanguage.GetLocalized("uscServerConnection.lblCurrentRound", (csiServerInfo.CurrentRound + 1).ToString(), csiServerInfo.TotalRounds.ToString()); } else { this.lblCurrentRound.Text = this.m_clocLanguage.GetLocalized("uscServerConnection.lblCurrentRound", csiServerInfo.CurrentRound.ToString(), csiServerInfo.TotalRounds.ToString()); } this.lblMappack.Text = this.m_clocLanguage.GetLocalized("uscServerConnection.lblMappack", csiServerInfo.Mappack.ToString()); if (csiServerInfo.ConnectionState.Length > 0) { this.lblPlasmaStatus.Text = this.m_clocLanguage.GetLocalized(String.Format("uscServerConnection.lblPlasmaStatus.{0}", csiServerInfo.ConnectionState)); // this.toolTipPlasma.SetToolTip(this.lblPlasmaStatus, this.m_clocLanguage.GetLocalized(String.Format("uscServerConnection.lblPlasmaStatus.{0}.ToolTip", csiServerInfo.ConnectionState))); // 
 or Environment.NewLine if (csiServerInfo.GameMod == GameMods.BC2 || csiServerInfo.GameMod == GameMods.VIETNAM) { this.toolTipPlasma.SetToolTip(this.lblPlasmaStatus, this.m_clocLanguage.GetLocalized(String.Format("uscServerConnection.lblPlasmaStatus.{0}.ToolTip", csiServerInfo.ConnectionState)) + Environment.NewLine + Environment.NewLine + this.m_clocLanguage.GetLocalized("uscServerConnection.extServerInfo.ExternalGameIpandPort.ToolTip") + "\t" + csiServerInfo.ExternalGameIpandPort + Environment.NewLine + this.m_clocLanguage.GetLocalized("uscServerConnection.extServerInfo.JoinQueueEnabled.ToolTip") + "\t" + this.m_clocLanguage.GetLocalized(String.Format("uscServerConnection.extServerInfo.JoinQueueEnabled.{0}.ToolTip", csiServerInfo.JoinQueueEnabled)) + Environment.NewLine + this.m_clocLanguage.GetLocalized("uscServerConnection.extServerInfo.ServerRegion.ToolTip") + "\t\t" + this.m_clocLanguage.GetLocalized(String.Format("uscServerConnection.extServerInfo.ServerRegion.{0}.ToolTip", csiServerInfo.ServerRegion)) + Environment.NewLine + this.m_clocLanguage.GetLocalized("uscServerConnection.extServerInfo.PunkBusterVersion.ToolTip") + "\t" + csiServerInfo.PunkBusterVersion + Environment.NewLine + Environment.NewLine ); } else { this.toolTipPlasma.SetToolTip(this.lblPlasmaStatus, this.m_clocLanguage.GetLocalized(String.Format("uscServerConnection.lblPlasmaStatus.{0}.ToolTip", csiServerInfo.ConnectionState))); } switch (csiServerInfo.ConnectionState) { case "NotConnected": this.lblPlasmaStatus.ForeColor = Color.Maroon; break; case "ConnectedToBackend": this.lblPlasmaStatus.ForeColor = Color.Gold; break; case "AcceptingPlayers": this.lblPlasmaStatus.ForeColor = Color.MediumSeaGreen; break; default: break; } } }
public virtual void OnServerInfo(CServerInfo serverInfo) { }
public override void OnServerInfo(CServerInfo serverInfo) { ConsoleWrite("Debug level = " + fDebugLevel); }
public void OnServerInfo(CServerInfo serverInfo) { playerCount = serverInfo.PlayerCount; }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { this.m_currentMapFileName = csiServerInfo.Map; /* if (this.LoadedMapImagePack != null) { if (this.LoadedMapImagePack.LoadedMapFileName.Length == 0 && String.Compare(this.LoadedMapImagePack.LoadedMapFileName, csiServerInfo.Map, true) != 0) { // Load new map. //this.CurrentMapFilename = csiServerInfo.Map.ToLower(); if (this.LoadedMapImagePack != null) { this.LoadedMapImagePack.LoadMap(csiServerInfo.Map.ToLower()); if (this.MapLoaded != null) { FrostbiteConnection.RaiseEvent(this.MapLoaded.GetInvocationList(), csiServerInfo.Map.ToLower()); } } } } */ //this.CurrentMapFilename = csiServerInfo.Map.ToLower(); }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { this.InvokeIfRequired(() => { if (csiServerInfo.MaxPlayerCount > 0 && csiServerInfo.MaxPlayerCount <= this.numSettingsPlayerLimit.Maximum) { this.numSettingsPlayerLimit.Value = (decimal) csiServerInfo.MaxPlayerCount; } }); }
// Query Events public void OnServerInfo(CServerInfo csiServerInfo) { }
private void InitialSetup() { if (Game != null) { IsLoadingSavingConnectionConfig = true; AssignEventHandlers(); // Assume full access until we're told otherwise. Layer.Initialize(Parent, this); // I may move these events to within Layer, depends on the end of the restructure. Layer.LayerOnline += new PRoConLayer.LayerEmptyParameterHandler(Layer_LayerOnline); Layer.LayerOffline += new PRoConLayer.LayerEmptyParameterHandler(Layer_LayerOffline); Layer.AccountPrivileges.AccountPrivilegeAdded += new AccountPrivilegeDictionary.AccountPrivilegeAlteredHandler(AccountPrivileges_AccountPrivilegeAdded); Layer.AccountPrivileges.AccountPrivilegeRemoved += new AccountPrivilegeDictionary.AccountPrivilegeAlteredHandler(AccountPrivileges_AccountPrivilegeRemoved); foreach (AccountPrivilege apPriv in Layer.AccountPrivileges) { apPriv.AccountPrivilegesChanged += new AccountPrivilege.AccountPrivilegesChangedHandler(item_AccountPrivilegesChanged); } Privileges = new CPrivileges(CPrivileges.FullPrivilegesFlags); EventsLogging = new EventCaptures(this); Console = new ConnectionConsole(this); PunkbusterConsole = new PunkbusterConsole(this); ChatConsole = new ChatConsole(this); PluginConsole = new PluginConsole(this); MapGeometry = new MapGeometry(this); MapGeometry.MapZones.MapZoneAdded += new MapZoneDictionary.MapZoneAlteredHandler(MapZones_MapZoneAdded); MapGeometry.MapZones.MapZoneChanged += new MapZoneDictionary.MapZoneAlteredHandler(MapZones_MapZoneChanged); MapGeometry.MapZones.MapZoneRemoved += new MapZoneDictionary.MapZoneAlteredHandler(MapZones_MapZoneRemoved); if (CurrentServerInfo == null) { CurrentServerInfo = new CServerInfo(); } ListSettings = new ListsSettings(this); ServerSettings = new ServerSettings(this); PlayerListSettings = new PlayerListSettings(); PlayerList = new PlayerDictionary(); TeamNameList = new List<CTeamName>(); MapListPool = new NotificationList<CMap>(); ReservedSlotList = new NotificationList<string>(); Variables = new VariableDictionary(); SV_Variables = new VariableDictionary(); Reasons = new NotificationList<string>(); FullVanillaBanList = new List<CBanInfo>(); FullTextChatModerationList = new TextChatModerationDictionary(); Weapons = new WeaponDictionary(); Specializations = new SpecializationDictionary(); if (Regex.Match(HostName, @"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$").Success == true) { Variables.SetVariable("SERVER_COUNTRY", Parent.GetCountryName(HostName)); Variables.SetVariable("SERVER_COUNTRY_CODE", Parent.GetCountryCode(HostName)); } else { IPAddress ipServer = FrostbiteConnection.ResolveHostName(HostName); Variables.SetVariable("SERVER_COUNTRY", Parent.GetCountryName(ipServer.ToString())); Variables.SetVariable("SERVER_COUNTRY_CODE", Parent.GetCountryCode(ipServer.ToString())); } Console.Logging = Parent.OptionsSettings.ConsoleLogging; EventsLogging.Logging = Parent.OptionsSettings.EventsLogging; ChatConsole.Logging = Parent.OptionsSettings.ChatLogging; PluginConsole.Logging = Parent.OptionsSettings.PluginLogging; //this.m_blLoadingSavingConnectionConfig = true; if (CurrentServerInfo.GameMod == GameMods.None) { ExecuteConnectionConfig(Game.GameType + ".def", 0, null, false); } else { ExecuteConnectionConfig(Game.GameType + "." + CurrentServerInfo.GameMod + ".def", 0, null, false); } // load override global_vars.def ExecuteGlobalVarsConfig("global_vars.def", 0, null); ExecuteConnectionConfig("reasons.cfg", 0, null, false); lock (Parent) { if (Username.Length == 0 || Parent.OptionsSettings.LayerHideLocalPlugins == false) { CompilePlugins(Parent.OptionsSettings.PluginPermissions); } } if (Parent.OptionsSettings.UsePluginOldStyleLoad == true) { ExecuteConnectionConfig(FileHostNamePort + ".cfg", 0, null, false); } //this.m_blLoadingSavingConnectionConfig = false; // this.ManuallyDisconnected = true; // this.ConnectionError = false; BeginLoginSequence(); if (Parent.OptionsSettings.UsePluginOldStyleLoad == false) { ExecuteConnectionConfig(FileHostNamePort + ".cfg", 0, null, true); } IsLoadingSavingConnectionConfig = false; } }
private void Game_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { this.UpdateConnections(); }
private void m_prcClient_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { if (csiServerInfo.MaxPlayerCount > 0 && csiServerInfo.MaxPlayerCount <= this.numSettingsPlayerLimit.Maximum) { //this.numSettingsPlayerLimit.Value = (decimal)csiServerInfo.MaxPlayerCount; this.numSettingsEffectivePlayerLimit.Value = (decimal)csiServerInfo.MaxPlayerCount; } this.chkSettingsPunkbuster.Checked = csiServerInfo.PunkBuster; //this.chkSettingsRanked.Checked = csiServerInfo.Ranked; }
protected override void DispatchServerInfoResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) { if (ServerInfo != null) { var newServerInfo = new CServerInfo(new List<string>() { "ServerName", "PlayerCount", "MaxPlayerCount", "GameMode", "Map", "CurrentRound", "TotalRounds", "TeamScores", "ConnectionState", "Ranked", "PunkBuster", "Passworded", "ServerUptime", "RoundTime", "ExternalGameIpandPort", "PunkBusterVersion", "JoinQueueEnabled", "ServerRegion", "PingSite", "ServerCountry", "BlazePlayerCount", "BlazeGameState" }, cpRecievedPacket.Words.GetRange(1, cpRecievedPacket.Words.Count - 1)); FrostbiteConnection.RaiseEvent(ServerInfo.GetInvocationList(), this, newServerInfo); } }
protected void OnServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { GameMods oldGameMod = CurrentServerInfo != null ? CurrentServerInfo.GameMod : GameMods.None; // Initial loading.. if (CurrentServerInfo == null) { CurrentServerInfo = csiServerInfo; InitialSetup(); if (GameTypeDiscovered != null) { this.GameTypeDiscovered(this); } } else if (CurrentServerInfo != null && oldGameMod != csiServerInfo.GameMod) { IsGameModModified = true; } else { IsGameModModified = false; } CurrentServerInfo = csiServerInfo; }
protected virtual void DispatchServerInfoResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) { if (ServerInfo != null) { var newServerInfo = new CServerInfo(new List<string>() { "ServerName", "PlayerCount", "MaxPlayerCount", "GameMode", "Map", "CurrentRound", "TotalRounds", "TeamScores", "ConnectionState", "Ranked", "PunkBuster", "Passworded", "ServerUptime", "RoundTime", "GameMod", // Note: if another variable is affixed to both games this method "Mappack", // will need to be split into MoHClient and BFBC2Client. "ExternalGameIpandPort", "PunkBusterVersion", "JoinQueueEnabled", "ServerRegion" }, cpRecievedPacket.Words.GetRange(1, cpRecievedPacket.Words.Count - 1)); this.ServerInfo(this, newServerInfo); } /* if (cpRequestPacket.Words.Count >= 1) { int iCurrentPlayers = 0, iMaxPlayers = 32, iCurrentRound = 0, iTotalRounds = 0, iTeamScoreScope = 0; string sConnectionState = String.Empty; List<TeamScore> lstTeamScores; // R17 if (cpRecievedPacket.Words.Count >= 11) { int.TryParse(cpRecievedPacket.Words[2], out iCurrentPlayers); int.TryParse(cpRecievedPacket.Words[3], out iMaxPlayers); int.TryParse(cpRecievedPacket.Words[6], out iCurrentRound); int.TryParse(cpRecievedPacket.Words[7], out iTotalRounds); if (int.TryParse(cpRecievedPacket.Words[8], out iTeamScoreScope) == true) { // include neutral iTeamScoreScope = iTeamScoreScope + 1; lstTeamScores = TeamScore.GetTeamScores(cpRecievedPacket.Words.GetRange(8, iTeamScoreScope)); } else { lstTeamScores = TeamScore.GetTeamScores(cpRecievedPacket.Words.GetRange(8, cpRecievedPacket.Words.Count - 8)); } if (8 + iTeamScoreScope <= cpRecievedPacket.Words.Count) { sConnectionState = cpRecievedPacket.Words[8 + iTeamScoreScope + 1]; } if (this.ServerInfo != null) { this.ServerInfo(this, new CServerInfo(cpRecievedPacket.Words[1], cpRecievedPacket.Words[5], cpRecievedPacket.Words[4], iCurrentPlayers, iMaxPlayers, iCurrentRound, iTotalRounds, lstTeamScores, sConnectionState)); } } } */ }
protected override void DispatchServerInfoResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) { if (this.ServerInfo != null) { CServerInfo newServerInfo = new CServerInfo( new List<string>() { "ServerName", "PlayerCount", "MaxPlayerCount", "GameMode", "Map", "CurrentRound", "TotalRounds", "TeamScores", "ConnectionState", "Ranked", "PunkBuster", "Passworded", "ServerUptime", "RoundTime", "GameMod", // Note: if another variable is affixed to both games this method // "Mappack", // will need to be split into MoHClient and BFBC2Client. // "ExternalGameIpandPort", "PunkBusterVersion", "Placeholder01", "ServerRegion", "PingSite", "ServerCountry", "JoinQueueEnabled" }, cpRecievedPacket.Words.GetRange(1, cpRecievedPacket.Words.Count - 1) ); FrostbiteConnection.RaiseEvent(this.ServerInfo.GetInvocationList(), this, newServerInfo); } }
public override void OnServerInfo(CServerInfo csiServerInfo) { this.m_strCurrentGameMode = csiServerInfo.GameMode; }
protected void OnServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { GameMods oldGameMod = this.CurrentServerInfo != null ? this.CurrentServerInfo.GameMod : GameMods.None; // Initial loading.. if (this.CurrentServerInfo == null) { this.CurrentServerInfo = csiServerInfo; this.InitialSetup(); if (this.GameTypeDiscovered != null) { FrostbiteConnection.RaiseEvent(this.GameTypeDiscovered.GetInvocationList(), this); } } else if (this.CurrentServerInfo != null && oldGameMod != csiServerInfo.GameMod) { this.m_gameModModified = true; } else { this.m_gameModModified = false; } this.CurrentServerInfo = csiServerInfo; }
private void m_prcConnection_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { this.SetServerInfoLabels(csiServerInfo); this.SetVersionInfoLabels(sender); }
public override void OnServerInfo(CServerInfo csiServerInfo) { this.playerCount = csiServerInfo.PlayerCount; }
private void Game_ServerInfo(FrostbiteClient sender, CServerInfo csiServerInfo) { this.InvokeIfRequired(() => { if (this.cboServerList.SelectedItem is uscServerConnection) { if (((uscServerConnection) this.cboServerList.SelectedItem).Client.Game == sender) { this.cboServerList.ComboBox.Refresh(); } } }); }