Skip to content

Commit

Permalink
Projektdateien hinzufügen.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrafDimenzio committed Nov 7, 2020
1 parent a1ec5f0 commit 746aeba
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 0 deletions.
25 changes: 25 additions & 0 deletions WaitAndChill.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30406.217
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WaitAndChill", "WaitAndChill\WaitAndChill.csproj", "{098A2189-5B40-425B-A804-46A11F4CF260}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{098A2189-5B40-425B-A804-46A11F4CF260}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{098A2189-5B40-425B-A804-46A11F4CF260}.Debug|Any CPU.Build.0 = Debug|Any CPU
{098A2189-5B40-425B-A804-46A11F4CF260}.Release|Any CPU.ActiveCfg = Release|Any CPU
{098A2189-5B40-425B-A804-46A11F4CF260}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2FA6F3C0-7167-4648-8F1B-47171EA11C04}
EndGlobalSection
EndGlobal
9 changes: 9 additions & 0 deletions WaitAndChill/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Synapse.Config;

namespace WaitAndChill
{
public class Config : AbstractConfigSection
{
public SerializedMapPoint LobbySpawn = new SerializedMapPoint("EZ_Shelter", 0f, 2f, 0f);
}
}
63 changes: 63 additions & 0 deletions WaitAndChill/EventHandlers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using MEC;
using Synapse;
using Synapse.Api;
using System.Collections.Generic;
using UnityEngine;

namespace WaitAndChill
{
public class EventHandlers
{
public EventHandlers() => Server.Get.Events.Round.WaitingForPlayersEvent += OnWaiting;

private void OnWaiting()
{
GameObject.Find("StartRound").transform.localScale = Vector3.zero;
Timing.RunCoroutine(WaitingForPlayers());
}

private IEnumerator<float> WaitingForPlayers()
{
var msg = $"<i><color=blue>Waiting for more Players!</color></i>\n<i><color=red>%players%/{CustomNetworkManager.slots}</color></i>\n<i>%status%</color></i>";

foreach (var door in Map.Get.Doors)
door.Locked = true;

while (!Map.Get.Round.RoundIsActive)
{
NonFacilityCompatibility.currentSceneSettings.constantRespawnPoint = PluginClass.Config.LobbySpawn.Parse().Position;

var newmsg = msg.Replace("%players%", Server.Get.Players.Count.ToString());
switch (GameCore.RoundStart.singleton.NetworkTimer)
{
case -2:
newmsg = newmsg.Replace("%status%", "");
break;

case -1:
newmsg = newmsg.Replace("%status%", "Round is starting");
break;

default:
newmsg = newmsg.Replace("%status%", $"{GameCore.RoundStart.singleton.NetworkTimer} seconds left");
break;
}

foreach (var player in Server.Get.Players)
{
if (player.RoleType == RoleType.None && player.Hub.Ready)
player.RoleID = (int)RoleType.Tutorial;

player.GiveTextHint(newmsg);
}

NonFacilityCompatibility.currentSceneSettings.constantRespawnPoint = Vector3.zero;
yield return Timing.WaitForOneFrame;
}

foreach (var door in Map.Get.Doors)
door.Locked = false;
}

}
}
22 changes: 22 additions & 0 deletions WaitAndChill/PluginClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Synapse.Api.Plugin;

namespace WaitAndChill
{
[PluginInformation(
Name = "WaitAndChill",
Author = "Dimenzio (Original: F4Fridey)",
LoadPriority = int.MinValue,
Description = "A Plugin which spawns player while waiting for Players",
SynapseMajor = SynapseController.SynapseMajor,
SynapseMinor = SynapseController.SynapseMinor,
SynapsePatch = SynapseController.SynapsePatch,
Version = "v.1.0.0"
)]
public class PluginClass : AbstractPlugin
{
[Synapse.Api.Plugin.Config(section = "WaitAndChill")]
public static Config Config;

public override void Load() => new EventHandlers();
}
}
36 changes: 36 additions & 0 deletions WaitAndChill/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("WaitAndChill")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WaitAndChill")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]

// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("098a2189-5b40-425b-a804-46a11f4cf260")]

// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
84 changes: 84 additions & 0 deletions WaitAndChill/WaitAndChill.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{098A2189-5B40-425B-A804-46A11F4CF260}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WaitAndChill</RootNamespace>
<AssemblyName>WaitAndChill</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="LiteDB, Version=5.0.9.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
<HintPath>..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Mirror.dll</HintPath>
</Reference>
<Reference Include="Synapse, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Synapse.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="EventHandlers.cs" />
<Compile Include="PluginClass.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
7 changes: 7 additions & 0 deletions WaitAndChill/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.0.4" targetFramework="net472" />
<package id="LiteDB" version="5.0.9" targetFramework="net472" />
<package id="SynapseSL" version="2.0.0" targetFramework="net472" />
<package id="YamlDotNet" version="8.1.2" targetFramework="net472" />
</packages>

0 comments on commit 746aeba

Please sign in to comment.