private IEnumerator Start() { PlayerPrefs.Save(); CoopTreeGrid.Init(); LoadSave.OnGameStart += this.OnGameStart; yield return(CoopPeerStarter.PrefabDbResource); if (!CoopPeerStarter.Dedicated) { CoopLobby.Instance.SetServer(SteamGameServer.GetSteamID()); } BoltConfig config = base.GetConfig(); config.serverConnectionLimit = ((!CoopPeerStarter.Dedicated) ? (CoopLobby.Instance.Info.MemberLimit - 1) : SteamDSConfig.ServerPlayers); if (CoopPeerStarter.Dedicated) { BoltLauncher.SetUdpPlatform(new DotNetPlatform()); BoltLauncher.StartServer(SteamDSConfig.EndPoint, config); } else { BoltLauncher.StartServer(SteamGameServer.GetSteamID().ToEndPoint(), config); } try { BoltNetwork.AddGlobalEventListener(CoopAckChecker.Instance); } catch { } yield break; }
private void Launch() { CoopSteamManager.Initialize(); CoopPeerStarter.Dedicated = true; CoopPeerStarter.DedicatedHost = true; CoopLobby.SetActive(new CoopLobbyInfo(SteamGameServer.GetSteamID()) { Name = SteamDSConfig.ServerName, Joinable = true, MemberLimit = SteamDSConfig.ServerPlayers }); if (GameSetup.IsSavedGame) { SaveSlotUtils.LoadHostGameGUID(); } if (string.IsNullOrEmpty(CoopLobby.Instance.Info.Guid) || GameSetup.IsNewGame) { CoopLobby.Instance.SetGuid(Guid.NewGuid().ToString()); } SteamDSConfig.ServerGUID = CoopLobby.Instance.Info.Guid; GameSetup.SetMpType(MpTypes.Server); GameSetup.SetPlayerMode(PlayerModes.Multiplayer); FMOD_StudioSystem.ForceFmodOff = true; GameObject gameObject = new GameObject("CoopSteamServerStarter"); CoopSteamServerStarter coopSteamServerStarter = gameObject.AddComponent <CoopSteamServerStarter>(); coopSteamServerStarter.mapState = CoopPeerStarter.MapState.None; coopSteamServerStarter._async = this.loadAsync; UnityEngine.Object.DontDestroyOnLoad(gameObject); }
public override void Execute(PointBlankPlayer executor, string[] args) { CommandWindow.Log(Translations["Debug_Title"]); CommandWindow.Log(string.Format(Translations["Debug_SteamID"], SteamGameServer.GetSteamID())); CommandWindow.Log(string.Format(Translations["Debug_IP"], Parser.getIPFromUInt32(SteamGameServer.GetPublicIP()))); CommandWindow.Log(string.Format(Translations["Debug_Port"], Provider.port)); CommandWindow.Log(string.Format(Translations["Debug_BytesSent"], Provider.bytesSent)); CommandWindow.Log(string.Format(Translations["Debug_BytesReceived"], Provider.bytesReceived)); CommandWindow.Log(string.Format(Translations["Debug_ABytesSent"], (uint)(Provider.bytesSent / Time.realtimeSinceStartup))); CommandWindow.Log(string.Format(Translations["Debug_ABytesReceived"], (uint)(Provider.bytesReceived / Time.realtimeSinceStartup))); CommandWindow.Log(string.Format(Translations["Debug_PacketsSent"], Provider.packetsSent)); CommandWindow.Log(string.Format(Translations["Debug_PacketsReceived"], Provider.packetsReceived)); CommandWindow.Log(string.Format(Translations["Debug_APacketsSent"], (uint)(Provider.packetsSent / Time.realtimeSinceStartup))); CommandWindow.Log(string.Format(Translations["Debug_APacketsReceived"], (uint)(Provider.packetsReceived / Time.realtimeSinceStartup))); CommandWindow.Log(string.Format(Translations["Debug_UPS"], Mathf.CeilToInt(Provider.debugUPS / 50f * 100f))); CommandWindow.Log(string.Format(Translations["Debug_TPS"], Mathf.CeilToInt((Provider.debugTPS / 50f * 100f)))); CommandWindow.Log(string.Format(Translations["Debug_Zombies"], ZombieManager.tickingZombies.Count)); CommandWindow.Log(string.Format(Translations["Debug_Animals"], AnimalManager.tickingAnimals.Count)); }
private void OnPolicyResponse(GSPolicyResponse_t pPolicyResponse) { if (SteamGameServer.BSecure()) { Debug.Log("SpaceWarServer is VAC Secure!"); } else { Debug.Log("SpaceWarServer is not VAC Secure!"); } Debug.Log("Game server SteamID:" + SteamGameServer.GetSteamID().ToString()); }
void OnPolicyResponse(GSPolicyResponse_t PolicyResponses) { if (SteamGameServer.BSecure()) { print("VAC is Secure"); } else { print("not VAC is Secure"); } print("SteamID:" + SteamGameServer.GetSteamID().ToString()); }
private void OnPolicyResponse(GSPolicyResponse_t pPolicyResponse) { if (SteamGameServer.BSecure()) { Debug.Log("The Forest Server is VAC Secure!"); } else { Debug.Log("The Forest Server is not VAC Secure!"); } Debug.Log("Game server SteamID:" + SteamGameServer.GetSteamID().ToString()); this.Launch(); }
//----------------------------------------------------------------------------- // Purpose: Callback from Steam when logon is fully completed and VAC secure policy is set //----------------------------------------------------------------------------- void OnPolicyResponse(GSPolicyResponse_t pPolicyResponse) { #if USE_GS_AUTH_API // Check if we were able to go VAC secure or not if (SteamGameServer.BSecure()) { Debug.Log("SpaceWarServer is VAC Secure!"); } else { Debug.Log("SpaceWarServer is not VAC Secure!"); } Debug.Log("Game server SteamID:" + SteamGameServer.GetSteamID().ToString()); #endif }
protected override void execute(CSteamID executorID, string parameter) { if (!Dedicator.isDedicated) { return; } if (!Provider.isServer) { CommandWindow.LogError(this.localization.format("NotRunningErrorText")); return; } CommandWindow.Log(this.localization.format("DebugText")); CommandWindow.Log(this.localization.format("DebugIPPortText", new object[] { SteamGameServer.GetSteamID(), Parser.getIPFromUInt32(SteamGameServer.GetPublicIP()), Provider.port })); CommandWindow.Log(this.localization.format("DebugBytesSentText", new object[] { Provider.bytesSent + "B" })); CommandWindow.Log(this.localization.format("DebugBytesReceivedText", new object[] { Provider.bytesReceived + "B" })); CommandWindow.Log(this.localization.format("DebugAverageBytesSentText", new object[] { (uint)(Provider.bytesSent / Time.realtimeSinceStartup) + "B" })); CommandWindow.Log(this.localization.format("DebugAverageBytesReceivedText", new object[] { (uint)(Provider.bytesReceived / Time.realtimeSinceStartup) + "B" })); CommandWindow.Log(this.localization.format("DebugPacketsSentText", new object[] { Provider.packetsSent })); CommandWindow.Log(this.localization.format("DebugPacketsReceivedText", new object[] { Provider.packetsReceived })); CommandWindow.Log(this.localization.format("DebugAveragePacketsSentText", new object[] { (uint)(Provider.packetsSent / Time.realtimeSinceStartup) })); CommandWindow.Log(this.localization.format("DebugAveragePacketsReceivedText", new object[] { (uint)(Provider.packetsReceived / Time.realtimeSinceStartup) })); CommandWindow.Log(this.localization.format("DebugUPSText", new object[] { Mathf.CeilToInt((float)Provider.debugUPS / 50f * 100f) })); CommandWindow.Log(this.localization.format("DebugTPSText", new object[] { Mathf.CeilToInt((float)Provider.debugTPS / 50f * 100f) })); CommandWindow.Log(this.localization.format("DebugZombiesText", new object[] { ZombieManager.tickingZombies.Count })); CommandWindow.Log(this.localization.format("DebugAnimalsText", new object[] { AnimalManager.tickingAnimals.Count })); }
public override Identity GetServerIdent() { return(_ident ?? (_ident = (SteamIdentity)SteamGameServer.GetSteamID())); }