Skip to content

Commit ffa6f42

Browse files
committed
Projektdateien hinzufügen.
1 parent 0b24a8a commit ffa6f42

File tree

6 files changed

+209
-0
lines changed

6 files changed

+209
-0
lines changed

ItemSpawner.sln

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30406.217
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ItemSpawner", "ItemSpawner\ItemSpawner.csproj", "{673C422C-DC81-427C-BEBF-275F21F9E8FB}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{673C422C-DC81-427C-BEBF-275F21F9E8FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{673C422C-DC81-427C-BEBF-275F21F9E8FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{673C422C-DC81-427C-BEBF-275F21F9E8FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{673C422C-DC81-427C-BEBF-275F21F9E8FB}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {903833AD-81CC-4235-BBD2-938CD1AF00C3}
24+
EndGlobalSection
25+
EndGlobal

ItemSpawner/Config.cs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Synapse.Config;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using UnityEngine;
5+
6+
namespace ItemSpawner
7+
{
8+
public class Config : AbstractConfigSection
9+
{
10+
[Description("The Items which should spawn each Round")]
11+
public List<ItemSpawn> Spawns = new List<ItemSpawn>
12+
{
13+
new ItemSpawn {Item = new SerializedItem((int)ItemType.KeycardO5,0,0,0,0,Vector3.one),Position = new SerializedMapPoint("HCZ_079", 5.290604f, -3, -6.44455f),SpawnChance = 100f},
14+
};
15+
}
16+
17+
public class ItemSpawn
18+
{
19+
public SerializedMapPoint Position;
20+
21+
public SerializedItem Item;
22+
23+
public float SpawnChance;
24+
}
25+
}

ItemSpawner/ItemSpawner.csproj

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{673C422C-DC81-427C-BEBF-275F21F9E8FB}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>ItemSpawner</RootNamespace>
11+
<AssemblyName>ItemSpawner</AssemblyName>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="0Harmony, Version=2.0.4.0, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll</HintPath>
36+
</Reference>
37+
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38+
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Assembly-CSharp.dll</HintPath>
39+
</Reference>
40+
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41+
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
42+
</Reference>
43+
<Reference Include="LiteDB, Version=5.0.9.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
44+
<HintPath>..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47+
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Mirror.dll</HintPath>
48+
</Reference>
49+
<Reference Include="Synapse, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
50+
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\Synapse.dll</HintPath>
51+
</Reference>
52+
<Reference Include="System" />
53+
<Reference Include="System.Core" />
54+
<Reference Include="System.Runtime" />
55+
<Reference Include="System.Xml.Linq" />
56+
<Reference Include="System.Data.DataSetExtensions" />
57+
<Reference Include="Microsoft.CSharp" />
58+
<Reference Include="System.Data" />
59+
<Reference Include="System.Net.Http" />
60+
<Reference Include="System.Xml" />
61+
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
62+
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\UnityEngine.dll</HintPath>
63+
</Reference>
64+
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
65+
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\UnityEngine.CoreModule.dll</HintPath>
66+
</Reference>
67+
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
68+
<HintPath>..\packages\SynapseSL.2.0.0\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
69+
</Reference>
70+
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
71+
<HintPath>..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll</HintPath>
72+
</Reference>
73+
</ItemGroup>
74+
<ItemGroup>
75+
<Compile Include="Config.cs" />
76+
<Compile Include="PluginClass.cs" />
77+
<Compile Include="Properties\AssemblyInfo.cs" />
78+
</ItemGroup>
79+
<ItemGroup>
80+
<None Include="packages.config" />
81+
</ItemGroup>
82+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
83+
</Project>

ItemSpawner/PluginClass.cs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Synapse.Api.Plugin;
2+
using System.Reflection;
3+
4+
namespace ItemSpawner
5+
{
6+
[PluginInformation(
7+
Name = "Itemspawner",
8+
Author = "Dimenzio",
9+
Description = "A plugin to set spawnpoints of Items",
10+
LoadPriority = int.MinValue,
11+
SynapseMajor = 2,
12+
SynapseMinor = 0,
13+
SynapsePatch = 0,
14+
Version = "v.1.0.0"
15+
)]
16+
public class PluginClass : AbstractPlugin
17+
{
18+
[Synapse.Api.Plugin.Config(section="ItemSpawner")]
19+
public static Config Config;
20+
21+
public override void Load() => SynapseController.Server.Events.Round.RoundStartEvent += RoundStart;
22+
23+
private void RoundStart()
24+
{
25+
foreach(var spawn in Config.Spawns)
26+
if(UnityEngine.Random.Range(0f,100f) <= spawn.SpawnChance)
27+
{
28+
var item = spawn.Item.Parse();
29+
item.Drop(spawn.Position.Parse().Position);
30+
}
31+
}
32+
}
33+
}
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Allgemeine Informationen über eine Assembly werden über die folgenden
6+
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
7+
// die einer Assembly zugeordnet sind.
8+
[assembly: AssemblyTitle("ItemSpawner")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("ItemSpawner")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
18+
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
19+
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
20+
[assembly: ComVisible(false)]
21+
22+
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
23+
[assembly: Guid("673c422c-dc81-427c-bebf-275f21f9e8fb")]
24+
25+
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
26+
//
27+
// Hauptversion
28+
// Nebenversion
29+
// Buildnummer
30+
// Revision
31+
//
32+
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
33+
// indem Sie "*" wie unten gezeigt eingeben:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

ItemSpawner/packages.config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Lib.Harmony" version="2.0.4" targetFramework="net472" />
4+
<package id="LiteDB" version="5.0.9" targetFramework="net472" />
5+
<package id="SynapseSL" version="2.0.0" targetFramework="net472" />
6+
<package id="YamlDotNet" version="8.1.2" targetFramework="net472" />
7+
</packages>

0 commit comments

Comments
 (0)