Permalink
Browse files

Merge pull request #1 from Kr4ken-9/master

thx fam
  • Loading branch information...
ic3w0lf22 committed Feb 11, 2017
2 parents 46b88eb + 03ee0da commit 0cfe6316ee377894b0f0899434ace537d5971be8
View
@@ -0,0 +1,187 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
x64/
build/
bld/
[Oo]bj/
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
#*.pubxml
# NuGet Packages Directory
packages/*
## TODO: If the tool you use requires repositories.config
## uncomment the next line
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since
# NuGet packages use it for MSBuild targets.
# This line needs to be after the ignore of the build folder
# (and the packages folder if the line above has been uncommented)
!packages/build/
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
View
@@ -1,5 +1,4 @@
using System;
using Rocket.API;
using Rocket.API;
using UnityEngine;
namespace ArenaSpawnProtection
@@ -8,13 +7,13 @@ public class ASPConfiguration : IRocketPluginConfiguration, IDefaultable
{
public void LoadDefaults()
{
this.PlayerHideTime = 10f;
this.ProtectionStartMessage = "Players protected!";
this.ProtectionEndMessage = "Player protection ended!";
this.MessageColor = Color.cyan;
PlayerProtectionTime = 10f;
ProtectionStartMessage = "Players protected!";
ProtectionEndMessage = "Player protection ended!";
MessageColor = Color.cyan;
}
public float PlayerHideTime;
public float PlayerProtectionTime;
public string ProtectionStartMessage;
public string ProtectionEndMessage;
public Color MessageColor;
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ArenaSpawnProtection</RootNamespace>
<AssemblyName>ArenaSpawnProtection</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -34,10 +34,12 @@
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Rocket.API, Version=2.6.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -52,10 +54,7 @@
<HintPath>lib\Rocket.Unturned.dll</HintPath>
</Reference>
<Reference Include="System">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp">
<Private>True</Private>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
View
@@ -1,14 +1,10 @@
using System;
using Rocket.Unturned;
using Rocket.Core.Plugins;
using Rocket.Core.Logging;
using Rocket.Unturned.Events;
using Rocket.Unturned.Player;
using SDG.Unturned;
using UnityEngine;
using Rocket.Core.Extensions;
using System.Collections;
using System.Diagnostics;
namespace ArenaSpawnProtection
{
@@ -18,32 +14,33 @@ protected override void Load()
{
Instance = this;
Rocket.Core.Logging.Logger.Log("\n\n\rArenaSpawnProtection made by ic3w0lf", ConsoleColor.Green);
Rocket.Core.Logging.Logger.Log(string.Format("\r\rPlayer Hide Time: {0} seconds\n\n", base.Configuration.Instance.PlayerHideTime), ConsoleColor.Green);
U.Events.OnPlayerConnected += new UnturnedEvents.PlayerConnected(ProtectPlayerConnected);
Rocket.Core.Logging.Logger.Log(string.Format("\r\rPlayer Protection Time: {0} seconds\n\n", Instance.Configuration.Instance.PlayerProtectionTime), ConsoleColor.Green);
U.Events.OnPlayerConnected += ProtectPlayerConnected;
StartCoroutine(CheckArenaState());
}
protected override void Unload()
{
U.Events.OnPlayerConnected -= new UnturnedEvents.PlayerConnected(ProtectPlayerConnected);
U.Events.OnPlayerConnected -= ProtectPlayerConnected;
StopAllCoroutines();
}
private void ProtectPlayerConnected(UnturnedPlayer player)
{
if (LevelManager.arenaState == EArenaState.WARMUP)
{
player.Features.VanishMode = true;
if (!player.Features.VanishMode)
player.Features.VanishMode = true;
}
}
[DebuggerHidden()]
public IEnumerator CheckArenaState()
{
while (true)
{
if (Provider.isServer)
{
switch(LevelManager.arenaState)
switch (LevelManager.arenaState)
{
case EArenaState.WARMUP:
{
@@ -64,37 +61,39 @@ public IEnumerator CheckArenaState()
}
}
}
yield return new WaitForSeconds(.05f);
yield return new WaitForSeconds(1f);
}
}
[DebuggerHidden()]
public IEnumerator ProtectPlayers()
{
for (int i = 0; i < Provider.clients.Count; i++)
{
SteamPlayer sPlayer = Provider.clients[i];
UnturnedPlayer uPlayer = (UnturnedPlayer)UnturnedPlayer.FromCSteamID(sPlayer.playerID.steamID);
uPlayer.Features.VanishMode = true;
uPlayer.Features.GodMode = true;
UnturnedPlayer uPlayer = UnturnedPlayer.FromCSteamID(Provider.clients[i].playerID.steamID);
if (!uPlayer.Features.VanishMode)
uPlayer.Features.VanishMode = true;
if (!uPlayer.Features.GodMode)
uPlayer.Features.GodMode = true;
Rocket.Core.Logging.Logger.Log("Protected " + uPlayer.DisplayName, ConsoleColor.Cyan);
}
ChatManager.say(base.Configuration.Instance.ProtectionStartMessage, base.Configuration.Instance.MessageColor);
yield return new WaitForSeconds(base.Configuration.Instance.PlayerHideTime + 5f);
ChatManager.say(Instance.Configuration.Instance.ProtectionStartMessage, Instance.Configuration.Instance.MessageColor);
yield return new WaitForSeconds(Instance.Configuration.Instance.PlayerProtectionTime + 5f);
for (int i = 0; i < Provider.clients.Count; i++)
{
SteamPlayer sPlayer = Provider.clients[i];
UnturnedPlayer uPlayer = (UnturnedPlayer)UnturnedPlayer.FromCSteamID(sPlayer.playerID.steamID);
uPlayer.Features.VanishMode = false;
uPlayer.Features.GodMode = false;
UnturnedPlayer uPlayer = UnturnedPlayer.FromCSteamID(Provider.clients[i].playerID.steamID);
if (uPlayer.Features.VanishMode)
uPlayer.Features.VanishMode = false;
if (uPlayer.Features.GodMode)
uPlayer.Features.GodMode = false;
Rocket.Core.Logging.Logger.Log("Ended protection for " + uPlayer.DisplayName, ConsoleColor.Cyan);
}
ChatManager.say(base.Configuration.Instance.ProtectionEndMessage, base.Configuration.Instance.MessageColor);
ChatManager.say(Instance.Configuration.Instance.ProtectionEndMessage, Instance.Configuration.Instance.MessageColor);
yield return new WaitForEndOfFrame();
}
private Coroutine PTCoroutine;
public static SpawnProtection Instance;
private bool ProtectedB = false;
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
BIN -898 KB bin/Debug/System.dll
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.

0 comments on commit 0cfe631

Please sign in to comment.