├── .gitignore ├── Assembly-CSharp ├── Base.Spawns │ ├── SpawnAnimals.cs │ ├── SpawnBarricades.cs │ ├── SpawnItems.cs │ ├── SpawnPlayers.cs │ ├── SpawnProjectiles.cs │ ├── SpawnResources.cs │ ├── SpawnStructures.cs │ └── SpawnVehicles.cs ├── Base.Stats │ ├── AmmoStats.cs │ ├── ArmorStats.cs │ ├── BarricadeStats.cs │ ├── ConsumeableStats.cs │ ├── ExplosiveStats.cs │ ├── GunStats.cs │ ├── HarvestStats.cs │ ├── MedicalStats.cs │ ├── MeleeStats.cs │ └── StructureStats.cs ├── Base.VoiceChat │ ├── USpeakCodecManager.cs │ ├── USpeakOwnerInfo.cs │ ├── USpeakPlayer.cs │ ├── USpeakUtilities.cs │ ├── USpeaker.cs │ └── UnityNetworkUSpeakSender.cs ├── Base │ ├── Animifier.cs │ ├── BagSize.cs │ ├── BandMode.cs │ ├── Barricade.cs │ ├── BarricadesRegion.cs │ ├── Base │ │ └── MasterSettings.cs │ ├── Bleed.cs │ ├── Blueprint.cs │ ├── Blueprints.cs │ ├── Bumper.cs │ ├── Chainsaw.cs │ ├── Character.cs │ ├── Chart.cs │ ├── ChatType.cs │ ├── ClientItem.cs │ ├── Clothes.cs │ ├── Colors.cs │ ├── Consumeable.cs │ ├── Cooking.cs │ ├── Coord2.cs │ ├── DamageMultiplier.cs │ ├── Dedicated.cs │ ├── DefaultTalkController.cs │ ├── DyeColor.cs │ ├── ElectricTrap.cs │ ├── Electricity.cs │ ├── Epoch.cs │ ├── ExplosionTool.cs │ ├── FaceStyles.cs │ ├── FancyAnimifier.cs │ ├── Fertilizer.cs │ ├── Flare.cs │ ├── Flashlight.cs │ ├── Footsteps.cs │ ├── GameSettings.cs │ ├── Generator.cs │ ├── Gore.cs │ ├── GraphicsSettings.cs │ ├── Ground.cs │ ├── HairColor.cs │ ├── HairStyles.cs │ ├── Harvest.cs │ ├── Images.cs │ ├── InputSettings.cs │ ├── Interact.cs │ ├── Interactable.cs │ ├── InteractionInterface.cs │ ├── Inventory.cs │ ├── Item.cs │ ├── ItemAmount.cs │ ├── ItemAnimations.cs │ ├── ItemDescription.cs │ ├── ItemEquipable.cs │ ├── ItemName.cs │ ├── ItemSounds.cs │ ├── ItemStackable.cs │ ├── ItemState.cs │ ├── ItemType.cs │ ├── ItemWeight.cs │ ├── Items │ │ ├── Backpack.cs │ │ ├── Bed.cs │ │ ├── Campfire.cs │ │ ├── Crate.cs │ │ ├── Door.cs │ │ ├── Equipment.cs │ │ ├── Gas.cs │ │ ├── Hat.cs │ │ ├── Pick.cs │ │ ├── Refillable.cs │ │ ├── Repair.cs │ │ ├── Shirt.cs │ │ ├── Trap.cs │ │ ├── Vest.cs │ │ └── Weapons │ │ │ ├── Axe.cs │ │ │ ├── Explosive.cs │ │ │ ├── ExplosiveTrap.cs │ │ │ ├── Grenade.cs │ │ │ ├── Gun.cs │ │ │ ├── Snare.cs │ │ │ └── Weapon.cs │ ├── ItemsRegion.cs │ ├── Jack.cs │ ├── Lamp.cs │ ├── Level.cs │ ├── Life.cs │ ├── LoadingScreen.cs │ ├── LocalUSpeakSender.cs │ ├── LockedCrate.cs │ ├── Look.cs │ ├── Loot.cs │ ├── MD5.cs │ ├── Maps.cs │ ├── MasterSettings.cs │ ├── Medicine.cs │ ├── Melee.cs │ ├── Movement.cs │ ├── Network │ │ ├── NetworkBans.cs │ │ ├── NetworkChat.cs │ │ ├── NetworkEffects.cs │ │ ├── NetworkErrorDelegate.cs │ │ ├── NetworkEventDelegate.cs │ │ ├── NetworkEvents.cs │ │ ├── NetworkHandler.cs │ │ ├── NetworkInterpolation.cs │ │ ├── NetworkLoader.cs │ │ ├── NetworkManager.cs │ │ ├── NetworkMasterServer.cs │ │ ├── NetworkPlayerDelegate.cs │ │ ├── NetworkRegions.cs │ │ ├── NetworkSounds.cs │ │ ├── NetworkTools.cs │ │ ├── NetworkUser.cs │ │ └── NetworkUserList.cs │ ├── Note.cs │ ├── Npc │ │ ├── AI.cs │ │ ├── Animal.cs │ │ └── Zombie.cs │ ├── Ocean.cs │ ├── Optic.cs │ ├── Orient2.cs │ ├── OwnerFinder.cs │ ├── Packer.cs │ ├── Painter.cs │ ├── Pants.cs │ ├── Passenger.cs │ ├── Plant.cs │ ├── Player.cs │ ├── PlayerSettings.cs │ ├── Point2.cs │ ├── RayMasks.cs │ ├── Reflective.cs │ ├── Reflector.cs │ ├── Reputation.cs │ ├── RudeFilter.cs │ ├── Savedata.cs │ ├── SendBehavior.cs │ ├── Server.cs │ ├── ServerBarricade.cs │ ├── ServerItem.cs │ ├── ServerSettings.cs │ ├── ServerStructure.cs │ ├── Skill.cs │ ├── Skills.cs │ ├── SkinColor.cs │ ├── Smoke.cs │ ├── Sneaky.cs │ ├── SpeakerMode.cs │ ├── Stance.cs │ ├── Structure.cs │ ├── Sun.cs │ ├── Texts.cs │ ├── ThreeDMode.cs │ ├── Throw.cs │ ├── UnlockedDoor.cs │ ├── Useable.cs │ ├── Vehicle.cs │ ├── Viewmodel.cs │ └── Voice.cs ├── CommandHandler │ ├── BetterNetworkUser.cs │ ├── Command.cs │ ├── CommandHandlerMain.cs │ ├── CommandList.cs │ └── UserList.cs ├── ConnectionGuard.cs ├── Database.cs ├── DedicatedServer.cs ├── HookManager │ └── HookEnventManager.cs ├── ModLoader │ ├── AssemblyInfo.cs │ ├── Ini.cs │ ├── Loader.cs │ ├── ModManager.cs │ └── Reference.cs ├── ObjExporter.cs ├── Properties │ └── AssemblyInfo.cs ├── RemovedFunctions.cs ├── Steam │ └── Steam.cs ├── TestScript.cs ├── Tests │ └── DatabaseTest.cs ├── ThreadWorker │ └── TaskBehaviour.cs └── UnturnedServer.csproj ├── NuGet.exe ├── README.md ├── Tests ├── AssemblyInfo.cs ├── ItemTest.cs ├── Main.cs ├── Tests.csproj ├── Tests.mdproj └── packages.config ├── UnturnedServer.sln ├── UnturnedShared ├── Properties │ └── AssemblyInfo.cs ├── Unturned.Entity │ ├── InventoryItem.cs │ ├── Player.cs │ ├── PlayerClothes.cs │ ├── PlayerInventory.cs │ ├── PlayerLife.cs │ └── PlayerSkills.cs ├── Unturned.Xml │ ├── BanEntry.cs │ └── BanList.cs ├── Unturned │ ├── AsyncRequest.cs │ ├── ConfigFile.cs │ ├── HookInterface.cs │ ├── IBanEntry.cs │ ├── IDataHolder.cs │ └── Log │ │ └── Logger.cs └── UnturnedShared.csproj ├── build.bat ├── libs └── UnityEngine.dll ├── mods ├── AdminCommands │ ├── AICommands.cs │ ├── AdminCommands.cs │ ├── AdminCommands.csproj │ ├── AssemblyInfo.cs │ ├── BanCommands.cs │ ├── BankCommand.cs │ ├── BuildCommands.cs │ ├── CarCommands.cs │ ├── CreditCommand.cs │ ├── HomeCommands.cs │ ├── KitCommands.cs │ ├── Kits │ │ ├── ExperienceKit.cs │ │ ├── GhillieKit.cs │ │ ├── MapleKit.cs │ │ ├── NatoKit.cs │ │ ├── NinjaKit.cs │ │ ├── PoliceKit.cs │ │ ├── ScopeKit.cs │ │ ├── ShotgunKit.cs │ │ ├── SpawnKit.cs │ │ └── TimberKit.cs │ └── StatCommands.cs └── RemoteConsole │ ├── AssemblyInfo.cs │ ├── RemoteConsole.cs │ └── RemoteConsole.csproj ├── modules ├── DatabaseHelper │ ├── DatabaseHelper │ │ ├── Database.cs │ │ ├── HSController.cs │ │ └── RemoteConnection.cs │ ├── MySQLDatabase.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Tests │ │ └── DatabaseTest.cs ├── FileDatabase │ ├── FileDatabase.csproj │ ├── MyClass.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Unturned │ │ └── FileDatabase.cs ├── RemoteDatabase │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RemoteDatabase.csproj │ ├── Tests │ │ ├── InventoryTest.cs │ │ └── RemoteDatabaseTest.cs │ ├── Unturned │ │ ├── BanService.cs │ │ ├── CreditMessage.cs │ │ ├── RemoteDatabase.cs │ │ └── RestClient.cs │ ├── app.config │ └── packages.config └── Unturned.Http │ ├── AssemblyInfo.cs │ ├── HttpRequest.cs │ └── Unturned.Http.csproj └── release.sh /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | *.in 3 | 4 | *.userprefs 5 | **/*.userprefs 6 | **/bin 7 | **/*.pidb 8 | **/*.in -------------------------------------------------------------------------------- /Assembly-CSharp/Base.Spawns/SpawnProjectiles.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class SpawnProjectiles : MonoBehaviour 5 | { 6 | private static SpawnProjectiles tool; 7 | 8 | public static GameObject model; 9 | 10 | public SpawnProjectiles() 11 | { 12 | } 13 | 14 | [RPC] 15 | public void createProjectile(int id, Vector3 position, Vector3 force) 16 | { 17 | GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load(string.Concat("Prefabs/Projectiles/", id)), position, Quaternion.LookRotation(force) * Quaternion.Euler(0f, 0f, -90f)); 18 | gameObject.name = "projectile"; 19 | gameObject.transform.parent = SpawnProjectiles.model.transform.FindChild("models"); 20 | gameObject.rigidbody.AddForce(force); 21 | } 22 | 23 | public void onReady() 24 | { 25 | SpawnProjectiles.tool = this; 26 | SpawnProjectiles.model = GameObject.Find(Application.loadedLevelName).transform.FindChild("projectiles").gameObject; 27 | } 28 | 29 | public void Start() 30 | { 31 | NetworkEvents.onReady += new NetworkEventDelegate(this.onReady); 32 | } 33 | 34 | public static void throwProjectile(int id, Vector3 position, Vector3 force) 35 | { 36 | SpawnProjectiles.tool.networkView.RPC("createProjectile", RPCMode.All, new object[] { id, position, force }); 37 | } 38 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base.Stats/ExplosiveStats.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class ExplosiveStats 4 | { 5 | public ExplosiveStats() 6 | { 7 | } 8 | 9 | public static int getDamage(int id) 10 | { 11 | int num = id; 12 | switch (num) 13 | { 14 | case 16015: 15 | { 16 | return 300; 17 | } 18 | case 16016: 19 | { 20 | return 80; 21 | } 22 | case 16017: 23 | { 24 | return 150; 25 | } 26 | default: 27 | { 28 | if (num == 23007) 29 | { 30 | break; 31 | } 32 | else 33 | { 34 | return 0; 35 | } 36 | } 37 | } 38 | return 80; 39 | } 40 | 41 | public static int getRange(int id) 42 | { 43 | int num = id; 44 | switch (num) 45 | { 46 | case 16015: 47 | { 48 | return 12; 49 | } 50 | case 16016: 51 | { 52 | return 6; 53 | } 54 | case 16017: 55 | { 56 | return 4; 57 | } 58 | default: 59 | { 60 | if (num == 23007) 61 | { 62 | break; 63 | } 64 | else 65 | { 66 | return 0; 67 | } 68 | } 69 | } 70 | return 8; 71 | } 72 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base.Stats/HarvestStats.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class HarvestStats 4 | { 5 | public HarvestStats() 6 | { 7 | } 8 | 9 | public static int getCrop(int id) 10 | { 11 | switch (id) 12 | { 13 | case 22000: 14 | { 15 | return 14002; 16 | } 17 | case 22001: 18 | { 19 | return 14004; 20 | } 21 | case 22002: 22 | { 23 | return 14006; 24 | } 25 | case 22003: 26 | { 27 | return 14008; 28 | } 29 | case 22004: 30 | { 31 | return 14010; 32 | } 33 | } 34 | return -1; 35 | } 36 | 37 | public static int getGrowth(int id) 38 | { 39 | switch (id) 40 | { 41 | case 22000: 42 | { 43 | return 800; 44 | } 45 | case 22001: 46 | { 47 | return 700; 48 | } 49 | case 22002: 50 | { 51 | return 900; 52 | } 53 | case 22003: 54 | { 55 | return 700; 56 | } 57 | case 22004: 58 | { 59 | return 800; 60 | } 61 | } 62 | return 0; 63 | } 64 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base.VoiceChat/USpeakCodecManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class USpeakCodecManager : ScriptableObject 5 | { 6 | public string[] CodecNames = new string[0]; 7 | 8 | public string[] FriendlyNames = new string[0]; 9 | 10 | public static USpeakCodecManager Instance 11 | { 12 | get 13 | { 14 | return null; 15 | } 16 | } 17 | 18 | public USpeakCodecManager() 19 | { 20 | } 21 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base.VoiceChat/USpeakOwnerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class USpeakOwnerInfo : MonoBehaviour 6 | { 7 | public static Dictionary USpeakerMap; 8 | 9 | public static Dictionary USpeakPlayerMap; 10 | 11 | private USpeaker m_speaker; 12 | 13 | private USpeakPlayer m_Owner; 14 | 15 | public USpeakPlayer Owner 16 | { 17 | get 18 | { 19 | return this.m_Owner; 20 | } 21 | } 22 | 23 | public USpeaker Speaker 24 | { 25 | get 26 | { 27 | if (this.m_speaker == null) 28 | { 29 | this.m_speaker = USpeaker.Get(this); 30 | } 31 | return this.m_speaker; 32 | } 33 | } 34 | 35 | static USpeakOwnerInfo() 36 | { 37 | USpeakOwnerInfo.USpeakerMap = new Dictionary(); 38 | USpeakOwnerInfo.USpeakPlayerMap = new Dictionary(); 39 | } 40 | 41 | public USpeakOwnerInfo() 42 | { 43 | } 44 | 45 | public void DeInit() 46 | { 47 | USpeakOwnerInfo.USpeakPlayerMap.Remove(this.m_Owner.PlayerID); 48 | USpeakOwnerInfo.USpeakerMap.Remove(this); 49 | UnityEngine.Object.Destroy(base.gameObject); 50 | } 51 | 52 | public static USpeakOwnerInfo FindPlayerByID(string PlayerID) 53 | { 54 | return USpeakOwnerInfo.USpeakPlayerMap[PlayerID]; 55 | } 56 | 57 | public void Init(USpeakPlayer owner) 58 | { 59 | this.m_Owner = owner; 60 | USpeakOwnerInfo.USpeakPlayerMap.Add(owner.PlayerID, this); 61 | USpeakOwnerInfo.USpeakerMap.Add(this, base.GetComponent()); 62 | UnityEngine.Object.DontDestroyOnLoad(base.gameObject); 63 | } 64 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base.VoiceChat/USpeakPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class USpeakPlayer 4 | { 5 | public string PlayerID; 6 | 7 | public USpeakPlayer() 8 | { 9 | } 10 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base.VoiceChat/USpeakUtilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | public class USpeakUtilities 7 | { 8 | public static string USpeakerPrefabPath; 9 | 10 | static USpeakUtilities() 11 | { 12 | USpeakUtilities.USpeakerPrefabPath = "USpeakerPrefab"; 13 | } 14 | 15 | public USpeakUtilities() 16 | { 17 | } 18 | 19 | public static void Clear() 20 | { 21 | foreach (string key in USpeakOwnerInfo.USpeakPlayerMap.Keys) 22 | { 23 | USpeakOwnerInfo.USpeakPlayerMap[key].DeInit(); 24 | } 25 | } 26 | 27 | public static void ListPlayers(IEnumerable PlayerIDs) 28 | { 29 | IEnumerator enumerator = PlayerIDs.GetEnumerator(); 30 | try 31 | { 32 | while (enumerator.MoveNext()) 33 | { 34 | USpeakUtilities.PlayerJoined(enumerator.Current); 35 | } 36 | } 37 | finally 38 | { 39 | if (enumerator == null) 40 | { 41 | } 42 | enumerator.Dispose(); 43 | } 44 | } 45 | 46 | public static void PlayerJoined(string PlayerID) 47 | { 48 | GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("USpeakerPrefab")); 49 | USpeakOwnerInfo uSpeakOwnerInfo = gameObject.AddComponent(); 50 | 51 | } 52 | 53 | public static void PlayerLeft(string PlayerID) 54 | { 55 | USpeakOwnerInfo.FindPlayerByID(PlayerID).DeInit(); 56 | } 57 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base.VoiceChat/UnityNetworkUSpeakSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class UnityNetworkUSpeakSender : MonoBehaviour 5 | { 6 | [RPC] 7 | private void init(int data) 8 | { 9 | // TODO: notify client that Voice is disabled 10 | //NetworkUserList.getUserFromPlayer(player); 11 | } 12 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Animifier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Animifier : MonoBehaviour 5 | { 6 | public readonly static float FADE; 7 | 8 | private string playID = string.Empty; 9 | 10 | private float startedPlay; 11 | 12 | private string stanceID = string.Empty; 13 | 14 | private Animation anim; 15 | 16 | static Animifier() 17 | { 18 | Animifier.FADE = 0.15f; 19 | } 20 | 21 | public Animifier() 22 | { 23 | } 24 | 25 | public void play(string id) 26 | { 27 | if (id != this.playID) 28 | { 29 | this.playID = id; 30 | this.startedPlay = Time.realtimeSinceStartup; 31 | this.tick(); 32 | } 33 | } 34 | 35 | public void stance(string id) 36 | { 37 | this.stanceID = id; 38 | this.tick(); 39 | } 40 | 41 | public void Start() 42 | { 43 | this.anim = base.transform.FindChild("character").animation; 44 | this.tick(); 45 | } 46 | 47 | public void tick() 48 | { 49 | if (this.anim != null) 50 | { 51 | if (this.playID != string.Empty) 52 | { 53 | if (Time.realtimeSinceStartup - this.startedPlay >= this.anim[this.playID].length) 54 | { 55 | this.playID = string.Empty; 56 | this.tick(); 57 | } 58 | else 59 | { 60 | this.anim.Play(this.playID); 61 | } 62 | } 63 | else if (this.stanceID != string.Empty) 64 | { 65 | this.anim.Play(this.stanceID); 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/BagSize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class BagSize 4 | { 5 | public BagSize() 6 | { 7 | } 8 | 9 | public static int getCapacity(int id) 10 | { 11 | switch (id) 12 | { 13 | case 2000: 14 | { 15 | return 7500; 16 | } 17 | case 2001: 18 | { 19 | return 10000; 20 | } 21 | case 2002: 22 | { 23 | return 12500; 24 | } 25 | case 2003: 26 | { 27 | return 15000; 28 | } 29 | case 2004: 30 | { 31 | return 17500; 32 | } 33 | case 2005: 34 | { 35 | return 20000; 36 | } 37 | case 2006: 38 | { 39 | return 10000; 40 | } 41 | } 42 | return 5000; 43 | } 44 | 45 | public static int getHeight(int id) 46 | { 47 | switch (id) 48 | { 49 | case 2000: 50 | { 51 | return 2; 52 | } 53 | case 2001: 54 | { 55 | return 3; 56 | } 57 | case 2002: 58 | { 59 | return 4; 60 | } 61 | case 2003: 62 | { 63 | return 5; 64 | } 65 | case 2004: 66 | { 67 | return 5; 68 | } 69 | case 2005: 70 | { 71 | return 4; 72 | } 73 | case 2006: 74 | { 75 | return 2; 76 | } 77 | } 78 | return 1; 79 | } 80 | 81 | public static int getWidth(int id) 82 | { 83 | switch (id) 84 | { 85 | case 2000: 86 | { 87 | return 4; 88 | } 89 | case 2001: 90 | { 91 | return 4; 92 | } 93 | case 2002: 94 | { 95 | return 4; 96 | } 97 | case 2003: 98 | { 99 | return 4; 100 | } 101 | case 2004: 102 | { 103 | return 5; 104 | } 105 | case 2005: 106 | { 107 | return 5; 108 | } 109 | case 2006: 110 | { 111 | return 5; 112 | } 113 | } 114 | return 4; 115 | } 116 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/BandMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public enum BandMode 4 | { 5 | Narrow, 6 | Wide, 7 | UltraWide 8 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/BarricadesRegion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class BarricadesRegion 6 | { 7 | public List barricades; 8 | 9 | public List models; 10 | 11 | public float cooldown; 12 | 13 | public bool edit; 14 | 15 | public BarricadesRegion() 16 | { 17 | this.barricades = new List(); 18 | this.models = new List(); 19 | } 20 | 21 | public static bool acceptable(Point2 a, Point2 b) 22 | { 23 | return (!BarricadesRegion.acceptable(a.x, b.y) ? false : BarricadesRegion.acceptable(a.y, b.y)); 24 | } 25 | 26 | public static bool acceptable(int a, int b) 27 | { 28 | return (a == b || a == b - 1 || a == b - 2 || a == b - 3 || a == b - 4 || a == b + 1 || a == b + 2 || a == b + 3 ? true : a == b + 4); 29 | } 30 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Base/MasterSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class MasterSettings 4 | { 5 | public readonly static int MASTERSETTINGS_VERSION; 6 | 7 | static MasterSettings() 8 | { 9 | } 10 | 11 | public MasterSettings() 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Bleed.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Bleed : MonoBehaviour 5 | { 6 | private static RaycastHit hit; 7 | 8 | public Bleed() 9 | { 10 | } 11 | 12 | public void Awake() 13 | { 14 | if (!GameSettings.gore) 15 | { 16 | UnityEngine.Object.Destroy(base.gameObject); 17 | } 18 | else 19 | { 20 | Physics.Raycast(base.transform.position, Vector3.down, out Bleed.hit, 16f, 34342913); 21 | if (Bleed.hit.collider != null) 22 | { 23 | float single = UnityEngine.Random.Range(0.75f, 1.25f); 24 | GameObject vector3 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load(string.Concat("Effects/blood_", UnityEngine.Random.Range(0, 4))), Bleed.hit.point + (Bleed.hit.normal * UnityEngine.Random.Range(0.04f, 0.06f)), Quaternion.LookRotation(Bleed.hit.normal) * Quaternion.Euler(0f, 0f, (float)UnityEngine.Random.Range(0, 360))); 25 | vector3.name = "blood"; 26 | vector3.transform.parent = NetworkEffects.model.transform; 27 | vector3.transform.localScale = new Vector3(single, single, single); 28 | UnityEngine.Object.Destroy(vector3, 20f); 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Blueprint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Blueprint 4 | { 5 | public int id_0; 6 | 7 | public int amount_0; 8 | 9 | public int id_1; 10 | 11 | public int amount_1; 12 | 13 | public int idTool; 14 | 15 | public int idReward; 16 | 17 | public int amountReward; 18 | 19 | public bool fire; 20 | 21 | public float knowledge; 22 | 23 | public Blueprint(int setID_0, int setAmount_0, int setID_1, int setAmount_1, int setIDTool, int setIDReward, int setAmountReward) 24 | { 25 | this.id_0 = setID_0; 26 | this.amount_0 = setAmount_0; 27 | this.id_1 = setID_1; 28 | this.amount_1 = setAmount_1; 29 | this.idTool = setIDTool; 30 | this.idReward = setIDReward; 31 | this.amountReward = setAmountReward; 32 | this.fire = false; 33 | this.knowledge = 0f; 34 | } 35 | 36 | public Blueprint(int setID_0, int setAmount_0, int setID_1, int setAmount_1, int setIDTool, int setIDReward, int setAmountReward, bool setFire) 37 | { 38 | this.id_0 = setID_0; 39 | this.amount_0 = setAmount_0; 40 | this.id_1 = setID_1; 41 | this.amount_1 = setAmount_1; 42 | this.idTool = setIDTool; 43 | this.idReward = setIDReward; 44 | this.amountReward = setAmountReward; 45 | this.fire = setFire; 46 | this.knowledge = 0f; 47 | } 48 | 49 | public Blueprint(int setID_0, int setAmount_0, int setID_1, int setAmount_1, int setIDTool, int setIDReward, int setAmountReward, float setKnowledge) 50 | { 51 | this.id_0 = setID_0; 52 | this.amount_0 = setAmount_0; 53 | this.id_1 = setID_1; 54 | this.amount_1 = setAmount_1; 55 | this.idTool = setIDTool; 56 | this.idReward = setIDReward; 57 | this.amountReward = setAmountReward; 58 | this.fire = false; 59 | this.knowledge = setKnowledge; 60 | } 61 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Bumper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Bumper : MonoBehaviour 5 | { 6 | public Bumper() 7 | { 8 | } 9 | 10 | public void Awake() 11 | { 12 | if (!Network.isServer) 13 | { 14 | UnityEngine.Object.Destroy(base.gameObject); 15 | } 16 | } 17 | 18 | public void OnTriggerEnter(Collider other) 19 | { 20 | if (base.transform.parent.GetComponent().lastSpeed > 5 && base.transform.parent.GetComponent().passengers[0] != null) 21 | { 22 | if ((other.tag == "Enemy" || other.tag == "Player") && ServerSettings.pvp) 23 | { 24 | GameObject gameObject = null; 25 | gameObject = (other.tag != "Enemy" ? other.gameObject : OwnerFinder.getOwner(other.gameObject)); 26 | NetworkUser userFromPlayer = NetworkUserList.getUserFromPlayer(base.transform.parent.GetComponent().passengers[0].player); 27 | if (userFromPlayer != null && !gameObject.GetComponent().dead && (userFromPlayer.friend == string.Empty || userFromPlayer.friend != gameObject.GetComponent().owner.friend)) 28 | { 29 | if (gameObject.GetComponent().owner.reputation >= 0) 30 | { 31 | NetworkHandler.offsetReputation(userFromPlayer.player, -1); 32 | } 33 | else 34 | { 35 | NetworkHandler.offsetReputation(userFromPlayer.player, 1); 36 | } 37 | 38 | gameObject.GetComponent().damage(1000, string.Concat("You were run over by ", userFromPlayer.name, "!"), -1, userFromPlayer.id); 39 | NetworkSounds.askSound("Sounds/Impacts/flesh", gameObject.transform.position + Vector3.up, 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 0.25f); 40 | NetworkEffects.askEffect("Effects/flesh", gameObject.transform.position + Vector3.up, Quaternion.identity, -1f); 41 | } 42 | } 43 | else if (other.tag == "Animal") 44 | { 45 | GameObject owner = OwnerFinder.getOwner(other.gameObject); 46 | owner.GetComponent().damage(1000); 47 | NetworkSounds.askSound("Sounds/Impacts/flesh", owner.transform.position + Vector3.up, 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 0.25f); 48 | NetworkEffects.askEffect("Effects/flesh", owner.transform.position + Vector3.up, Quaternion.identity, -1f); 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Chart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Chart : Useable 5 | { 6 | private GameObject marker; 7 | 8 | public Chart() 9 | { 10 | } 11 | 12 | public override void equip() 13 | { 14 | Viewmodel.play("equip"); 15 | this.marker = Equipment.model.transform.FindChild("model").FindChild("player").gameObject; 16 | if (PlayerSettings.arm) 17 | { 18 | this.marker.transform.parent.localScale = new Vector3(1f, -1f, 1f); 19 | } 20 | } 21 | 22 | public void Update() 23 | { 24 | if (Player.model != null) 25 | { 26 | Transform vector3 = this.marker.transform; 27 | Vector3 vector31 = Player.model.transform.position; 28 | Vector3 vector32 = Player.model.transform.position; 29 | vector3.localPosition = new Vector3(vector31.z / 1024f * 0.3125f, vector32.x / 1024f * 0.3125f, 0.01f); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ChatType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class ChatType 4 | { 5 | public ChatType() 6 | { 7 | } 8 | 9 | public static string getIcon(int type) 10 | { 11 | switch (type) 12 | { 13 | case 0: 14 | { 15 | return "Textures/Icons/global"; 16 | } 17 | case 1: 18 | { 19 | return "Textures/Icons/local"; 20 | } 21 | case 2: 22 | { 23 | return "Textures/Icons/clan"; 24 | } 25 | case 3: 26 | { 27 | return "Textures/Icons/alert"; 28 | } 29 | } 30 | return string.Empty; 31 | } 32 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ClientItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public struct ClientItem 4 | { 5 | private int realID; 6 | private int realAmount; 7 | private string realState; 8 | 9 | public int amount 10 | { 11 | get 12 | { 13 | return Sneaky.expose(this.realAmount); 14 | } 15 | set 16 | { 17 | this.realAmount = Sneaky.sneak(value); 18 | } 19 | } 20 | 21 | public int id 22 | { 23 | get 24 | { 25 | return Sneaky.expose(this.realID); 26 | } 27 | set 28 | { 29 | this.realID = Sneaky.sneak(value); 30 | } 31 | } 32 | 33 | public string state 34 | { 35 | get 36 | { 37 | return Sneaky.expose(this.realState); 38 | } 39 | set 40 | { 41 | this.realState = Sneaky.sneak(value); 42 | } 43 | } 44 | 45 | public ClientItem(ServerItem item) 46 | { 47 | this.realID = Sneaky.sneak(item.id); 48 | this.realAmount = Sneaky.sneak(item.amount); 49 | this.realState = Sneaky.sneak(item.state); 50 | } 51 | 52 | public ClientItem(int setID, int setAmount, string setState) 53 | { 54 | this.realID = Sneaky.sneak(setID); 55 | this.realAmount = Sneaky.sneak(setAmount); 56 | this.realState = Sneaky.sneak(setState); 57 | } 58 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Colors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Colors 5 | { 6 | public readonly static Color FREE; 7 | 8 | public readonly static Color PAID; 9 | 10 | public readonly static Color GOLD; 11 | 12 | public readonly static Color NVG_0; 13 | 14 | public readonly static Color NVG_1; 15 | 16 | static Colors() 17 | { 18 | Colors.FREE = new Color(0.95f, 0.95f, 0.95f); 19 | Colors.PAID = new Color(0.5f, 0.5f, 0.5f); 20 | Colors.GOLD = new Color(0.8509804f, 0.68235296f, 0.101960786f); 21 | Colors.NVG_0 = new Color(0f, 0.75f, 0f); 22 | Colors.NVG_1 = new Color(0.5f, 0.5f, 0.5f); 23 | } 24 | 25 | public Colors() 26 | { 27 | } 28 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Consumeable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Consumeable : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool yum; 9 | 10 | private bool done; 11 | 12 | public Consumeable() 13 | { 14 | } 15 | 16 | [RPC] 17 | public void askConsume() 18 | { 19 | if (!base.GetComponent().dead) 20 | { 21 | base.GetComponent().eat(ConsumeableStats.getFood(base.GetComponent().item)); 22 | base.GetComponent().drink(ConsumeableStats.getWater(base.GetComponent().item)); 23 | base.GetComponent().infect(ConsumeableStats.getSickness(base.GetComponent().item)); 24 | } 25 | } 26 | 27 | public override void equip() 28 | { 29 | Viewmodel.play("equip"); 30 | } 31 | 32 | public override void startPrimary() 33 | { 34 | Equipment.busy = true; 35 | this.startedUse = Time.realtimeSinceStartup; 36 | Viewmodel.play("use"); 37 | } 38 | 39 | public override void tick() 40 | { 41 | if (!this.yum && Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length * 0.1f) 42 | { 43 | this.yum = true; 44 | NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); 45 | } 46 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 47 | { 48 | this.done = true; 49 | if (!Network.isServer) 50 | { 51 | base.networkView.RPC("askConsume", RPCMode.Server, new object[0]); 52 | } 53 | else 54 | { 55 | this.askConsume(); 56 | } 57 | base.GetComponent().rest(ConsumeableStats.getStamina(Equipment.id)); 58 | Equipment.use(); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Cooking.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Cooking 5 | { 6 | public Cooking() 7 | { 8 | } 9 | 10 | public static bool fire(Vector3 position) 11 | { 12 | Collider[] colliderArray = Physics.OverlapSphere(position, 8f, 32768); 13 | for (int i = 0; i < (int)colliderArray.Length; i++) 14 | { 15 | if (colliderArray[i].transform.parent.name == "16013" && colliderArray[i].GetComponent().state) 16 | { 17 | return true; 18 | } 19 | } 20 | return false; 21 | } 22 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Coord2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public struct Coord2 4 | { 5 | public readonly static Coord2 ZERO; 6 | 7 | public int offset_x; 8 | 9 | public int offset_y; 10 | 11 | public float scale_x; 12 | 13 | public float scale_y; 14 | 15 | static Coord2() 16 | { 17 | Coord2.ZERO = new Coord2(0, 0, 0f, 0f); 18 | } 19 | 20 | public Coord2(int newOffset_x, int newOffset_y) 21 | { 22 | this.offset_x = newOffset_x; 23 | this.offset_y = newOffset_y; 24 | this.scale_x = 0f; 25 | this.scale_y = 0f; 26 | } 27 | 28 | public Coord2(float newScale_x, float newScale_y) 29 | { 30 | this.offset_x = 0; 31 | this.offset_y = 0; 32 | this.scale_x = newScale_x; 33 | this.scale_y = newScale_y; 34 | } 35 | 36 | public Coord2(int newOffset_x, int newOffset_y, float newScale_x, float newScale_y) 37 | { 38 | this.offset_x = newOffset_x; 39 | this.offset_y = newOffset_y; 40 | this.scale_x = newScale_x; 41 | this.scale_y = newScale_y; 42 | } 43 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/DamageMultiplier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class DamageMultiplier 4 | { 5 | public DamageMultiplier() 6 | { 7 | } 8 | 9 | public static float getMultiplierPlayer(int limb) 10 | { 11 | if (ServerSettings.mode != 2) 12 | { 13 | switch (limb) 14 | { 15 | case 0: 16 | { 17 | return 0.1f; 18 | } 19 | case 1: 20 | { 21 | return 0.3f; 22 | } 23 | case 2: 24 | { 25 | return 0.1f; 26 | } 27 | case 3: 28 | { 29 | return 0.3f; 30 | } 31 | case 4: 32 | { 33 | return 1.05f; 34 | } 35 | case 5: 36 | { 37 | return 0.6f; 38 | } 39 | } 40 | } 41 | else 42 | { 43 | switch (limb) 44 | { 45 | case 0: 46 | { 47 | return 0.25f; 48 | } 49 | case 1: 50 | { 51 | return 0.4f; 52 | } 53 | case 2: 54 | { 55 | return 0.25f; 56 | } 57 | case 3: 58 | { 59 | return 0.4f; 60 | } 61 | case 4: 62 | { 63 | return 1.2f; 64 | } 65 | case 5: 66 | { 67 | return 0.95f; 68 | } 69 | } 70 | } 71 | return 1f; 72 | } 73 | 74 | public static float getMultiplierZombie(int limb) 75 | { 76 | if (ServerSettings.mode != 2) 77 | { 78 | switch (limb) 79 | { 80 | case 0: 81 | { 82 | return 0.2f; 83 | } 84 | case 1: 85 | { 86 | return 0.4f; 87 | } 88 | case 2: 89 | { 90 | return 0.2f; 91 | } 92 | case 3: 93 | { 94 | return 0.4f; 95 | } 96 | case 4: 97 | { 98 | return 1.55f; 99 | } 100 | case 5: 101 | { 102 | return 0.6f; 103 | } 104 | } 105 | } 106 | else 107 | { 108 | switch (limb) 109 | { 110 | case 0: 111 | { 112 | return 0.1f; 113 | } 114 | case 1: 115 | { 116 | return 0.2f; 117 | } 118 | case 2: 119 | { 120 | return 0.1f; 121 | } 122 | case 3: 123 | { 124 | return 0.2f; 125 | } 126 | case 4: 127 | { 128 | return 1f; 129 | } 130 | case 5: 131 | { 132 | return 0.5f; 133 | } 134 | } 135 | } 136 | return 1f; 137 | } 138 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Dedicated.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Dedicated : MonoBehaviour 5 | { 6 | public Dedicated() 7 | { 8 | } 9 | 10 | private void Start() 11 | { 12 | Screen.SetResolution(800, 600, false); 13 | } 14 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/DefaultTalkController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | [AddComponentMenu("USpeak/Default Talk Controller")] 5 | public class DefaultTalkController : MonoBehaviour 6 | { 7 | [HideInInspector] 8 | [SerializeField] 9 | public KeyCode TriggerKey; 10 | 11 | [HideInInspector] 12 | [SerializeField] 13 | public int ToggleMode; 14 | 15 | private bool val; 16 | 17 | public DefaultTalkController() 18 | { 19 | } 20 | 21 | public void OnInspectorGUI() 22 | { 23 | } 24 | 25 | public bool ShouldSend() 26 | { 27 | if (this.ToggleMode == 0) 28 | { 29 | this.val = Input.GetKey(this.TriggerKey); 30 | } 31 | else if (Input.GetKeyDown(this.TriggerKey)) 32 | { 33 | this.val = !this.val; 34 | } 35 | return this.val; 36 | } 37 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/DyeColor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class DyeColor 5 | { 6 | public readonly static Color[] COLORS; 7 | 8 | static DyeColor() 9 | { 10 | DyeColor.COLORS = new Color[] { new Color(1f, 1f, 1f), new Color(1f, 0f, 0f) }; 11 | } 12 | 13 | public DyeColor() 14 | { 15 | } 16 | 17 | public static Color getColor(int id) 18 | { 19 | return DyeColor.COLORS[id]; 20 | } 21 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ElectricTrap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class ElectricTrap : MonoBehaviour 5 | { 6 | public bool powered; 7 | 8 | private bool sparks; 9 | 10 | public ElectricTrap() 11 | { 12 | } 13 | 14 | public void OnTriggerEnter(Collider other) 15 | { 16 | if (other.tag == "Player" && this.powered) 17 | { 18 | InteractionInterface.sendTrap(base.transform.parent.position); 19 | NetworkSounds.askSound("Sounds/Barricades/electrocute", other.transform.position + Vector3.up, 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 0.25f); 20 | NetworkEffects.askEffect("Effects/flesh", other.transform.position + Vector3.up, Quaternion.identity, -1f); 21 | } 22 | } 23 | 24 | public void setPowered(bool setPowered) 25 | { 26 | if (setPowered != this.powered) 27 | { 28 | this.powered = setPowered; 29 | if (!this.powered) 30 | { 31 | this.setSparks(false); 32 | } 33 | else 34 | { 35 | this.setSparks(true); 36 | } 37 | } 38 | } 39 | 40 | public void setSparks(bool setSparks) 41 | { 42 | if (setSparks != this.sparks) 43 | { 44 | this.sparks = setSparks; 45 | if (!this.sparks) 46 | { 47 | base.transform.parent.FindChild("spark").GetComponent().Stop(); 48 | } 49 | else 50 | { 51 | base.transform.parent.FindChild("spark").GetComponent().Play(); 52 | } 53 | } 54 | } 55 | 56 | public void Start() 57 | { 58 | this.setPowered(Electricity.checkPower(base.transform.position, 8f)); 59 | } 60 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Electricity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Electricity 5 | { 6 | public Electricity() 7 | { 8 | } 9 | 10 | public static void applyPower(Vector3 position, float range) 11 | { 12 | Collider[] colliderArray = Physics.OverlapSphere(position, range, 32768); 13 | for (int i = 0; i < (int)colliderArray.Length; i++) 14 | { 15 | if (colliderArray[i].transform.parent.name == "16002") 16 | { 17 | colliderArray[i].GetComponent().setPowered(Electricity.checkPower(colliderArray[i].transform.position, 8f)); 18 | } 19 | else if (colliderArray[i].transform.parent.name == "16009" || colliderArray[i].transform.parent.name == "16021") 20 | { 21 | colliderArray[i].GetComponent().setPowered(Electricity.checkPower(colliderArray[i].transform.position, 8f)); 22 | } 23 | } 24 | } 25 | 26 | public static bool checkPower(Vector3 position, float range) 27 | { 28 | Collider[] colliderArray = Physics.OverlapSphere(position, range, 32768); 29 | for (int i = 0; i < (int)colliderArray.Length; i++) 30 | { 31 | if (colliderArray[i].transform.parent.name == "16007" && colliderArray[i].GetComponent().state) 32 | { 33 | return true; 34 | } 35 | } 36 | return false; 37 | } 38 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Epoch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Epoch 5 | { 6 | public static int serverTime = -1; 7 | 8 | public Epoch() 9 | { 10 | } 11 | 12 | public static int getSeconds() 13 | { 14 | return Epoch.serverTime + (int)Time.realtimeSinceStartup; 15 | } 16 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ExplosionTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class ExplosionTool : MonoBehaviour 5 | { 6 | public ExplosionTool() 7 | { 8 | } 9 | 10 | public static void explode(Vector3 position, float range, int damage) 11 | { 12 | Collider[] colliderArray = Physics.OverlapSphere(position, range, RayMasks.ATTACKABLE); 13 | for (int i = 0; i < (int)colliderArray.Length; i++) 14 | { 15 | if (RayMasks.isVisible(position, colliderArray[i].transform.position + Vector3.up)) 16 | { 17 | if (colliderArray[i].tag == "Player") 18 | { 19 | if (ServerSettings.pvp) 20 | { 21 | colliderArray[i].GetComponent().damage(damage, "You were blown up by an explosion.", -2, ""); 22 | NetworkEffects.askEffect("Effects/flesh", colliderArray[i].transform.position + Vector3.up, Quaternion.identity, -1f); 23 | } 24 | } 25 | else if (colliderArray[i].tag == "Enemy") 26 | { 27 | if (ServerSettings.pvp) 28 | { 29 | GameObject owner = OwnerFinder.getOwner(colliderArray[i].gameObject); 30 | owner.GetComponent().damage(damage, "You were blown up by an explosion.", -2, ""); 31 | NetworkEffects.askEffect("Effects/flesh", colliderArray[i].transform.position + Vector3.up, Quaternion.identity, -1f); 32 | } 33 | } 34 | else if (colliderArray[i].tag == "Animal") 35 | { 36 | GameObject gameObject = OwnerFinder.getOwner(colliderArray[i].gameObject); 37 | gameObject.GetComponent().damage(damage); 38 | NetworkEffects.askEffect("Effects/flesh", colliderArray[i].transform.position + Vector3.up, Quaternion.identity, -1f); 39 | } 40 | else if (colliderArray[i].tag == "Barricade") 41 | { 42 | if (ServerSettings.pvp) 43 | { 44 | SpawnBarricades.damage(colliderArray[i].transform.parent.position, damage); 45 | } 46 | } 47 | else if (colliderArray[i].tag == "Structure") 48 | { 49 | if (ServerSettings.pvp) 50 | { 51 | // FIXME: explosion to structures? 52 | //SpawnStructures.damage(colliderArray[i].transform.parent.position, damage); 53 | } 54 | } 55 | else if (colliderArray[i].tag == "Vehicle" && ServerSettings.pvp) 56 | { 57 | colliderArray[i].GetComponent().damage(damage); 58 | } 59 | } 60 | } 61 | SpawnAnimals.attract(position + Vector3.up, 64f); 62 | } 63 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/FaceStyles.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class FaceStyles 4 | { 5 | public readonly static int[] FACES; 6 | 7 | static FaceStyles() 8 | { 9 | FaceStyles.FACES = new int[] { 6001, 6014, 6010, 6004, 6015, 6005, 6002, 6008, 6009, 6000, 6006, 6003, 6007, 6017, 6012, 6013, 6011, 6016 }; 10 | } 11 | 12 | public FaceStyles() 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/FancyAnimifier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class FancyAnimifier : MonoBehaviour 5 | { 6 | public readonly static float FADE; 7 | 8 | private string playID = string.Empty; 9 | 10 | private float startedPlay; 11 | 12 | private string stanceID = string.Empty; 13 | 14 | private Animation anim; 15 | 16 | static FancyAnimifier() 17 | { 18 | FancyAnimifier.FADE = 0.25f; 19 | } 20 | 21 | public FancyAnimifier() 22 | { 23 | } 24 | 25 | public void play(string id) 26 | { 27 | if (id != this.playID) 28 | { 29 | this.playID = id; 30 | this.startedPlay = Time.realtimeSinceStartup; 31 | } 32 | } 33 | 34 | public void stance(string id) 35 | { 36 | this.stanceID = id; 37 | } 38 | 39 | public void Start() 40 | { 41 | this.anim = base.transform.FindChild("character").animation; 42 | } 43 | 44 | public void Update() 45 | { 46 | /* 47 | if (this.anim != null) 48 | { 49 | if (this.playID != string.Empty) 50 | { 51 | if (Time.realtimeSinceStartup - this.startedPlay >= this.anim[this.playID].length) 52 | { 53 | this.playID = string.Empty; 54 | } 55 | else 56 | { 57 | this.anim.Play(this.playID); 58 | } 59 | } 60 | else if (this.stanceID != string.Empty) 61 | { 62 | this.anim.CrossFade(this.stanceID, FancyAnimifier.FADE); 63 | } 64 | } 65 | */ 66 | } 67 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Fertilizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Fertilizer : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private GameObject target; 9 | 10 | private bool done; 11 | 12 | private static RaycastHit hit; 13 | 14 | public Fertilizer() 15 | { 16 | } 17 | 18 | public override void equip() 19 | { 20 | Viewmodel.play("equip"); 21 | } 22 | 23 | public override void startPrimary() 24 | { 25 | Physics.Raycast(Camera.main.transform.position + (Camera.main.transform.forward * -0.5f), Camera.main.transform.forward, out Fertilizer.hit, 5f, -29365511); 26 | if (Fertilizer.hit.collider != null && Fertilizer.hit.collider.tag == "Barricade" && ItemType.getType(int.Parse(Fertilizer.hit.collider.transform.parent.name)) == 22) 27 | { 28 | this.target = Fertilizer.hit.collider.gameObject; 29 | NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); 30 | Equipment.busy = true; 31 | this.startedUse = Time.realtimeSinceStartup; 32 | Viewmodel.play("use"); 33 | } 34 | } 35 | 36 | public override void tick() 37 | { 38 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 39 | { 40 | this.done = true; 41 | if (this.target != null) 42 | { 43 | InteractionInterface.sendFertilize(this.target.transform.parent.position); 44 | } 45 | Equipment.use(); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Flare.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Flare : MonoBehaviour 5 | { 6 | public Flare() 7 | { 8 | } 9 | 10 | public void attract() 11 | { 12 | SpawnAnimals.attract(base.transform.position + Vector3.up, 30f); 13 | } 14 | 15 | public void Start() 16 | { 17 | if (Network.isServer) 18 | { 19 | base.Invoke("attract", 2f); 20 | } 21 | UnityEngine.Object.Destroy(base.gameObject, 180f); 22 | } 23 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/GameSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class GameSettings 5 | { 6 | public static bool metric; 7 | 8 | public static float fov; 9 | 10 | public static bool music; 11 | 12 | public static bool gore; 13 | 14 | public static bool fps; 15 | 16 | public static bool voice; 17 | 18 | public static float volume; 19 | 20 | static GameSettings() 21 | { 22 | GameSettings.metric = PlayerPrefs.GetInt("gameSettings_Metric", 1) == 1; 23 | GameSettings.fov = PlayerPrefs.GetFloat("gameSettings_FOV", 90f); 24 | GameSettings.music = PlayerPrefs.GetInt("gameSettings_Music", 1) == 1; 25 | GameSettings.gore = PlayerPrefs.GetInt("gameSettings_Gore", 1) == 1; 26 | GameSettings.fps = PlayerPrefs.GetInt("gameSettings_FPS", 0) == 1; 27 | GameSettings.voice = PlayerPrefs.GetInt("gameSettings_Voice", 0) == 1; 28 | GameSettings.volume = PlayerPrefs.GetFloat("gameSettings_Volume", 1f); 29 | } 30 | 31 | public GameSettings() 32 | { 33 | } 34 | 35 | public static void save() 36 | { 37 | PlayerPrefs.SetInt("gameSettings_Metric", (!GameSettings.metric ? 0 : 1)); 38 | PlayerPrefs.SetFloat("gameSettings_FOV", GameSettings.fov); 39 | PlayerPrefs.SetInt("gameSettings_Music", (!GameSettings.music ? 0 : 1)); 40 | PlayerPrefs.SetInt("gameSettings_Gore", (!GameSettings.gore ? 0 : 1)); 41 | PlayerPrefs.SetInt("gameSettings_FPS", (!GameSettings.fps ? 0 : 1)); 42 | PlayerPrefs.SetInt("gameSettings_Voice", (!GameSettings.voice ? 0 : 1)); 43 | PlayerPrefs.SetFloat("gameSettings_Volume", GameSettings.volume); 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Generator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Generator : Interactable 5 | { 6 | public bool state; 7 | 8 | public Generator() 9 | { 10 | } 11 | 12 | public override string hint() 13 | { 14 | if (this.state) 15 | { 16 | return "Turn Off"; 17 | } 18 | return "Turn On"; 19 | } 20 | 21 | public void OnDestroy() 22 | { 23 | this.state = false; 24 | Electricity.applyPower(base.transform.position, 8f); 25 | } 26 | 27 | public void setState(bool setState) 28 | { 29 | if (setState != this.state) 30 | { 31 | this.state = setState; 32 | if (!this.state) 33 | { 34 | base.audio.Stop(); 35 | } 36 | else 37 | { 38 | base.audio.Play(); 39 | } 40 | Electricity.applyPower(base.transform.position, 8f); 41 | } 42 | } 43 | 44 | public void Start() 45 | { 46 | InteractionInterface.requestGenerator(base.transform.parent.position); 47 | } 48 | 49 | public override void trigger() 50 | { 51 | InteractionInterface.sendGenerator(base.transform.parent.position); 52 | NetworkSounds.askSound("Sounds/General/firemode", base.transform.position, 0.1f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); 53 | } 54 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Gore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Gore : MonoBehaviour 5 | { 6 | private static RaycastHit hit; 7 | 8 | public Gore() 9 | { 10 | } 11 | 12 | public void Awake() 13 | { 14 | if (!GameSettings.gore) 15 | { 16 | UnityEngine.Object.Destroy(base.gameObject); 17 | } 18 | else 19 | { 20 | for (int i = 0; i < 5; i++) 21 | { 22 | Physics.Raycast(base.transform.position, new Vector3(UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f)), out Gore.hit, 16f, 34342913); 23 | if (Gore.hit.collider != null) 24 | { 25 | float single = UnityEngine.Random.Range(0.75f, 1.25f); 26 | GameObject vector3 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load(string.Concat("Effects/blood_", UnityEngine.Random.Range(0, 4))), Gore.hit.point + (Gore.hit.normal * UnityEngine.Random.Range(0.04f, 0.06f)), Quaternion.LookRotation(Gore.hit.normal) * Quaternion.Euler(0f, 0f, (float)UnityEngine.Random.Range(0, 360))); 27 | vector3.name = "blood"; 28 | vector3.transform.parent = NetworkEffects.model.transform; 29 | vector3.transform.localScale = new Vector3(single, single, single); 30 | UnityEngine.Object.Destroy(vector3, 20f); 31 | } 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Ground.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Ground : MonoBehaviour 5 | { 6 | private static Terrain terrain; 7 | 8 | private static TerrainData data; 9 | 10 | public Ground() 11 | { 12 | } 13 | 14 | public void Awake() 15 | { 16 | Ground.terrain = base.GetComponent(); 17 | Ground.data = (TerrainData)UnityEngine.Object.Instantiate(Ground.terrain.terrainData); 18 | Ground.terrain.terrainData = Ground.data; 19 | } 20 | 21 | public static void clear(Vector3 position, int size) 22 | { 23 | float single = position.x - Ground.terrain.transform.position.x; 24 | Vector3 vector3 = Ground.data.size; 25 | int num = (int)(single / vector3.x * (float)Ground.data.detailWidth); 26 | float single1 = position.z - Ground.terrain.transform.position.z; 27 | Vector3 vector31 = Ground.data.size; 28 | int num1 = (int)(single1 / vector31.z * (float)Ground.data.detailHeight); 29 | int[,] numArray = new int[size, size]; 30 | for (int i = 0; i < (int)Ground.data.detailPrototypes.Length; i++) 31 | { 32 | Ground.data.SetDetailLayer(num - size / 2, num1 - size / 2, i, numArray); 33 | } 34 | } 35 | 36 | public static float height(Vector3 position) 37 | { 38 | if (Ground.terrain == null) 39 | { 40 | return -1f; 41 | } 42 | return Ground.terrain.SampleHeight(position); 43 | } 44 | 45 | public static int material(Vector3 position) 46 | { 47 | TerrainData terrainDatum = Ground.terrain.terrainData; 48 | float single = position.x - Ground.terrain.transform.position.x; 49 | Vector3 vector3 = Ground.terrain.terrainData.size; 50 | int num = (int)(single / vector3.x * (float)Ground.terrain.terrainData.alphamapWidth); 51 | float single1 = position.z - Ground.terrain.transform.position.z; 52 | Vector3 vector31 = Ground.terrain.terrainData.size; 53 | float[,,] alphamaps = terrainDatum.GetAlphamaps(num, (int)(single1 / vector31.z * (float)Ground.terrain.terrainData.alphamapHeight), 1, 1); 54 | float[] singleArray = new float[alphamaps.GetUpperBound(2) + 1]; 55 | for (int i = 0; i < (int)singleArray.Length; i++) 56 | { 57 | singleArray[i] = alphamaps[0, 0, i]; 58 | } 59 | float single2 = 0f; 60 | int num1 = 0; 61 | for (int j = 0; j < (int)singleArray.Length; j++) 62 | { 63 | if (singleArray[j] > single2) 64 | { 65 | num1 = j; 66 | single2 = singleArray[j]; 67 | } 68 | } 69 | return num1; 70 | } 71 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/HairColor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class HairColor 5 | { 6 | public readonly static Color[] COLORS; 7 | 8 | static HairColor() 9 | { 10 | HairColor.COLORS = new Color[] { 11 | new Color(0.09803922f, 0.09803922f, 0.09803922f), 12 | new Color(0.196078435f, 0.196078435f, 0.196078435f), 13 | new Color(0.254901975f, 0.223529413f, 0.203921571f), 14 | new Color(0.3529412f, 0.3019608f, 0.266666681f), 15 | new Color(0.454901963f, 0.384313732f, 0.3372549f), 16 | new Color(0.654902f, 0.654902f, 0.654902f), 17 | new Color(0.75686276f, 0.7019608f, 0.627451f), 18 | new Color(0.8509804f, 0.8f, 0.7254902f), 19 | new Color(0.8117647f, 0.8117647f, 0.8117647f), 20 | new Color(0.6039216f, 0.02745098f, 0.02745098f), 21 | new Color(0.6627451f, 0.396078438f, 0.101960786f), 22 | new Color(0.419607848f, 0.168627456f, 0.443137258f), 23 | new Color(0.203921571f, 0.3137255f, 0.5176471f), 24 | new Color(0.05882353f, 0.478431374f, 0.4627451f), 25 | new Color(0.0235294122f, 0.5372549f, 0.007843138f), 26 | new Color(0.309803933f, 0.407843143f, 0.309803933f), 27 | new Color(0.65882355f, 0.596078455f, 0.0509803928f), 28 | new Color(0.6901961f, 0.427450985f, 0.0509803928f) }; 29 | } 30 | 31 | public HairColor() 32 | { 33 | } 34 | 35 | public static Color getColor(int id) 36 | { 37 | return HairColor.COLORS[id]; 38 | } 39 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/HairStyles.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class HairStyles 4 | { 5 | public readonly static int[] HAIRS; 6 | 7 | static HairStyles() 8 | { 9 | HairStyles.HAIRS = new int[] { 10 | 1000, 11 | 1001, 12 | 1011, 13 | 1002, 14 | 1013, 15 | 1003, 16 | 1015, 17 | 1016, 18 | 1006, 19 | 1008, 20 | 1009, 21 | 1010, 22 | 1012, 23 | 1007, 24 | 1005, 25 | 1004, 26 | 1014 27 | }; 28 | } 29 | 30 | public HairStyles() 31 | { 32 | } 33 | 34 | public static bool getBeard(int id) 35 | { 36 | switch (id) 37 | { 38 | case 1006: 39 | { 40 | return true; 41 | } 42 | case 1007: 43 | case 1011: 44 | { 45 | return false; 46 | } 47 | case 1008: 48 | { 49 | return true; 50 | } 51 | case 1009: 52 | { 53 | return true; 54 | } 55 | case 1010: 56 | { 57 | return true; 58 | } 59 | case 1012: 60 | { 61 | return true; 62 | } 63 | default: 64 | { 65 | return false; 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Harvest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Harvest : Interactable 5 | { 6 | private long state = (long)2147483647; 7 | 8 | private bool ready; 9 | 10 | public Harvest() 11 | { 12 | } 13 | 14 | public void grow() 15 | { 16 | if (!this.ready && (long)Epoch.getSeconds() - this.state > (long)HarvestStats.getGrowth(int.Parse(base.transform.parent.name))) 17 | { 18 | this.ready = true; 19 | base.renderer.material = (Material)Resources.Load(string.Concat("Models/Barricades/", base.transform.parent.name, "/matPlant")); 20 | } 21 | } 22 | 23 | public override string hint() 24 | { 25 | if (this.ready) 26 | { 27 | return "Harvest"; 28 | } 29 | return string.Empty; 30 | } 31 | 32 | public void setState(int setState) 33 | { 34 | if (this.state != (long)setState) 35 | { 36 | this.state = (long)setState; 37 | this.grow(); 38 | } 39 | } 40 | 41 | public void Start() 42 | { 43 | InteractionInterface.requestHarvest(base.transform.parent.position); 44 | base.InvokeRepeating("grow", UnityEngine.Random.Range(1f, 2f), 3f); 45 | } 46 | 47 | public override void trigger() 48 | { 49 | InteractionInterface.sendHarvest(base.transform.parent.position); 50 | } 51 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Images.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Images 5 | { 6 | public readonly static Texture2D pixel; 7 | 8 | public readonly static Texture2D binoculars; 9 | 10 | public static Texture2D cursor; 11 | 12 | static Images() 13 | { 14 | Images.pixel = (Texture2D)Resources.Load("Textures/Sleek/pixel"); 15 | Images.binoculars = (Texture2D)Resources.Load("Textures/Sleek/binoculars"); 16 | Images.cursor = (Texture2D)Resources.Load("Textures/Sleek/cursorFree"); 17 | } 18 | 19 | public Images() 20 | { 21 | } 22 | 23 | public static void swapPaid() 24 | { 25 | Images.cursor = (Texture2D)Resources.Load("Textures/Sleek/cursor"); 26 | } 27 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Interactable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Interactable : MonoBehaviour 5 | { 6 | public Interactable() 7 | { 8 | } 9 | 10 | public virtual string hint() 11 | { 12 | return string.Empty; 13 | } 14 | 15 | public virtual string icon() 16 | { 17 | return string.Empty; 18 | } 19 | 20 | public virtual void trigger() 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Item.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Item : Interactable 5 | { 6 | public Item() 7 | { 8 | } 9 | 10 | public override string hint() 11 | { 12 | return ItemName.getName(int.Parse(base.name)); 13 | } 14 | 15 | public override string icon() 16 | { 17 | return string.Concat("Textures/Items/", int.Parse(base.name)); 18 | } 19 | 20 | public override void trigger() 21 | { 22 | int num = Player.inventory.hasSpace(new ServerItem(int.Parse(base.name), 1, string.Empty, Vector3.zero)); 23 | if (num == 0) 24 | { 25 | if (Equipment.model == null) 26 | { 27 | Viewmodel.play("take"); 28 | } 29 | SpawnItems.takeItem(base.gameObject); 30 | } 31 | else if (num == 1) 32 | { 33 | //HUDGame.openError(Texts.ERROR_NO_SPACE, "Textures/Icons/errror"); 34 | } 35 | else if (num == 2) 36 | { 37 | //HUDGame.openError(Texts.ERROR_NO_WEIGHT, "Textures/Icons/errror"); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ItemAmount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class ItemAmount 4 | { 5 | public ItemAmount() 6 | { 7 | } 8 | 9 | public static int getAmount(int id) 10 | { 11 | switch (id) 12 | { 13 | case 10000: 14 | { 15 | return 31; 16 | } 17 | case 10001: 18 | { 19 | return 101; 20 | } 21 | case 10002: 22 | { 23 | return 8; 24 | } 25 | case 10003: 26 | { 27 | return 6; 28 | } 29 | case 10004: 30 | { 31 | return 14; 32 | } 33 | case 10005: 34 | { 35 | return 21; 36 | } 37 | case 10006: 38 | { 39 | return 31; 40 | } 41 | case 10007: 42 | { 43 | return 76; 44 | } 45 | case 10008: 46 | { 47 | return 7; 48 | } 49 | case 10009: 50 | { 51 | return 9; 52 | } 53 | case 10010: 54 | { 55 | return 7; 56 | } 57 | case 10011: 58 | { 59 | return 41; 60 | } 61 | case 10012: 62 | { 63 | return 11; 64 | } 65 | case 10013: 66 | { 67 | return 51; 68 | } 69 | } 70 | return 1; 71 | } 72 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ItemEquipable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class ItemEquipable 4 | { 5 | public ItemEquipable() 6 | { 7 | } 8 | 9 | public static bool getEquipable(int id) 10 | { 11 | int type = ItemType.getType(id); 12 | switch (type) 13 | { 14 | case 9: 15 | { 16 | return false; 17 | } 18 | case 10: 19 | { 20 | return false; 21 | } 22 | case 11: 23 | { 24 | return false; 25 | } 26 | case 12: 27 | { 28 | return false; 29 | } 30 | case 18: 31 | { 32 | return false; 33 | } 34 | case 19: 35 | { 36 | return false; 37 | } 38 | default: 39 | { 40 | if (type == 25) 41 | { 42 | break; 43 | } 44 | else 45 | { 46 | return true; 47 | } 48 | } 49 | } 50 | return false; 51 | } 52 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ItemStackable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class ItemStackable 4 | { 5 | public ItemStackable() 6 | { 7 | } 8 | 9 | public static bool getStackable(int id) 10 | { 11 | switch (ItemType.getType(id)) 12 | { 13 | case 13: 14 | { 15 | return true; 16 | } 17 | case 14: 18 | { 19 | return true; 20 | } 21 | case 15: 22 | { 23 | return true; 24 | } 25 | case 16: 26 | { 27 | return true; 28 | } 29 | case 17: 30 | { 31 | return true; 32 | } 33 | case 18: 34 | { 35 | return true; 36 | } 37 | case 19: 38 | { 39 | return true; 40 | } 41 | case 20: 42 | case 21: 43 | case 24: 44 | case 26: 45 | { 46 | return false; 47 | } 48 | case 22: 49 | { 50 | return true; 51 | } 52 | case 23: 53 | { 54 | return true; 55 | } 56 | case 25: 57 | { 58 | return true; 59 | } 60 | case 27: 61 | { 62 | return true; 63 | } 64 | default: 65 | { 66 | return false; 67 | } 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ItemType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class ItemType 4 | { 5 | public ItemType() 6 | { 7 | } 8 | 9 | public static int getType(int id) 10 | { 11 | return id / 1000; 12 | } 13 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Backpack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Backpack : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool wear; 9 | 10 | private bool done; 11 | 12 | public Backpack() 13 | { 14 | } 15 | 16 | public override void dequip() 17 | { 18 | if (this.wear) 19 | { 20 | Player.clothes.changeBackpack(Equipment.id); 21 | } 22 | } 23 | 24 | public override void equip() 25 | { 26 | Viewmodel.play("equip"); 27 | } 28 | 29 | public override void startPrimary() 30 | { 31 | Equipment.busy = true; 32 | this.startedUse = Time.realtimeSinceStartup; 33 | Viewmodel.play("use"); 34 | } 35 | 36 | public override void tick() 37 | { 38 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 39 | { 40 | this.done = true; 41 | this.wear = true; 42 | Equipment.use(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Bed.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Bed : Interactable 5 | { 6 | private string state = string.Empty; 7 | 8 | public Bed() 9 | { 10 | } 11 | 12 | public override string hint() 13 | { 14 | if (this.state == string.Empty) 15 | { 16 | return "Claim"; 17 | } 18 | if (this.state == PlayerSettings.id) 19 | { 20 | return "Unclaim"; 21 | } 22 | return string.Empty; 23 | } 24 | 25 | public void setState(string setState) 26 | { 27 | if (setState != this.state) 28 | { 29 | this.state = setState; 30 | } 31 | } 32 | 33 | public void Start() 34 | { 35 | InteractionInterface.requestBed(base.transform.parent.position); 36 | } 37 | 38 | public override void trigger() 39 | { 40 | InteractionInterface.sendBed(base.transform.parent.position); 41 | } 42 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Campfire.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Campfire : Interactable 5 | { 6 | public bool state; 7 | 8 | public Campfire() 9 | { 10 | } 11 | 12 | public override string hint() 13 | { 14 | if (this.state) 15 | { 16 | return "Extinguish"; 17 | } 18 | return "Light"; 19 | } 20 | 21 | public void setState(bool setState) 22 | { 23 | if (setState != this.state) 24 | { 25 | this.state = setState; 26 | if (!this.state) 27 | { 28 | base.audio.Stop(); 29 | base.transform.FindChild("fire").light.enabled = false; 30 | base.transform.FindChild("fire").GetComponent().Stop(); 31 | if (base.transform.FindChild("smoke") != null) 32 | { 33 | base.transform.FindChild("smoke").GetComponent().Stop(); 34 | } 35 | } 36 | else 37 | { 38 | base.audio.Play(); 39 | base.transform.FindChild("fire").light.enabled = true; 40 | base.transform.FindChild("fire").GetComponent().Play(); 41 | if (base.transform.FindChild("smoke") != null) 42 | { 43 | base.transform.FindChild("smoke").GetComponent().Play(); 44 | } 45 | } 46 | } 47 | } 48 | 49 | public void Start() 50 | { 51 | InteractionInterface.requestCampfire(base.transform.parent.position); 52 | } 53 | 54 | public override void trigger() 55 | { 56 | InteractionInterface.sendCampfire(base.transform.parent.position); 57 | } 58 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Crate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Crate : Interactable 5 | { 6 | private string state = string.Empty; 7 | 8 | private ClientItem[,] items; 9 | 10 | public Crate() 11 | { 12 | } 13 | 14 | public override string hint() 15 | { 16 | return "Storage"; 17 | } 18 | 19 | public void setState(string setState) 20 | { 21 | if (setState != this.state) 22 | { 23 | this.state = setState; 24 | } 25 | this.items = InteractionInterface.getCrateItems(int.Parse(base.transform.parent.name), Sneaky.expose(this.state)); 26 | if (Interact.edit == base.gameObject) 27 | { 28 | //HUDInteract.crate(int.Parse(base.transform.parent.name), this.items); 29 | } 30 | } 31 | 32 | public void Start() 33 | { 34 | InteractionInterface.requestCrate(base.transform.parent.position); 35 | } 36 | 37 | public override void trigger() 38 | { 39 | //HUDInteract.crate(int.Parse(base.transform.parent.name), this.items); 40 | Interact.interact(base.gameObject); 41 | } 42 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Door.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Door : Interactable 5 | { 6 | private bool state; 7 | 8 | private string player = string.Empty; 9 | 10 | private string friend = string.Empty; 11 | 12 | public Door() 13 | { 14 | } 15 | 16 | public override string hint() 17 | { 18 | if (!(this.player == PlayerSettings.id) && (!(PlayerSettings.friendHash != string.Empty) || !(PlayerSettings.friendHash == this.friend))) 19 | { 20 | return string.Empty; 21 | } 22 | if (this.state) 23 | { 24 | return "Close"; 25 | } 26 | return "Open"; 27 | } 28 | 29 | public void setOwner(string setPlayer, string setFriend) 30 | { 31 | this.player = setPlayer; 32 | this.friend = setFriend; 33 | } 34 | 35 | public void setState(bool setState) 36 | { 37 | if (setState != this.state) 38 | { 39 | this.state = setState; 40 | if (!this.state) 41 | { 42 | base.animation.Play("close"); 43 | } 44 | else 45 | { 46 | base.animation.Play("open"); 47 | } 48 | } 49 | } 50 | 51 | public void Start() 52 | { 53 | InteractionInterface.requestDoor(base.transform.parent.position); 54 | } 55 | 56 | public override void trigger() 57 | { 58 | InteractionInterface.sendDoor(base.transform.parent.position); 59 | } 60 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Hat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Hat : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool wear; 9 | 10 | private bool done; 11 | 12 | public Hat() 13 | { 14 | } 15 | 16 | public override void dequip() 17 | { 18 | if (this.wear) 19 | { 20 | Player.clothes.changeHat(Equipment.id); 21 | } 22 | } 23 | 24 | public override void equip() 25 | { 26 | Viewmodel.play("equip"); 27 | } 28 | 29 | public override void startPrimary() 30 | { 31 | Equipment.busy = true; 32 | this.startedUse = Time.realtimeSinceStartup; 33 | Viewmodel.play("use"); 34 | } 35 | 36 | public override void tick() 37 | { 38 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 39 | { 40 | this.done = true; 41 | this.wear = true; 42 | Equipment.use(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Shirt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Shirt : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool wear; 9 | 10 | private bool done; 11 | 12 | public Shirt() 13 | { 14 | } 15 | 16 | public override void dequip() 17 | { 18 | if (this.wear) 19 | { 20 | Player.clothes.changeShirt(Equipment.id); 21 | } 22 | } 23 | 24 | public override void equip() 25 | { 26 | Viewmodel.play("equip"); 27 | } 28 | 29 | public override void startPrimary() 30 | { 31 | Equipment.busy = true; 32 | this.startedUse = Time.realtimeSinceStartup; 33 | Viewmodel.play("use"); 34 | } 35 | 36 | public override void tick() 37 | { 38 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 39 | { 40 | this.done = true; 41 | this.wear = true; 42 | Equipment.use(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Trap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Trap : MonoBehaviour 5 | { 6 | public Trap() 7 | { 8 | } 9 | 10 | public void OnTriggerEnter(Collider other) 11 | { 12 | if (other.tag == "Player") 13 | { 14 | InteractionInterface.sendTrap(base.transform.parent.position); 15 | NetworkSounds.askSound("Sounds/Barricades/spike", other.transform.position + Vector3.up, 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 0.25f); 16 | NetworkEffects.askEffect("Effects/flesh", other.transform.position + Vector3.up, Quaternion.identity, -1f); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Vest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Vest : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool wear; 9 | 10 | private bool done; 11 | 12 | public Vest() 13 | { 14 | } 15 | 16 | public override void dequip() 17 | { 18 | if (this.wear) 19 | { 20 | Player.clothes.changeVest(Equipment.id); 21 | } 22 | } 23 | 24 | public override void equip() 25 | { 26 | Viewmodel.play("equip"); 27 | } 28 | 29 | public override void startPrimary() 30 | { 31 | Equipment.busy = true; 32 | this.startedUse = Time.realtimeSinceStartup; 33 | Viewmodel.play("use"); 34 | } 35 | 36 | public override void tick() 37 | { 38 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 39 | { 40 | this.done = true; 41 | this.wear = true; 42 | Equipment.use(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Weapons/Explosive.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Explosive : Interactable 5 | { 6 | public Explosive() 7 | { 8 | } 9 | 10 | public void explode() 11 | { 12 | InteractionInterface.sendExplosive(base.transform.parent.position); 13 | } 14 | 15 | public void Start() 16 | { 17 | if (Network.isServer) 18 | { 19 | base.Invoke("explode", 5f); 20 | } 21 | base.audio.Play(); 22 | } 23 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Weapons/ExplosiveTrap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class ExplosiveTrap : MonoBehaviour 5 | { 6 | public ExplosiveTrap() 7 | { 8 | } 9 | 10 | public void OnTriggerEnter(Collider other) 11 | { 12 | if (other.tag == "Player") 13 | { 14 | InteractionInterface.sendExplosiveTrap(base.transform.parent.position); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Weapons/Grenade.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Grenade : MonoBehaviour 5 | { 6 | public Grenade() 7 | { 8 | } 9 | 10 | public void OnDestroy() 11 | { 12 | if (Network.isServer) 13 | { 14 | ExplosionTool.explode(base.transform.position, (float)ExplosiveStats.getRange(23007), ExplosiveStats.getDamage(23007)); 15 | NetworkEffects.askEffect("Effects/grenade", base.transform.position + Vector3.up, Quaternion.Euler(-90f, 0f, 0f), -1f); 16 | NetworkEffects.askEffect("Effects/rubble", base.transform.position, Quaternion.Euler(-90f, 0f, 0f), -1f); 17 | NetworkSounds.askSound("Sounds/Projectiles/grenade", base.transform.position, 1f, UnityEngine.Random.Range(0.95f, 1.05f), 2f); 18 | } 19 | } 20 | 21 | public void Start() 22 | { 23 | UnityEngine.Object.Destroy(base.gameObject, 1f); 24 | } 25 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Weapons/Snare.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Snare : MonoBehaviour 5 | { 6 | public Snare() 7 | { 8 | } 9 | 10 | public void OnTriggerEnter(Collider other) 11 | { 12 | if (other.tag == "Player") 13 | { 14 | InteractionInterface.sendTrap(base.transform.parent.position); 15 | if (ServerSettings.pvp) 16 | { 17 | Player.life.sendBones(); 18 | } 19 | NetworkSounds.askSound("Sounds/Barricades/snare", other.transform.position + Vector3.up, 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 0.25f); 20 | NetworkEffects.askEffect("Effects/flesh", other.transform.position + Vector3.up, Quaternion.identity, -1f); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Items/Weapons/Weapon.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, GW-Systems Kft. All Rights Reserved 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | using System; 29 | using UnityEngine; 30 | 31 | public class Weapon 32 | { 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ItemsRegion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class ItemsRegion 6 | { 7 | public List items; 8 | 9 | public List models; 10 | 11 | public float cooldown; 12 | 13 | public ItemsRegion() 14 | { 15 | this.items = new List(); 16 | this.models = new List(); 17 | } 18 | 19 | public static bool acceptable(Point2 a, Point2 b) 20 | { 21 | return (!ItemsRegion.acceptable(a.x, b.y) ? false : ItemsRegion.acceptable(a.y, b.y)); 22 | } 23 | 24 | public static bool acceptable(int a, int b) 25 | { 26 | return (a == b || a == b - 1 ? true : a == b + 1); 27 | } 28 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Jack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Jack : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private GameObject target; 9 | 10 | private bool done; 11 | 12 | private static RaycastHit hit; 13 | 14 | public Jack() 15 | { 16 | } 17 | 18 | public override void equip() 19 | { 20 | Viewmodel.play("equip"); 21 | } 22 | 23 | public override void startPrimary() 24 | { 25 | Physics.Raycast(Camera.main.transform.position + (Camera.main.transform.forward * -0.5f), Camera.main.transform.forward, out Jack.hit, 5f, -29365511); 26 | if (Jack.hit.collider != null && Jack.hit.collider.tag == "Vehicle" && Jack.hit.collider.GetComponent().lastSpeed == 0) 27 | { 28 | this.target = Jack.hit.collider.gameObject; 29 | NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); 30 | Equipment.busy = true; 31 | this.startedUse = Time.realtimeSinceStartup; 32 | Viewmodel.play("use"); 33 | } 34 | } 35 | 36 | public override void tick() 37 | { 38 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 39 | { 40 | this.done = true; 41 | if (this.target != null) 42 | { 43 | if (!Network.isServer) 44 | { 45 | base.networkView.RPC("useVehicle", RPCMode.Server, new object[] { this.target.networkView.viewID }); 46 | } 47 | else 48 | { 49 | this.useVehicle(this.target.networkView.viewID); 50 | } 51 | } 52 | Equipment.dequip(); 53 | } 54 | } 55 | 56 | [RPC] 57 | public void useVehicle(NetworkViewID id) 58 | { 59 | if (!base.GetComponent().dead) 60 | { 61 | GameObject gameObject = NetworkView.Find(id).gameObject; 62 | if (gameObject != null) 63 | { 64 | bool flag = true; 65 | for (int i = 0; i < (int)gameObject.GetComponent().passengers.Length; i++) 66 | { 67 | if (gameObject.GetComponent().passengers[i] != null) 68 | { 69 | flag = false; 70 | } 71 | } 72 | if (flag && gameObject.GetComponent().lastSpeed == 0) 73 | { 74 | gameObject.rigidbody.AddForce(new Vector3(0f, 11f, 0f), ForceMode.Impulse); 75 | gameObject.rigidbody.AddTorque(new Vector3((float)UnityEngine.Random.Range(-11, 11), 0f, 0f), ForceMode.Impulse); 76 | } 77 | } 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Lamp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Lamp : Interactable 5 | { 6 | private bool state; 7 | 8 | private bool powered; 9 | 10 | private bool lights; 11 | 12 | public Lamp() 13 | { 14 | } 15 | 16 | public override string hint() 17 | { 18 | if (!this.powered) 19 | { 20 | return string.Empty; 21 | } 22 | if (this.state) 23 | { 24 | return "Turn Off"; 25 | } 26 | return "Turn On"; 27 | } 28 | 29 | public void setLights(bool setLights) 30 | { 31 | if (setLights != this.lights) 32 | { 33 | this.lights = setLights; 34 | base.transform.FindChild("light_0").light.enabled = setLights; 35 | base.transform.FindChild("light_1").light.enabled = setLights; 36 | } 37 | } 38 | 39 | public void setPowered(bool setPowered) 40 | { 41 | if (this.powered != setPowered) 42 | { 43 | this.powered = setPowered; 44 | if (!this.powered || !this.state) 45 | { 46 | this.setLights(false); 47 | } 48 | else 49 | { 50 | this.setLights(true); 51 | } 52 | } 53 | } 54 | 55 | public void setState(bool setState) 56 | { 57 | this.state = setState; 58 | this.setPowered(Electricity.checkPower(base.transform.position, 8f)); 59 | if (!this.powered || !this.state) 60 | { 61 | this.setLights(false); 62 | } 63 | else 64 | { 65 | this.setLights(true); 66 | } 67 | } 68 | 69 | public void Start() 70 | { 71 | InteractionInterface.requestLamp(base.transform.parent.position); 72 | } 73 | 74 | public override void trigger() 75 | { 76 | InteractionInterface.sendLamp(base.transform.parent.position); 77 | NetworkSounds.askSound("Sounds/General/firemode", base.transform.position, 0.1f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); 78 | } 79 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Level.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Level : MonoBehaviour 5 | { 6 | public Level() 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/LoadingScreen.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class LoadingScreen : MonoBehaviour 5 | { 6 | public static bool loading; 7 | 8 | public LoadingScreen() 9 | { 10 | } 11 | 12 | public void Awake() 13 | { 14 | if (GameObject.Find("loadingScreen") != null) 15 | { 16 | UnityEngine.Object.Destroy(base.gameObject); 17 | } 18 | else 19 | { 20 | base.name = "loadingScreen"; 21 | UnityEngine.Object.DontDestroyOnLoad(base.gameObject); 22 | } 23 | } 24 | 25 | public void OnGUI() 26 | { 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/LocalUSpeakSender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Runtime.CompilerServices; 6 | using UnityEngine; 7 | 8 | public class LocalUSpeakSender : MonoBehaviour 9 | { 10 | private bool recording; 11 | 12 | private float jitter; 13 | 14 | private float ping; 15 | 16 | private float packetLoss; 17 | 18 | public LocalUSpeakSender() 19 | { 20 | } 21 | 22 | [DebuggerHidden] 23 | private IEnumerator fakeSendPacket(byte[] data) 24 | { 25 | //LocalUSpeakSender.c__Iterator1 variable = null; 26 | return null; 27 | } 28 | 29 | private void OnGUI() 30 | { 31 | GUILayout.Label(string.Concat("Ping - ", Mathf.Round(this.ping), "ms"), new GUILayoutOption[0]); 32 | this.ping = GUILayout.HorizontalSlider(this.ping, 0f, 100f, new GUILayoutOption[] { GUILayout.Width(200f) }); 33 | GUILayout.Label(string.Concat("Ping Jitter - ", Mathf.Round(this.jitter), "ms"), new GUILayoutOption[0]); 34 | this.jitter = GUILayout.HorizontalSlider(this.jitter, 0f, 100f, new GUILayoutOption[] { GUILayout.Width(200f) }); 35 | GUILayout.Label(string.Concat("Packet Loss - ", Mathf.Round(this.packetLoss), "%"), new GUILayoutOption[0]); 36 | this.packetLoss = GUILayout.HorizontalSlider(this.packetLoss, 0f, 10f, new GUILayoutOption[] { GUILayout.Width(200f) }); 37 | GUILayout.Label(string.Concat("Using Microphone: ", Microphone.devices[0]), new GUILayoutOption[0]); 38 | GUILayout.Space(10f); 39 | if (this.recording) 40 | { 41 | if (GUILayout.Button("Stop Recording", new GUILayoutOption[0])) 42 | { 43 | this.recording = false; 44 | } 45 | } 46 | else if (GUILayout.Button("Start Recording", new GUILayoutOption[0])) 47 | { 48 | this.recording = true; 49 | } 50 | } 51 | 52 | public void OnInspectorGUI() 53 | { 54 | } 55 | 56 | public bool ShouldSend() 57 | { 58 | return this.recording; 59 | } 60 | 61 | public void USpeakInitializeSettings(int data) 62 | { 63 | USpeaker.Get(this).InitializeSettings(data); 64 | } 65 | 66 | public void USpeakOnSerializeAudio(byte[] data) 67 | { 68 | base.StartCoroutine(this.fakeSendPacket(data)); 69 | } 70 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/LockedCrate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class LockedCrate : Interactable 5 | { 6 | private string state = string.Empty; 7 | 8 | private string player = string.Empty; 9 | 10 | private string friend = string.Empty; 11 | 12 | private ClientItem[,] items; 13 | 14 | public LockedCrate() 15 | { 16 | } 17 | 18 | public override string hint() 19 | { 20 | if (!(this.player == PlayerSettings.id) && (!(PlayerSettings.friendHash != string.Empty) || !(PlayerSettings.friendHash == this.friend))) 21 | { 22 | return string.Empty; 23 | } 24 | return "Storage"; 25 | } 26 | 27 | public void setOwner(string setPlayer, string setFriend) 28 | { 29 | this.player = setPlayer; 30 | this.friend = setFriend; 31 | } 32 | 33 | public void setState(string setState) 34 | { 35 | if (setState != this.state) 36 | { 37 | this.state = setState; 38 | } 39 | this.items = InteractionInterface.getCrateItems(int.Parse(base.transform.parent.name), Sneaky.expose(this.state)); 40 | if (Interact.edit == base.gameObject) 41 | { 42 | //HUDInteract.crate(int.Parse(base.transform.parent.name), this.items); 43 | } 44 | } 45 | 46 | public void Start() 47 | { 48 | InteractionInterface.requestLockedCrate(base.transform.parent.position); 49 | } 50 | 51 | public override void trigger() 52 | { 53 | //HUDInteract.crate(int.Parse(base.transform.parent.name), this.items); 54 | Interact.interact(base.gameObject); 55 | } 56 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/MD5.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | 5 | public class MD5 6 | { 7 | public MD5() 8 | { 9 | } 10 | 11 | public static string hash(string text) 12 | { 13 | byte[] numArray = (new MD5CryptoServiceProvider()).ComputeHash((new UTF8Encoding()).GetBytes(text)); 14 | string empty = string.Empty; 15 | for (int i = 0; i < (int)numArray.Length; i++) 16 | { 17 | empty = string.Concat(empty, Convert.ToString(numArray[i], 16).PadLeft(2, '0')); 18 | } 19 | return empty.PadLeft(32, '0'); 20 | } 21 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Maps.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Maps 4 | { 5 | public readonly static int[] MAPS; 6 | 7 | public readonly static int[] MAP_VERSION; 8 | 9 | static Maps() 10 | { 11 | Maps.MAPS = new int[] { 1, 2 }; 12 | Maps.MAP_VERSION = new int[] { 0, 0, 1, 0 }; 13 | } 14 | 15 | public Maps() 16 | { 17 | } 18 | 19 | public static string getDescription(int index) 20 | { 21 | switch (index) 22 | { 23 | case 1: 24 | { 25 | return "An island off the East coast of Canada. Known for its massive beaches, great golf and potato farming."; 26 | } 27 | case 2: 28 | { 29 | return "Wild wilderness with no hope of contact with civilization. Survival at its roots."; 30 | } 31 | case 3: 32 | { 33 | return "Arizona."; 34 | } 35 | } 36 | return string.Empty; 37 | } 38 | 39 | public static string getFile(int index) 40 | { 41 | switch (index) 42 | { 43 | case 0: 44 | { 45 | return "tutorial"; 46 | } 47 | case 1: 48 | { 49 | return "pei"; 50 | } 51 | case 2: 52 | { 53 | return "arena"; 54 | } 55 | case 3: 56 | { 57 | return "arizona"; 58 | } 59 | } 60 | return string.Empty; 61 | } 62 | 63 | public static string getName(int index) 64 | { 65 | switch (index) 66 | { 67 | case 1: 68 | { 69 | return "PEI"; 70 | } 71 | case 2: 72 | { 73 | return "Arena"; 74 | } 75 | case 3: 76 | { 77 | return "Arizona Testing"; 78 | } 79 | } 80 | return string.Empty; 81 | } 82 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/MasterSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class MasterSettings 4 | { 5 | public readonly static int MASTERSETTINGS_VERSION; 6 | 7 | static MasterSettings() 8 | { 9 | } 10 | 11 | public MasterSettings() 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Medicine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Medicine : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool done; 9 | 10 | public Medicine() 11 | { 12 | } 13 | 14 | [RPC] 15 | public void askHeal() 16 | { 17 | if (!base.GetComponent().dead) 18 | { 19 | base.GetComponent().heal(MedicalStats.getHealth(base.GetComponent().item), MedicalStats.getBleeding(base.GetComponent().item), MedicalStats.getBones(base.GetComponent().item)); 20 | base.GetComponent().disinfect(MedicalStats.getSickness(base.GetComponent().item)); 21 | } 22 | } 23 | 24 | public override void equip() 25 | { 26 | Viewmodel.play("equip"); 27 | } 28 | 29 | public override void startPrimary() 30 | { 31 | Equipment.busy = true; 32 | this.startedUse = Time.realtimeSinceStartup; 33 | NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); 34 | Viewmodel.play("use"); 35 | } 36 | 37 | public override void tick() 38 | { 39 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 40 | { 41 | this.done = true; 42 | if (!Network.isServer) 43 | { 44 | base.networkView.RPC("askHeal", RPCMode.Server, new object[0]); 45 | } 46 | else 47 | { 48 | this.askHeal(); 49 | } 50 | base.GetComponent().rest(MedicalStats.getStamina(Equipment.id)); 51 | //HUDGame.pain = HUDGame.pain + (float)MedicalStats.getPain(Equipment.id); 52 | Equipment.use(); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkBans.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using Unturned; 6 | 7 | public class NetworkBans { 8 | private static Dictionary bannedPlayers; 9 | 10 | public static void ban(string name, string id, string reason, string bannedBy) { 11 | BanEntry entry = new BanEntry(name, id, reason, bannedBy, System.DateTime.Now); 12 | bannedPlayers.Add(id, entry); 13 | Database.provider.AddBan(entry); 14 | 15 | // Reload 16 | NetworkBans.Load(); 17 | // Save moved to /save command 18 | } 19 | 20 | public static void Load() 21 | { 22 | bannedPlayers = Database.provider.LoadBans(); 23 | #if DEBUG 24 | Console.WriteLine("Loaded bans with " + bannedPlayers.Count + " count"); 25 | #endif 26 | } 27 | 28 | public static void unban(int offset) { 29 | // TODO: implement remove by offset 30 | Debug.LogWarning("unban by offset not implemented!"); 31 | } 32 | 33 | public static void unban(String steamId) { 34 | NetworkBans.bannedPlayers.Remove(steamId); 35 | } 36 | 37 | public static Boolean isBanned(String steamId) { 38 | if ( bannedPlayers == null ) 39 | return false; // I hope just in server starts 40 | 41 | IBanEntry bannedPlayer; 42 | return NetworkBans.bannedPlayers.TryGetValue(steamId, out bannedPlayer); 43 | } 44 | 45 | public static Dictionary GetBannedPlayers() { 46 | return bannedPlayers; 47 | } 48 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkEffects.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class NetworkEffects : MonoBehaviour 5 | { 6 | public static NetworkEffects tool; 7 | 8 | public static GameObject model; 9 | 10 | public NetworkEffects() 11 | { 12 | } 13 | 14 | public static void askEffect(string path, Vector3 position, Quaternion rotation, float delay) 15 | { 16 | path = path.Substring(8, path.Length - 8); 17 | NetworkEffects.tool.networkView.RPC("tellEffect", RPCMode.All, new object[] { path, position, rotation, delay }); 18 | } 19 | 20 | public void onReady() 21 | { 22 | NetworkEffects.tool = this; 23 | NetworkEffects.model = GameObject.Find(Application.loadedLevelName).transform.FindChild("effects").gameObject; 24 | } 25 | 26 | public void Start() 27 | { 28 | NetworkEvents.onReady += new NetworkEventDelegate(this.onReady); 29 | } 30 | 31 | [RPC] 32 | public void tellEffect(string path, Vector3 position, Quaternion rotation, float delay) 33 | { 34 | if (!ServerSettings.dedicated) 35 | { 36 | path = string.Concat("Effects/", path); 37 | GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load(path), position, rotation); 38 | gameObject.name = "effect"; 39 | gameObject.transform.parent = NetworkEffects.model.transform; 40 | if (delay != -1f) 41 | { 42 | UnityEngine.Object.Destroy(gameObject, delay); 43 | } 44 | else 45 | { 46 | UnityEngine.Object.Destroy(gameObject, gameObject.particleSystem.startLifetime); 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkErrorDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public delegate void NetworkErrorDelegate(int id); -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkEventDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public delegate void NetworkEventDelegate(); -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkLoader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class NetworkLoader : MonoBehaviour 5 | { 6 | public static AsyncOperation load; 7 | 8 | public static int epoch; 9 | 10 | public NetworkLoader() 11 | { 12 | } 13 | 14 | [RPC] 15 | public void askTick(NetworkPlayer player) 16 | { 17 | base.networkView.RPC("tellTick", player, new object[] { Sun.tick }); 18 | } 19 | 20 | public void onDisconnected() 21 | { 22 | AudioListener.volume = 0f; 23 | NetworkLoader.load = Application.LoadLevelAsync("menu"); 24 | } 25 | 26 | public void onHosted() 27 | { 28 | base.networkView.RPC("tellState", RPCMode.OthersBuffered, new object[] { 29 | ServerSettings.map, 30 | ServerSettings.pvp, 31 | false, // sync? 32 | ServerSettings.version, 33 | ServerSettings.time, 34 | Epoch.getSeconds(), 35 | ServerSettings.mode 36 | }); 37 | 38 | AudioListener.volume = 0f; 39 | Network.isMessageQueueRunning = false; 40 | UnityEngine.Object.Destroy(GameObject.Find("menu")); 41 | NetworkLoader.load = Application.LoadLevelAsync(Maps.getFile(ServerSettings.map)); 42 | } 43 | 44 | public void OnLevelWasLoaded() 45 | { 46 | if (Application.loadedLevel != 0) 47 | { 48 | NetworkEvents.triggerOnReady(); 49 | } 50 | } 51 | 52 | public void onReady() 53 | { 54 | if (!Network.isServer) 55 | { 56 | base.networkView.RPC("askTick", RPCMode.Server, new object[] { Network.player }); 57 | } 58 | } 59 | 60 | public void Start() 61 | { 62 | NetworkEvents.onHosted += new NetworkEventDelegate(this.onHosted); 63 | NetworkEvents.onDisconnected += new NetworkEventDelegate(this.onDisconnected); 64 | NetworkEvents.onReady += new NetworkEventDelegate(this.onReady); 65 | } 66 | 67 | [RPC] 68 | public void tellState(int map, bool pvp, bool save, string version, int time, int seconds, int mode) 69 | { 70 | Network.isMessageQueueRunning = false; 71 | if (ServerSettings.version != version || mode == 3 && PlayerSettings.status != 21) { 72 | NetworkChat.notification = "Sorry: Version Mismatch"; 73 | NetworkTools.disconnect(); 74 | } 75 | else 76 | { 77 | ServerSettings.map = map; 78 | ServerSettings.pvp = pvp; 79 | ServerSettings.time = time; 80 | NetworkLoader.epoch = seconds; 81 | ServerSettings.mode = mode; 82 | AudioListener.volume = 0f; 83 | UnityEngine.Object.Destroy(GameObject.Find("menu")); 84 | NetworkLoader.load = Application.LoadLevelAsync(Maps.getFile(map)); 85 | } 86 | } 87 | 88 | [RPC] 89 | public void tellTick(float tick) 90 | { 91 | Sun.tick = tick; 92 | Sun.lastTick = Time.realtimeSinceStartup; 93 | Sun.tool.cycle(); 94 | } 95 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkMasterServer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class NetworkMasterServer 5 | { 6 | public readonly static uint OCTET_0; 7 | 8 | public readonly static uint OCTET_1; 9 | 10 | public readonly static uint OCTET_2; 11 | 12 | public readonly static bool STEAM_MASTER_SERVER; 13 | 14 | public readonly static bool UNITY_UP; 15 | 16 | static NetworkMasterServer() { 17 | NetworkMasterServer.OCTET_0 = (uint)Mathf.Pow(256f, 3f); 18 | NetworkMasterServer.OCTET_1 = (uint)Mathf.Pow(256f, 2f); 19 | NetworkMasterServer.OCTET_2 = 256; 20 | NetworkMasterServer.STEAM_MASTER_SERVER = false; 21 | NetworkMasterServer.UNITY_UP = true; 22 | } 23 | 24 | public NetworkMasterServer() { 25 | } 26 | 27 | public static uint getUInt32FromIP(string ip) 28 | { 29 | ip = string.Concat(ip, "."); 30 | string[] strArrays = Packer.unpack(ip, '.'); 31 | uint num = 0; 32 | num = num + uint.Parse(strArrays[0]) * NetworkMasterServer.OCTET_0; 33 | num = num + uint.Parse(strArrays[1]) * NetworkMasterServer.OCTET_1; 34 | num = num + uint.Parse(strArrays[2]) * NetworkMasterServer.OCTET_2; 35 | return num + uint.Parse(strArrays[3]); 36 | } 37 | 38 | public static void register(string ip, int port) { 39 | NetworkMasterServer.getUInt32FromIP(ip); 40 | ushort num = (ushort)port; 41 | ushort num1 = (ushort)(num + 1); 42 | ushort num2 = (ushort)(num + 2); 43 | } 44 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkPlayerDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public delegate void NetworkPlayerDelegate(NetworkPlayer player); -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class NetworkUser 5 | { 6 | public string name; 7 | 8 | public string nickname; 9 | 10 | public string friend; 11 | 12 | public string id; 13 | 14 | public int status; 15 | 16 | public int reputation; 17 | 18 | public NetworkPlayer player; 19 | 20 | public GameObject model; 21 | 22 | public float spawned; 23 | 24 | public bool muted; 25 | 26 | public NetworkUser(string setName, string setNickname, string setFriend, string setID, int setStatus, int setReputation, NetworkPlayer setPlayer) 27 | { 28 | this.name = setName; 29 | this.nickname = setNickname; 30 | this.friend = setFriend; 31 | this.id = setID; 32 | this.status = setStatus; 33 | this.reputation = setReputation; 34 | this.player = setPlayer; 35 | this.spawned = Single.MinValue; 36 | if (SpawnPlayers.model != null && SpawnPlayers.model.transform.FindChild("models") != null) 37 | { 38 | int num = 0; 39 | while (num < SpawnPlayers.model.transform.FindChild("models").childCount) 40 | { 41 | GameObject child = SpawnPlayers.model.transform.FindChild("models").GetChild(num).gameObject; 42 | if (child.networkView.owner != this.player) 43 | { 44 | num++; 45 | } 46 | else 47 | { 48 | child.name = this.name; 49 | child.GetComponent().owner = this; 50 | this.model = child; 51 | break; 52 | } 53 | } 54 | } 55 | } 56 | 57 | public void toggleMute() 58 | { 59 | if (this.model != null) 60 | { 61 | this.model.audio.mute = !this.model.audio.mute; 62 | this.muted = this.model.audio.mute; 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Network/NetworkUserList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class NetworkUserList 6 | { 7 | public static List users; 8 | 9 | static NetworkUserList() 10 | { 11 | NetworkUserList.users = new List(); 12 | } 13 | 14 | public NetworkUserList() 15 | { 16 | } 17 | 18 | public static int getIndexFromID(string id) 19 | { 20 | for (int i = 0; i < NetworkUserList.users.Count; i++) 21 | { 22 | if (NetworkUserList.users[i].id == id) 23 | { 24 | return i; 25 | } 26 | } 27 | return -1; 28 | } 29 | 30 | public static int getIndexFromPlayer(NetworkPlayer player) 31 | { 32 | for (int i = 0; i < NetworkUserList.users.Count; i++) 33 | { 34 | if (NetworkUserList.users[i].player == player) 35 | { 36 | return i; 37 | } 38 | } 39 | return -1; 40 | } 41 | 42 | public static GameObject getModelFromPlayer(NetworkPlayer player) 43 | { 44 | for (int i = 0; i < NetworkUserList.users.Count; i++) 45 | { 46 | if (NetworkUserList.users[i].player == player) 47 | { 48 | return NetworkUserList.users[i].model; 49 | } 50 | } 51 | return null; 52 | } 53 | 54 | public static NetworkUser getUserFromID(string id) 55 | { 56 | for (int i = 0; i < NetworkUserList.users.Count; i++) 57 | { 58 | if (NetworkUserList.users[i].id == id) 59 | { 60 | return NetworkUserList.users[i]; 61 | } 62 | } 63 | return null; 64 | } 65 | 66 | public static NetworkUser getUserFromPlayer(NetworkPlayer player) 67 | { 68 | for (int i = 0; i < NetworkUserList.users.Count; i++) 69 | { 70 | if (NetworkUserList.users[i].player == player) 71 | { 72 | return NetworkUserList.users[i]; 73 | } 74 | } 75 | return null; 76 | } 77 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Note.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Note : Interactable 5 | { 6 | private string state = string.Empty; 7 | 8 | public Note() 9 | { 10 | } 11 | 12 | public override string hint() 13 | { 14 | return "Write"; 15 | } 16 | 17 | public void setState(string setState) 18 | { 19 | if (setState != this.state) 20 | { 21 | this.state = setState; 22 | } 23 | } 24 | 25 | public void Start() 26 | { 27 | InteractionInterface.requestNote(base.transform.parent.position); 28 | } 29 | 30 | public override void trigger() 31 | { 32 | //HUDInteract.note(Sneaky.expose(this.state)); 33 | Interact.interact(base.gameObject); 34 | } 35 | 36 | public void write(string note) 37 | { 38 | InteractionInterface.sendNote(base.transform.parent.position, note); 39 | } 40 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Ocean.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Ocean : MonoBehaviour 5 | { 6 | public static float level; 7 | 8 | public Color colorMidday; 9 | 10 | public Color refractionMidday; 11 | 12 | public Color reflectionMidday; 13 | 14 | public Color colorMidnight; 15 | 16 | public Color refractionMidnight; 17 | 18 | public Color reflectionMidnight; 19 | 20 | public Ocean() 21 | { 22 | } 23 | 24 | public void Awake() 25 | { 26 | // TODO: sorry... 27 | Ocean.level = base.transform.position.y; 28 | } 29 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Optic.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Optic : Useable 4 | { 5 | public Optic() 6 | { 7 | } 8 | 9 | public override void dequip() 10 | { 11 | //HUDGame.binoculars = false; 12 | Look.fov = 0f; 13 | } 14 | 15 | public override void equip() 16 | { 17 | Viewmodel.play("equip"); 18 | } 19 | 20 | public override void startSecondary() 21 | { 22 | Viewmodel.play("startLook"); 23 | //HUDGame.binoculars = true; 24 | Look.fov = GameSettings.fov - 90f + 80f; 25 | } 26 | 27 | public override void stopSecondary() 28 | { 29 | Viewmodel.play("stopLook"); 30 | //HUDGame.binoculars = false; 31 | Look.fov = 0f; 32 | } 33 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Orient2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public enum Orient2 4 | { 5 | HORIZONTAL, 6 | VERTICAL 7 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Packer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | public class Packer 5 | { 6 | public Packer() 7 | { 8 | } 9 | 10 | public static string[] unpack(string serial, char delimiter) 11 | { 12 | int num = 0; 13 | List strs = new List(); 14 | for (int i = 0; i < serial.Length; i = num + 1) 15 | { 16 | num = serial.IndexOf(delimiter, i); 17 | strs.Add(serial.Substring(i, num - i)); 18 | } 19 | return strs.ToArray(); 20 | } 21 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Painter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Painter : MonoBehaviour 5 | { 6 | public Color color; 7 | 8 | private Texture2D source; 9 | 10 | public Painter() 11 | { 12 | } 13 | 14 | public void paint(Color setColor) 15 | { 16 | this.color = setColor; 17 | Texture2D texture2D = new Texture2D(32, 32, TextureFormat.RGBA32, true, true); 18 | texture2D.filterMode = FilterMode.Point; 19 | 20 | for (int i = 0; i < 32; i++) 21 | { 22 | for (int j = 0; j < 32; j++) 23 | { 24 | if (this.source.GetPixel(i, j) != Color.white) 25 | { 26 | texture2D.SetPixel(i, j, this.source.GetPixel(i, j)); 27 | } 28 | else 29 | { 30 | texture2D.SetPixel(i, j, this.color); 31 | } 32 | } 33 | } 34 | texture2D.Apply(); 35 | base.renderer.material.mainTexture = texture2D; 36 | } 37 | 38 | public void Start() 39 | { 40 | this.source = (Texture2D)base.renderer.material.mainTexture; 41 | this.paint(this.color); 42 | } 43 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Pants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Pants : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool wear; 9 | 10 | private bool done; 11 | 12 | public Pants() 13 | { 14 | } 15 | 16 | public override void dequip() 17 | { 18 | if (this.wear) 19 | { 20 | Player.clothes.changePants(Equipment.id); 21 | } 22 | } 23 | 24 | public override void equip() 25 | { 26 | Viewmodel.play("equip"); 27 | } 28 | 29 | public override void startPrimary() 30 | { 31 | Equipment.busy = true; 32 | this.startedUse = Time.realtimeSinceStartup; 33 | Viewmodel.play("use"); 34 | } 35 | 36 | public override void tick() 37 | { 38 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 39 | { 40 | this.done = true; 41 | this.wear = true; 42 | Equipment.use(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Passenger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Passenger 5 | { 6 | public NetworkPlayer player; 7 | 8 | public Passenger(NetworkPlayer setPlayer) 9 | { 10 | this.player = setPlayer; 11 | } 12 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/PlayerSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class PlayerSettings 5 | { 6 | public static string user; 7 | 8 | public static string friend; 9 | 10 | public static string nickname; 11 | 12 | public static string friendHash; 13 | 14 | public static string id; 15 | 16 | public static int status; 17 | 18 | public static int face; 19 | 20 | public static int hair; 21 | 22 | public static int skinColor; 23 | 24 | public static int hairColor; 25 | 26 | public static bool arm; 27 | 28 | static PlayerSettings() 29 | { 30 | PlayerSettings.user = string.Empty; 31 | PlayerSettings.friend = PlayerPrefs.GetString("playerSettings_Clan"); 32 | PlayerSettings.nickname = PlayerPrefs.GetString("playerSettings_Nickname"); 33 | PlayerSettings.friendHash = string.Empty; 34 | PlayerSettings.id = string.Empty; 35 | PlayerSettings.status = 0; 36 | } 37 | 38 | public PlayerSettings() 39 | { 40 | } 41 | 42 | public static void hash() 43 | { 44 | if (PlayerSettings.friend != string.Empty) 45 | { 46 | PlayerSettings.friendHash = MD5.hash(PlayerSettings.friend); 47 | } 48 | else 49 | { 50 | PlayerSettings.friendHash = string.Empty; 51 | } 52 | } 53 | 54 | public static void load() 55 | { 56 | PlayerSettings.face = PlayerPrefs.GetInt(string.Concat("playerSettings_", PlayerSettings.id, "_Face"), 6001); 57 | PlayerSettings.hair = PlayerPrefs.GetInt(string.Concat("playerSettings_", PlayerSettings.id, "_Hair"), 1000); 58 | PlayerSettings.skinColor = PlayerPrefs.GetInt(string.Concat("playerSettings_", PlayerSettings.id, "_SkinColor"), 1); 59 | PlayerSettings.hairColor = PlayerPrefs.GetInt(string.Concat("playerSettings_", PlayerSettings.id, "_HairColor"), 2); 60 | PlayerSettings.arm = PlayerPrefs.GetInt(string.Concat("playerSettings_", PlayerSettings.id, "_Arm"), 0) == 1; 61 | } 62 | 63 | public static void save() 64 | { 65 | PlayerPrefs.SetString("playerSettings_Clan", PlayerSettings.friend); 66 | PlayerPrefs.SetString("playerSettings_Nickname", PlayerSettings.nickname); 67 | PlayerPrefs.SetInt(string.Concat("playerSettings_", PlayerSettings.id, "_Face"), PlayerSettings.face); 68 | PlayerPrefs.SetInt(string.Concat("playerSettings_", PlayerSettings.id, "_Hair"), PlayerSettings.hair); 69 | PlayerPrefs.SetInt(string.Concat("playerSettings_", PlayerSettings.id, "_SkinColor"), PlayerSettings.skinColor); 70 | PlayerPrefs.SetInt(string.Concat("playerSettings_", PlayerSettings.id, "_HairColor"), PlayerSettings.hairColor); 71 | PlayerPrefs.SetInt(string.Concat("playerSettings_", PlayerSettings.id, "_Arm"), (!PlayerSettings.arm ? 0 : 1)); 72 | } 73 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Point2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public struct Point2 4 | { 5 | public readonly static Point2 ZERO; 6 | 7 | public readonly static Point2 NONE; 8 | 9 | public int x; 10 | 11 | public int y; 12 | 13 | static Point2() 14 | { 15 | Point2.ZERO = new Point2(0, 0); 16 | Point2.NONE = new Point2(-1, -1); 17 | } 18 | 19 | public Point2(int set_x, int set_y) 20 | { 21 | this.x = set_x; 22 | this.y = set_y; 23 | } 24 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/RayMasks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class RayMasks 5 | { 6 | public readonly static int DAMAGE; 7 | 8 | public readonly static int PLACEABLE; 9 | 10 | public readonly static int ERROR; 11 | 12 | public readonly static int ERRORSTRUCT; 13 | 14 | public readonly static int RAYBLOCK; 15 | 16 | public readonly static int BUILT; 17 | 18 | public readonly static int ATTACKABLE; 19 | 20 | public readonly static int INTERACTABLE; 21 | 22 | public readonly static int STATIC; 23 | 24 | static RayMasks() 25 | { 26 | RayMasks.DAMAGE = -1039144215; 27 | RayMasks.PLACEABLE = -1039324951; 28 | RayMasks.ERROR = -1039292183; 29 | RayMasks.ERRORSTRUCT = 65536; 30 | RayMasks.RAYBLOCK = -1039390487; 31 | RayMasks.BUILT = 98304; 32 | RayMasks.ATTACKABLE = 246528; 33 | RayMasks.INTERACTABLE = -1039140119; 34 | RayMasks.STATIC = -1039333143; 35 | } 36 | 37 | public RayMasks() 38 | { 39 | } 40 | 41 | public static bool isVisible(Vector3 start, Vector3 end) 42 | { 43 | return !Physics.Linecast(start, end, RayMasks.RAYBLOCK); 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Reflective.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Reflective : MonoBehaviour 5 | { 6 | public readonly static Color REFLECTION; 7 | 8 | public readonly static Color SPECULAR; 9 | 10 | public readonly static float SHINE; 11 | 12 | public static int closest; 13 | 14 | public static float distance; 15 | 16 | public static float offset; 17 | 18 | static Reflective() 19 | { 20 | Reflective.REFLECTION = new Color(0.498039216f, 0.498039216f, 0.498039216f); 21 | Reflective.SPECULAR = new Color(0.294117659f, 0.294117659f, 0.294117659f); 22 | Reflective.SHINE = 0.5f; 23 | Reflective.closest = -1; 24 | Reflective.distance = Single.MaxValue; 25 | Reflective.offset = 0f; 26 | } 27 | 28 | public Reflective() 29 | { 30 | } 31 | 32 | public void Awake() 33 | { 34 | Reflector.build(); 35 | Reflective.closest = -1; 36 | Reflective.distance = Single.MaxValue; 37 | for (int i = 0; i < (int)Reflector.cubemaps.Length; i++) 38 | { 39 | Vector3 vector3 = Reflector.cubemaps[i].position - base.transform.position; 40 | Reflective.offset = vector3.magnitude; 41 | if (Reflective.offset < Reflective.distance) 42 | { 43 | Reflective.distance = Reflective.offset; 44 | Reflective.closest = i; 45 | } 46 | } 47 | if (Reflective.closest != -1) 48 | { 49 | if (base.renderer.material.shader.name == "Reflective Fancy/Specular") 50 | { 51 | base.renderer.material.SetTexture("_Cube", (Cubemap)Resources.Load(string.Concat(new object[] { "Cubemaps/", Application.loadedLevelName, "/Node_", Reflective.closest, "/reflection" }))); 52 | base.renderer.material.SetColor("_ReflectColor", Reflective.REFLECTION); 53 | base.renderer.material.SetColor("_SpecColor", Reflective.REFLECTION); 54 | base.renderer.material.SetFloat("_Shininess", Reflective.SHINE); 55 | } 56 | else 57 | { 58 | Debug.Log("Missing reflection shader.", base.gameObject); 59 | } 60 | } 61 | UnityEngine.Object.Destroy(this); 62 | } 63 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Reflector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Reflector : MonoBehaviour 5 | { 6 | public static string level; 7 | 8 | public static Transform[] cubemaps; 9 | 10 | static Reflector() 11 | { 12 | } 13 | 14 | public Reflector() 15 | { 16 | } 17 | 18 | public void Awake() 19 | { 20 | Reflector.build(); 21 | UnityEngine.Object.Destroy(this); 22 | } 23 | 24 | public static void build() 25 | { 26 | if (Reflector.level != Application.loadedLevelName || Reflector.cubemaps == null) 27 | { 28 | Reflector.level = Application.loadedLevelName; 29 | Transform transforms = GameObject.Find(Application.loadedLevelName).transform.FindChild("cubemaps"); 30 | Reflector.cubemaps = new Transform[transforms.childCount]; 31 | for (int i = 0; i < (int)Reflector.cubemaps.Length; i++) 32 | { 33 | Reflector.cubemaps[i] = transforms.GetChild(i); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Reputation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Reputation 4 | { 5 | public readonly static int SPAWN_DELAY = 30; 6 | 7 | public Reputation() 8 | { 9 | } 10 | 11 | public static string getIcon(int reputation) 12 | { 13 | if (reputation == 0) 14 | { 15 | return "Textures/Icons/neutral"; 16 | } 17 | if (reputation > 70) 18 | { 19 | return "Textures/Icons/hero_5"; 20 | } 21 | if (reputation > 40) 22 | { 23 | return "Textures/Icons/hero_4"; 24 | } 25 | if (reputation > 20) 26 | { 27 | return "Textures/Icons/hero_3"; 28 | } 29 | if (reputation > 10) 30 | { 31 | return "Textures/Icons/hero_2"; 32 | } 33 | if (reputation > 5) 34 | { 35 | return "Textures/Icons/hero_1"; 36 | } 37 | if (reputation > 0) 38 | { 39 | return "Textures/Icons/hero_0"; 40 | } 41 | if (reputation < -70) 42 | { 43 | return "Textures/Icons/bandit_5"; 44 | } 45 | if (reputation < -40) 46 | { 47 | return "Textures/Icons/bandit_4"; 48 | } 49 | if (reputation < -20) 50 | { 51 | return "Textures/Icons/bandit_3"; 52 | } 53 | if (reputation < -10) 54 | { 55 | return "Textures/Icons/bandit_2"; 56 | } 57 | if (reputation < -5) 58 | { 59 | return "Textures/Icons/bandit_1"; 60 | } 61 | if (reputation < 0) 62 | { 63 | return "Textures/Icons/bandit_0"; 64 | } 65 | return string.Empty; 66 | } 67 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/RudeFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class RudeFilter 4 | { 5 | private readonly static string[] blacklist = new string[] { "shit", "fuck", "damn", "ass", "fag", "nigger", "bitch", "cock", "sex", "cunt", "whore", "testicle", "piss", "vagina", "penis", "prostitute", "stripper", "lag", "admin" }; 6 | private readonly static string[] whitelist = new string[] { "poop", "fruitcake", "gosh darnit", "donkeybumb", "stick", "person", "doge", "chicken", "reproduction", "private", "person", "private", "urine", "private", "private", "person", "person", "best server", "policeman" }; 7 | 8 | public static string filter(string text) 9 | { 10 | string lower = text.ToLower(); 11 | for (int i = 0; i < (int)RudeFilter.blacklist.Length; i++) 12 | { 13 | while (lower.Contains(RudeFilter.blacklist[i])) 14 | { 15 | int num = lower.IndexOf(RudeFilter.blacklist[i]); 16 | if (num != -1) 17 | { 18 | lower = string.Concat(lower.Substring(0, num), RudeFilter.whitelist[i], lower.Substring(num + RudeFilter.blacklist[i].Length, lower.Length - num - RudeFilter.blacklist[i].Length)); 19 | text = string.Concat(text.Substring(0, num), RudeFilter.whitelist[i], text.Substring(num + RudeFilter.blacklist[i].Length, text.Length - num - RudeFilter.blacklist[i].Length)); 20 | } 21 | else 22 | { 23 | break; 24 | } 25 | } 26 | } 27 | return text; 28 | } 29 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/SendBehavior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public enum SendBehavior 4 | { 5 | Constant, 6 | RecordThenSend 7 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Server.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Server 5 | { 6 | public string ip; 7 | 8 | public int port; 9 | 10 | public string guid; 11 | 12 | public int players; 13 | 14 | public int max; 15 | 16 | public string name; 17 | 18 | public bool pvp; 19 | 20 | public int mode; 21 | 22 | public bool dedicated; 23 | 24 | public bool save; 25 | 26 | public int map; 27 | 28 | public string version; 29 | 30 | public int ping; 31 | 32 | public int reference; 33 | 34 | public bool passworded; 35 | 36 | public Ping pinger; 37 | 38 | public Server(HostData data) 39 | { 40 | this.name = data.gameName; 41 | this.ip = data.ip[0]; 42 | this.port = data.port; 43 | this.guid = data.guid; 44 | this.players = data.connectedPlayers; 45 | this.max = data.playerLimit; 46 | this.ping = 0; 47 | this.reference = -1; 48 | if (this.max < 1) 49 | { 50 | this.max = 1; 51 | } 52 | else if (this.max > 12) 53 | { 54 | this.max = 12; 55 | } 56 | string[] strArrays = Packer.unpack(data.comment, ';'); 57 | this.pvp = strArrays[0] == "t"; 58 | this.mode = int.Parse(strArrays[1]); 59 | this.dedicated = strArrays[2] == "t"; 60 | this.save = strArrays[3] == "t"; 61 | this.map = int.Parse(strArrays[4]); 62 | this.version = strArrays[5]; 63 | this.passworded = strArrays[6] == "t"; 64 | this.pinger = new Ping(this.ip); 65 | } 66 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ServerBarricade.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class ServerBarricade 5 | { 6 | public int id; 7 | 8 | public int health; 9 | 10 | public string state; 11 | 12 | public Vector3 position; 13 | 14 | public Vector3 rotation; 15 | 16 | public ServerBarricade(int setID, int setHealth, string setState, Vector3 setPosition, Vector3 setRotation) 17 | { 18 | this.id = setID; 19 | this.health = setHealth; 20 | this.state = setState; 21 | this.position = setPosition; 22 | this.rotation = setRotation; 23 | } 24 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ServerItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class ServerItem 5 | { 6 | private int realID; 7 | 8 | private int realAmount; 9 | 10 | private string realState; 11 | 12 | public Vector3 position; 13 | 14 | public int amount 15 | { 16 | get 17 | { 18 | return Sneaky.expose(this.realAmount); 19 | } 20 | set 21 | { 22 | this.realAmount = Sneaky.sneak(value); 23 | } 24 | } 25 | 26 | public int id 27 | { 28 | get 29 | { 30 | return Sneaky.expose(this.realID); 31 | } 32 | set 33 | { 34 | this.realID = Sneaky.sneak(value); 35 | } 36 | } 37 | 38 | public string state 39 | { 40 | get 41 | { 42 | return Sneaky.expose(this.realState); 43 | } 44 | set 45 | { 46 | this.realState = Sneaky.sneak(value); 47 | } 48 | } 49 | 50 | public ServerItem(int setID, int setAmount, string setState, Vector3 setPosition) 51 | { 52 | this.id = setID; 53 | this.amount = setAmount; 54 | this.state = setState; 55 | this.position = setPosition; 56 | } 57 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ServerSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class ServerSettings 4 | { 5 | public static int map; 6 | 7 | public static string version; 8 | 9 | public static bool pvp; 10 | 11 | public static int mode; 12 | 13 | public static bool dedicated; 14 | 15 | public static int time; 16 | 17 | public static int cycle; 18 | 19 | public static float offset; 20 | 21 | public static bool open; 22 | 23 | public static bool passworded; 24 | 25 | public static string name; 26 | 27 | static ServerSettings() 28 | { 29 | ServerSettings.map = 1; 30 | ServerSettings.version = Texts.VERSION_ID; 31 | ServerSettings.pvp = true; 32 | ServerSettings.mode = 0; 33 | ServerSettings.dedicated = false; 34 | ServerSettings.time = -1; 35 | ServerSettings.cycle = -1; 36 | ServerSettings.offset = 0f; 37 | ServerSettings.open = false; 38 | ServerSettings.passworded = false; 39 | ServerSettings.name = "Unturned Server"; 40 | } 41 | 42 | public ServerSettings() 43 | { 44 | } 45 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ServerStructure.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class ServerStructure 5 | { 6 | public int id; 7 | 8 | public int health; 9 | 10 | public string state; 11 | 12 | public Vector3 position; 13 | 14 | public int rotation; 15 | 16 | public ServerStructure(int setID, int setHealth, string setState, Vector3 setPosition, int setRotation) 17 | { 18 | this.id = setID; 19 | this.health = setHealth; 20 | this.state = setState; 21 | this.position = setPosition; 22 | this.rotation = setRotation; 23 | } 24 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Skill.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Skill 5 | { 6 | public string id; 7 | 8 | public string name; 9 | 10 | public string description; 11 | 12 | public int maxLevel; 13 | 14 | public int cost; 15 | 16 | private int realLevel; 17 | 18 | public int level 19 | { 20 | get 21 | { 22 | return Sneaky.expose(this.realLevel); 23 | } 24 | set 25 | { 26 | this.realLevel = Sneaky.sneak(value); 27 | } 28 | } 29 | 30 | public Skill(string setID, string setName, string setDescription, int setMaxLevel, int setCost) 31 | { 32 | this.id = setID; 33 | this.name = setName; 34 | this.description = setDescription; 35 | this.maxLevel = setMaxLevel; 36 | this.cost = setCost; 37 | this.level = 0; 38 | } 39 | 40 | public int getCost() 41 | { 42 | return this.cost + (int)Mathf.Pow((float)(this.cost * this.level), 2f) / this.cost; 43 | } 44 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/SkinColor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class SkinColor 5 | { 6 | public readonly static Color[] COLORS = new Color[] { 7 | new Color(0.870588243f, 0.8352941f, 0.78039217f), 8 | new Color(0.7019608f, 0.5921569f, 0.4392157f), 9 | new Color(0.7490196f, 0.694117665f, 0.619607866f), 10 | new Color(0.905882359f, 0.709803939f, 0.5176471f), 11 | new Color(0.623529434f, 0.5686275f, 0.490196079f), 12 | new Color(0.5019608f, 0.4509804f, 0.3764706f), 13 | new Color(0.3529412f, 0.3137255f, 0.254901975f), 14 | new Color(0.254901975f, 0.223529413f, 0.180392161f), 15 | new Color(0.180392161f, 0.160784319f, 0.129411772f), 16 | new Color(0.68235296f, 0.105882354f, 0.105882354f), 17 | new Color(0.7411765f, 0.4745098f, 0.180392161f), 18 | new Color(0.498039216f, 0.247058824f, 0.521568656f), 19 | new Color(0.282352954f, 0.392156869f, 0.596078455f), 20 | new Color(0.137254909f, 0.5568628f, 0.5411765f), 21 | new Color(0.0627451f, 0.6156863f, 0.0470588244f), 22 | new Color(0.3882353f, 0.4862745f, 0.3882353f), 23 | new Color(0.7372549f, 0.6745098f, 0.129411772f), 24 | new Color(0.768627465f, 0.5058824f, 0.129411772f) 25 | }; 26 | 27 | public static Color getColor(int id) 28 | { 29 | return SkinColor.COLORS[id]; 30 | } 31 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Smoke.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Smoke : MonoBehaviour 5 | { 6 | public Smoke() 7 | { 8 | } 9 | 10 | public void engage() 11 | { 12 | base.transform.FindChild("smokebomb").GetComponent().Play(); 13 | base.transform.FindChild("smokebomb").audio.Play(); 14 | } 15 | 16 | public void Start() 17 | { 18 | base.Invoke("engage", 2f); 19 | UnityEngine.Object.Destroy(base.gameObject, 60f); 20 | } 21 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Sneaky.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Sneaky 4 | { 5 | private static int SNEAKY_CHAR_CONST = 8192; 6 | 7 | private static string buffer; 8 | 9 | private static char[] letters; 10 | 11 | public Sneaky() 12 | { 13 | } 14 | 15 | public static int expose(int sneaked) 16 | { 17 | return (sneaked - 10) / -4; 18 | } 19 | 20 | public static float expose(float sneaked) 21 | { 22 | return (sneaked - 5f) / -2f; 23 | } 24 | 25 | public static string expose(string sneaked) 26 | { 27 | Sneaky.letters = sneaked.ToCharArray(); 28 | Sneaky.buffer = string.Empty; 29 | for (int i = (int)Sneaky.letters.Length - 1; i >= 0; i--) 30 | { 31 | Sneaky.buffer = string.Concat(Sneaky.buffer, (char)(Sneaky.letters[i] - SNEAKY_CHAR_CONST)); 32 | } 33 | return Sneaky.buffer; 34 | } 35 | 36 | public static int sneak(int exposed) 37 | { 38 | return exposed * -4 + 10; 39 | } 40 | 41 | public static float sneak(float exposed) 42 | { 43 | return exposed * -2f + 5f; 44 | } 45 | 46 | public static string sneak(string exposed) 47 | { 48 | Sneaky.letters = exposed.ToCharArray(); 49 | Sneaky.buffer = string.Empty; 50 | for (int i = (int)Sneaky.letters.Length - 1; i >= 0; i--) 51 | { 52 | Sneaky.buffer = string.Concat(Sneaky.buffer, (char)(Sneaky.letters[i] + SNEAKY_CHAR_CONST)); 53 | } 54 | return Sneaky.buffer; 55 | } 56 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/SpeakerMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public enum SpeakerMode 4 | { 5 | Local, 6 | Remote 7 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Sun.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Sun : MonoBehaviour 5 | { 6 | public readonly static float COURSE = 2560f; 7 | public readonly static float WEIGHT = 0.6f; 8 | 9 | public static Sun tool; 10 | public static float time; 11 | public static float tick; 12 | public static float lastTick; 13 | public static float day; 14 | 15 | public Sun() 16 | { 17 | } 18 | 19 | public void Awake() 20 | { 21 | Sun.tool = this; 22 | base.InvokeRepeating("cycle", 0f, 0.25f); 23 | base.light.shadowBias = 0.1f; 24 | } 25 | 26 | public void cycle() { 27 | ServerSettings.offset = ServerSettings.offset + (Time.realtimeSinceStartup - Sun.lastTick); 28 | Sun.tick = Sun.tick + (Time.realtimeSinceStartup - Sun.lastTick); 29 | Sun.lastTick = Time.realtimeSinceStartup; 30 | Sun.time = (float)ServerSettings.time + Sun.tick; 31 | Sun.day = Sun.time % Sun.COURSE / Sun.COURSE; 32 | } 33 | 34 | public static string getTime() 35 | { 36 | float single = Sun.day + 0.25f; 37 | if (single > 1f) 38 | { 39 | single = single - 1f; 40 | } 41 | float single1 = single * 86400f; 42 | float single2 = single1 / 60f % 60f; 43 | float single3 = single1 / 3600f % 12f + 1f; 44 | if (single2 < 10f) 45 | { 46 | return string.Concat((int)single3, ":0", (int)single2); 47 | } 48 | return string.Concat((int)single3, ":", (int)single2); 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/ThreeDMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public enum ThreeDMode 4 | { 5 | None, 6 | SpeakerPan, 7 | Full3D 8 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Throw.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Throw : Useable 5 | { 6 | private float startedUse = Single.MaxValue; 7 | 8 | private bool done; 9 | 10 | public Throw() 11 | { 12 | } 13 | 14 | public override void equip() 15 | { 16 | Viewmodel.play("equip"); 17 | } 18 | 19 | public override void startPrimary() 20 | { 21 | Equipment.busy = true; 22 | this.startedUse = Time.realtimeSinceStartup; 23 | NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); 24 | Viewmodel.play("use"); 25 | } 26 | 27 | public override void tick() 28 | { 29 | if (Time.realtimeSinceStartup - this.startedUse > Viewmodel.model.animation["use"].length && !this.done) 30 | { 31 | this.done = true; 32 | SpawnProjectiles.throwProjectile(Equipment.id, Camera.main.transform.position + (Camera.main.transform.forward * -0.5f), Camera.main.transform.forward * 1500f); 33 | Equipment.use(); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/UnlockedDoor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class UnlockedDoor : Interactable 5 | { 6 | private bool state; 7 | 8 | public UnlockedDoor() 9 | { 10 | } 11 | 12 | public override string hint() 13 | { 14 | if (this.state) 15 | { 16 | return "Close"; 17 | } 18 | return "Open"; 19 | } 20 | 21 | public void setState(bool setState) 22 | { 23 | if (setState != this.state) 24 | { 25 | this.state = setState; 26 | if (!this.state) 27 | { 28 | base.animation.Play("close"); 29 | } 30 | else 31 | { 32 | base.animation.Play("open"); 33 | } 34 | } 35 | } 36 | 37 | public void Start() 38 | { 39 | InteractionInterface.requestUnlockedDoor(base.transform.parent.position); 40 | } 41 | 42 | public override void trigger() 43 | { 44 | InteractionInterface.sendUnlockedDoor(base.transform.parent.position); 45 | } 46 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Useable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using CommandHandler; 4 | 5 | public class Useable : MonoBehaviour 6 | { 7 | public Useable() 8 | { 9 | } 10 | 11 | public virtual void dequip() 12 | { 13 | } 14 | 15 | public virtual void equip() 16 | { 17 | } 18 | 19 | public virtual void startPrimary() 20 | { 21 | } 22 | 23 | public virtual void startSecondary() 24 | { 25 | } 26 | 27 | public virtual void stopPrimary() 28 | { 29 | } 30 | 31 | public virtual void stopSecondary() 32 | { 33 | } 34 | 35 | public virtual void tick() 36 | { 37 | } 38 | 39 | public void sendKilledPlayer(NetworkUser victim, NetworkPlayer killer) { 40 | //NetworkManager.tool.networkView.RPC("openError", player, new object[] { text, icon }); 41 | NetworkUser killerUser = NetworkUserList.getUserFromPlayer(killer); 42 | 43 | // Informing player 44 | killerUser.model.networkView.RPC("killedPlayer", killer, new object[0]); 45 | 46 | int credit = 0; 47 | 48 | if (victim.reputation > 20) 49 | credit = -10; 50 | else if (victim.reputation < -70) // bandit 51 | credit = 15; 52 | else if (victim.reputation < -50) 53 | credit = 12; 54 | else if (victim.reputation < -30) 55 | credit = 10; 56 | else if (victim.reputation < -20) 57 | credit = 9; 58 | else if (victim.reputation < -10) 59 | credit = 7; 60 | else 61 | credit = 4; 62 | 63 | String icon = "Textures/Icons/gold"; 64 | String text = ""; 65 | 66 | if ( UserList.getPermission( NetworkUserList.getUserFromPlayer(killer).id ) > 0) 67 | { 68 | credit = Math.Abs( credit * 2 ); 69 | } 70 | 71 | if (credit < 0) 72 | text = String.Format("You have lost {0} credit", credit); 73 | else 74 | text = String.Format("You have earned {0} credit", credit); 75 | 76 | NetworkManager.error(text, icon, killer); 77 | 78 | GameObject playerGameObject = NetworkUserList.getModelFromPlayer(killer); 79 | playerGameObject.GetComponentInChildren().credit += credit; 80 | 81 | //NetworkManager.tool.networkView.RPC("openError", killer, new object[] { text, icon }); 82 | } 83 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Base/Voice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Voice : MonoBehaviour 5 | { 6 | public static bool sending; 7 | 8 | public Voice() 9 | { 10 | } 11 | 12 | public void OnInspectorGUI() 13 | { 14 | } 15 | 16 | public bool ShouldSend() 17 | { 18 | return Voice.sending; 19 | } 20 | 21 | public void Start() 22 | { 23 | if (!GameSettings.voice && base.networkView.isMine) 24 | { 25 | base.GetComponent().enabled = false; 26 | } 27 | } 28 | 29 | public void Update() 30 | { 31 | if (!GameSettings.voice) 32 | { 33 | Voice.sending = false; 34 | } 35 | else if (Input.GetKeyDown(InputSettings.voiceKey) && !Voice.sending) 36 | { 37 | Voice.sending = true; 38 | } 39 | else if (!Input.GetKey(InputSettings.voiceKey) && Voice.sending) 40 | { 41 | Voice.sending = false; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Assembly-CSharp/CommandHandler/CommandList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace CommandHandler { 5 | public class CommandList { 6 | 7 | public static List commands = new List (); 8 | 9 | public static void issueCommand (string alias) 10 | { 11 | foreach (Command command in commands) { 12 | if (command.HasAlias (alias)) { 13 | command.CommandDelegate (new CommandArgs (alias, UserList.getUserFromPlayer (Network.player), null)); 14 | return; 15 | } 16 | } 17 | } 18 | 19 | public static void issueCommand (string alias, List parms) 20 | { 21 | foreach (Command command in commands) { 22 | if (command.HasAlias (alias)) { 23 | command.CommandDelegate (new CommandArgs (alias, UserList.getUserFromPlayer (Network.player), parms)); 24 | return; 25 | } 26 | } 27 | } 28 | 29 | public static void issueCommand (string alias, BetterNetworkUser sender, List parms) 30 | { 31 | CommandHandlerMain.ExecuteCommand (sender, alias, parms); 32 | } 33 | 34 | public static void issueCommand (string alias, BetterNetworkUser sender) 35 | { 36 | CommandHandlerMain.ExecuteCommand (sender, alias, null); 37 | } 38 | 39 | public static void add (Command command) 40 | { 41 | commands.Add (command); 42 | } 43 | 44 | public static void add (CommandDelegate method, params string[] names) 45 | { 46 | commands.Add (new Command (method, names)); 47 | } 48 | 49 | public static void add (int permissionLevelRequired, CommandDelegate method, params string[] names) 50 | { 51 | commands.Add (new Command (permissionLevelRequired, method, names)); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assembly-CSharp/ConnectionGuard.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | class ConnectionGuard : MonoBehaviour 5 | { 6 | void Awake() { 7 | NetworkEvents.onHosted += new NetworkEventDelegate(this.onServerStarted); 8 | } 9 | 10 | void onServerStarted() { 11 | GameObject go = GameObject.Find("network") as GameObject; 12 | InvokeRepeating("CheckConnections", 0, 10); 13 | } 14 | 15 | void CheckConnections() { 16 | /* 17 | if (NetworkUserList.users.Count != Network.connections.Length) 18 | { 19 | foreach (NetworkPlayer plr in Network.connections ) 20 | { 21 | NetworkUser user = NetworkUserList.getUserFromPlayer(plr); 22 | 23 | if ( user == null ) 24 | { 25 | try { 26 | Debug.Log("Cleared player: " + plr.ipAddress ); 27 | Network.DestroyPlayerObjects(plr); 28 | } finally { 29 | Network.CloseConnection(plr, true); 30 | } 31 | } 32 | } 33 | } 34 | */ 35 | 36 | UnityEngine.Object[] players = UnityEngine.Object.FindObjectsOfType(typeof(Player)); 37 | if ( players.Length > Network.connections.Length ) 38 | { 39 | Debug.LogError("There is more players than connections!!!"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assembly-CSharp/Database.cs: -------------------------------------------------------------------------------- 1 | //using Steamworks; 2 | using System; 3 | using System.Collections; 4 | using UnityEngine; 5 | using Unturned; 6 | 7 | public class Database : MonoBehaviour 8 | { 9 | public readonly static string code; 10 | 11 | private static bool welcomed; 12 | 13 | private static GameObject connectionGuard; 14 | 15 | public static IDataHolder provider; 16 | 17 | public const String SERVER_VERSION = "4.3"; 18 | 19 | static Database() 20 | { 21 | Database.code = "_P1Zz4 [}"; 22 | } 23 | 24 | public Database() 25 | { 26 | } 27 | 28 | public IEnumerator fixFrameRate() 29 | { 30 | yield return new WaitForFixedUpdate(); 31 | Application.targetFrameRate = 10; 32 | Network.sendRate = 5; 33 | } 34 | 35 | public void Start() 36 | { 37 | //provider = new FileDatabase(); 38 | //provider = new MysqlDatabase.Database(); 39 | provider = new Unturned.RemoteDatabase(); 40 | provider.Init(); 41 | 42 | 43 | connectionGuard = new GameObject(); 44 | UnityEngine.Object.DontDestroyOnLoad(Database.connectionGuard); 45 | connectionGuard.name = "Connection Guard"; 46 | connectionGuard.AddComponent(); 47 | 48 | if (!Database.welcomed) 49 | { 50 | StartCoroutine(fixFrameRate()); 51 | Database.welcomed = true; 52 | 53 | PlayerSettings.id = "Server"; 54 | PlayerSettings.status = 21; 55 | if (Epoch.serverTime == -1) 56 | { 57 | Epoch.serverTime = (int)(GetServerTime() - 1401854099); 58 | } 59 | 60 | ServerSettings.cycle = (int)(GetServerTime() - 1401854099); 61 | ServerSettings.offset = 0f; 62 | ServerSettings.time = (int)((float)ServerSettings.cycle % Sun.COURSE); 63 | Sun.tick = 0f; 64 | Sun.lastTick = Time.realtimeSinceStartup; 65 | Sun.tool.cycle(); 66 | } 67 | } 68 | 69 | /// 70 | /// returns Unix time in seconds 71 | /// 72 | /// The server time. 73 | public static int GetServerTime() 74 | { 75 | return (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; 76 | } 77 | } -------------------------------------------------------------------------------- /Assembly-CSharp/DedicatedServer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class DedicatedServer : MonoBehaviour 5 | { 6 | // Checks the ingame world 7 | public static bool CheckPlayer(NetworkPlayer player, string reference) { 8 | try { 9 | if ( player == null) { 10 | throw new UnityException(); 11 | } 12 | 13 | if ( player.ipAddress == null || player.guid == null ) { 14 | throw new UnityException(); 15 | } 16 | 17 | //if (NetworkUserList.getUserFromPlayer(player) == null) 18 | // throw new UnityException("Player not found but conenction exists. Dropping!"); 19 | 20 | } catch { 21 | Debug.LogError("Kicked no-network player! " + reference); 22 | NetworkTools.kick(player, "No network connection... Kicking..."); 23 | return false; 24 | } 25 | 26 | return true; 27 | } 28 | 29 | public IEnumerator fixFrameRate() 30 | { 31 | yield return new WaitForFixedUpdate(); 32 | Application.targetFrameRate = 10; 33 | Network.sendRate = 5; 34 | } 35 | 36 | public void Start() 37 | { 38 | StartCoroutine(fixFrameRate()); 39 | 40 | PlayerSettings.id = "Server"; 41 | PlayerSettings.status = 21; 42 | if (Epoch.serverTime == -1) 43 | { 44 | Epoch.serverTime = (int)0;//(SteamUtils.GetServerRealTime() - 1401854099); 45 | } 46 | 47 | ServerSettings.map = 1; 48 | ServerSettings.name = "Unturned Server"; 49 | ServerSettings.dedicated = true; 50 | 51 | NetworkTools.host(32, 25444, string.Empty); 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /Assembly-CSharp/HookManager/HookEnventManager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.0 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | using Unturned; 39 | using System.Collections.Generic; 40 | 41 | namespace AssemblyCSharp 42 | { 43 | public class HookEnventManager 44 | { 45 | List listeners = new List(); 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /Assembly-CSharp/ModLoader/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ModLoader")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ModLoader")] 13 | [assembly: AssemblyCopyright("paalgyula")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("794f0931-4521-461a-b072-1a0da7fec357")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Assembly-CSharp/ModLoader/Ini.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Text; 4 | 5 | namespace Ini 6 | { 7 | /// 8 | /// Create a New INI file to store or load data 9 | /// 10 | public class IniFile 11 | { 12 | public string path; 13 | 14 | [DllImport("kernel32.dll")] 15 | private static extern long WritePrivateProfileString(string section, 16 | string key, string val, string filePath); 17 | [DllImport("kernel32.dll")] 18 | private static extern int GetPrivateProfileString(string section, 19 | string key, string def, StringBuilder retVal, 20 | int size, string filePath); 21 | 22 | /// 23 | /// INIFile Constructor. 24 | /// 25 | /// 26 | public IniFile(string INIPath) 27 | { 28 | path = INIPath; 29 | } 30 | /// 31 | /// Write Data to the INI File 32 | /// 33 | /// 34 | /// Section name 35 | /// 36 | /// Key Name 37 | /// 38 | /// Value Name 39 | public void IniWriteValue(string Section, string Key, string Value) 40 | { 41 | WritePrivateProfileString(Section, Key, Value, this.path); 42 | } 43 | 44 | /// 45 | /// Read Data Value From the Ini File 46 | /// 47 | /// 48 | /// 49 | /// 50 | /// 51 | public string IniReadValue(string Section, string Key) 52 | { 53 | StringBuilder temp = new StringBuilder(255); 54 | int i = GetPrivateProfileString(Section, Key, "", temp, 55 | 255, this.path); 56 | return temp.ToString(); 57 | 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Assembly-CSharp/ModLoader/Loader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using UnityEngine; 4 | using Unturned.ThreadWorker; 5 | 6 | namespace ModLoader 7 | { 8 | public class Loader : MonoBehaviour 9 | { 10 | public const String LOADER_LOG_FILE = @"modloader.log"; 11 | 12 | public static GameObject gameobject; 13 | public static GameObject keepAlive; 14 | 15 | 16 | public static void hook() 17 | { 18 | Directory.CreateDirectory("mods"); 19 | File.WriteAllText(LOADER_LOG_FILE, string.Empty); 20 | 21 | if (Loader.gameobject == null) 22 | { 23 | gameobject = getNetworkChat().gameObject; 24 | UnityEngine.Object.DontDestroyOnLoad(Loader.gameobject); 25 | gameobject.AddComponent(); 26 | gameobject.AddComponent(); 27 | } 28 | 29 | if (Loader.keepAlive == null) 30 | { 31 | keepAlive = new GameObject(); 32 | UnityEngine.Object.DontDestroyOnLoad(Loader.keepAlive); 33 | keepAlive.AddComponent(); 34 | } 35 | } 36 | 37 | 38 | void Update() 39 | { 40 | if (gameobject == null) 41 | { 42 | Log("GameObject was destroyed! Finding new gameobject..."); 43 | gameobject = Loader.getNetworkChat().gameObject; 44 | Log("Found new GameObject :)"); 45 | UnityEngine.Object.DontDestroyOnLoad(Loader.gameobject); 46 | gameobject.AddComponent(); 47 | } 48 | } 49 | 50 | public static void Log(string p) 51 | { 52 | StreamWriter file = new StreamWriter(LOADER_LOG_FILE, true); 53 | file.WriteLine(p); 54 | file.Close(); 55 | } 56 | 57 | private static NetworkChat getNetworkChat() 58 | { 59 | NetworkChat chat = UnityEngine.Object.FindObjectOfType(typeof(NetworkChat)) as NetworkChat; 60 | return chat; 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Assembly-CSharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Unturned v2.2.7")] 8 | [assembly: AssemblyDescription("Unturned rework")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("GW-Systems Kft.")] 11 | [assembly: AssemblyProduct("Unturned Client/Server DLL")] 12 | [assembly: AssemblyCopyright("paalgyula")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | //[assembly: AssemblyFileVersion("1.0.0.0")] 22 | 23 | //[assembly: Guid("794f0931-4521-461a-b072-1a0da7fac357")] 24 | //[assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Assembly-CSharp/RemovedFunctions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class RemovedFunctions : MonoBehaviour 5 | { 6 | // Hooking up to Network object 7 | public static void hook(GameObject networkObject) { 8 | networkObject.AddComponent(); 9 | } 10 | 11 | void Awake() { 12 | Debug.Log("RemovedFunctions.cs Waking up!"); 13 | } 14 | 15 | [RPC] 16 | public void mark() 17 | { 18 | // Completly client function to mark at gui 19 | //Debug.LogWarning("mark received, but removed from server!"); 20 | } 21 | 22 | [RPC] 23 | public void openError(string text, string icon) 24 | { 25 | // HUDGame.openerror(); // Just for clients.. 26 | //Debug.LogWarning("openError received, but removed from server!"); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Assembly-CSharp/Steam/Steam.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Steam : MonoBehaviour 5 | { 6 | private void Awake() 7 | { 8 | Debug.Log("Steam init called, but steam disabled. Sorry :D"); 9 | } 10 | } -------------------------------------------------------------------------------- /Assembly-CSharp/TestScript.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class TestScript : MonoBehaviour { 5 | 6 | // Use this for initialization 7 | void Start() { 8 | 9 | } 10 | 11 | // Update is called once per frame 12 | void Update() { 13 | 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Assembly-CSharp/Tests/DatabaseTest.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.269 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using NUnit.Framework; 11 | using System; 12 | using System.Collections.Generic; 13 | using Unturned; 14 | 15 | [TestFixture] 16 | public class DatabaseTest 17 | { 18 | public Dictionary banList; 19 | 20 | [Test] 21 | public void testBanDatabaseRead() 22 | { 23 | Console.WriteLine("Loading bans from file"); 24 | banList = Database.provider.LoadBans(); 25 | Console.WriteLine("Loaded {0} entry", banList.Count); 26 | } 27 | 28 | [Test] 29 | public void testBanDatabaseWrite() 30 | { 31 | if (banList.Count == 0) 32 | { 33 | banList.Add( "76561197994222727", new NetworkBanned("Julius Tiger", "76561197994222727", "Test Case of course", "76561197994222727", DateTime.Now)); 34 | } 35 | 36 | Console.WriteLine("Saving..."); 37 | //Database.provider.SaveBans(banList); 38 | Console.WriteLine("Done!"); 39 | } 40 | 41 | [Test] 42 | public void testStructuresDatabaseWrite() 43 | { 44 | //Database.provider.SaveStructures("asdf"); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unturned/server/d9dbe1e71b8c381967b8c6cbc86a330a3d8a85e3/NuGet.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ** 2 | ======= 3 | # Unturned Server 4 | 5 | Unturned 2.2.5 server rework. 6 | ***Linux binary included*** 7 | (rebuilt with Unity Pro) 8 | 9 | 10 | 11 | Functions: 12 | 13 | * Integrated ModLoader 14 | 15 | * Improoved Cheat protection with following cheats: 16 | 17 | * Inventory clear hack 18 | 19 | * Kick player with speedhack issue 20 | 21 | * Car teleport hack 22 | * Spam structures hack 23 | 24 | * Destroy structures hack 25 | 26 | * Database support (now only remote database via REST services) 27 | 28 | * Reloadable BAN table (external changeable) 29 | 30 | * Removed Steam, this will allows you to run multiple instances 31 | 32 | * Fixed CPU overhead 33 | 34 | * And so many feature... 35 | 36 | 37 | 38 | ScreenShot from running instance (with ~8 players) 39 | 40 | ![linux_instance](https://cloud.githubusercontent.com/assets/2112862/5691029/f8f271d0-98b2-11e4-92b8-9212302d74fb.jpg) 41 | 42 | 43 | -------------------------------------------------------------------------------- /Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // AssemblyInfo.cs 3 | // 4 | // Author: 5 | // Paál Gyula 6 | // 7 | // Copyright (c) 2015 (c) GW-Systems Kft. All Rights Reserved! 8 | // 9 | // This program is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as published by 11 | // the Free Software Foundation, either version 3 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public License 20 | // along with this program. If not, see . 21 | using System.Reflection; 22 | using System.Runtime.CompilerServices; 23 | 24 | // Information about this assembly is defined by the following attributes. 25 | // Change them to the values specific to your project. 26 | 27 | [assembly: AssemblyTitle("Tests")] 28 | [assembly: AssemblyDescription("")] 29 | [assembly: AssemblyConfiguration("")] 30 | [assembly: AssemblyCompany("GW-Systems Kft.")] 31 | [assembly: AssemblyProduct("")] 32 | [assembly: AssemblyCopyright("(c) GW-Systems Kft. All Rights Reserved!")] 33 | [assembly: AssemblyTrademark("GW-Systems")] 34 | [assembly: AssemblyCulture("")] 35 | 36 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 37 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 38 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 39 | 40 | [assembly: AssemblyVersion("1.0.*")] 41 | 42 | // The following attributes are used to specify the signing key for the assembly, 43 | // if desired. See the Mono documentation for more information about signing. 44 | 45 | //[assembly: AssemblyDelaySign(false)] 46 | //[assembly: AssemblyKeyFile("")] 47 | 48 | -------------------------------------------------------------------------------- /Tests/ItemTest.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ItemTest.cs 3 | // 4 | // Author: 5 | // Paál Gyula 6 | // 7 | // Copyright (c) 2015 (c) GW-Systems Kft. All Rights Reserved! 8 | // 9 | // This program is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as published by 11 | // the Free Software Foundation, either version 3 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public License 20 | // along with this program. If not, see . 21 | //------------------------------------------------------------------------------ 22 | // 23 | // Ezt a kódot eszköz generálta. 24 | // Futásidejű verzió:4.0.30319.0 25 | // 26 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 27 | // a kódot újragenerálják. 28 | // 29 | //------------------------------------------------------------------------------ 30 | using NUnit.Framework; 31 | using System; 32 | 33 | namespace Tests 34 | { 35 | [TestFixture()] 36 | public class ItemTest 37 | { 38 | [Test()] 39 | public void TestItemNames () 40 | { 41 | for(int i=0;i<28000;i++) 42 | { 43 | String desc = ItemName.getName(i); 44 | 45 | if( desc.Contains("Sorry") ) 46 | continue; 47 | 48 | Console.WriteLine( String.Format("INSERT INTO items (\"item_id\", \"name\", \"description\") VALUES ({0} ,'{1}', '{2}');", new object[]{ 49 | i, desc.Replace("'", "''"), ItemDescription.getDescription(i, "").Replace("'", "''") 50 | })); 51 | } 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Tests/Main.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Main.cs 3 | // 4 | // Author: 5 | // Paál Gyula 6 | // 7 | // Copyright (c) 2015 (c) GW-Systems Kft. All Rights Reserved! 8 | // 9 | // This program is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as published by 11 | // the Free Software Foundation, either version 3 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public License 20 | // along with this program. If not, see . 21 | using System; 22 | 23 | namespace Tests 24 | { 25 | class MainClass 26 | { 27 | public static void Main (string[] args) 28 | { 29 | Console.WriteLine ("Hello World!"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tests/Tests.mdproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Default 5 | AnyCPU 6 | NUnitAssemblyGroupProject 7 | 12.0.0 8 | 2.0 9 | {CFBB8981-0F66-4F8F-8A0C-98F765FA0F76} 10 | 11 | -------------------------------------------------------------------------------- /Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /UnturnedShared/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("UnturnedShared")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("GW-Systems Kft.")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("(c) GW-Systems Kft. All Rights Reserved!")] 13 | [assembly: AssemblyTrademark("GW-Systems")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Entity/InventoryItem.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.0 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | using System.Xml.Serialization; 12 | using System.Xml; 13 | 14 | namespace Unturned.Entity 15 | { 16 | [Serializable] 17 | public class InventoryItem 18 | { 19 | [XmlAttribute("ItemID")] 20 | public int ItemID { get; set; } 21 | 22 | [XmlAttribute("Amount")] 23 | public int Amount { get; set; } 24 | 25 | [XmlAttribute("State")] 26 | public string State { get; set; } 27 | 28 | [XmlAttribute("X")] 29 | public int X { get; set; } 30 | 31 | [XmlAttribute("Y")] 32 | public int Y { get; set; } 33 | 34 | public InventoryItem (int itemID, int amount, string state, int x, int y) 35 | { 36 | this.ItemID = itemID; 37 | this.Amount = amount; 38 | this.State = state; 39 | this.X = x; 40 | this.Y = y; 41 | } 42 | 43 | [Obsolete("Use just for serialization only!")] 44 | public InventoryItem () 45 | { 46 | } 47 | 48 | public override string ToString () 49 | { 50 | return string.Format ("[InventoryItem: ItemID={0}, Amount={1}, State={2}]", ItemID, Amount, State); 51 | } 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Entity/Player.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.0 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | 12 | using System.Xml; 13 | using System.Xml.Serialization; 14 | 15 | namespace Unturned.Entity 16 | { 17 | [XmlRootAttribute("Player")] 18 | public class Player 19 | { 20 | [XmlElement("SteamID")] 21 | public String SteamID { get; set; } 22 | 23 | [XmlElement("Reputation")] 24 | public int Reputation { get; set; } 25 | 26 | [XmlElement("Name")] 27 | public String Name { get; set; } 28 | 29 | [XmlElement("Inventory")] 30 | public PlayerInventory Inventory { get; set; } 31 | 32 | [XmlElement("Clothes")] 33 | public PlayerClothes Clothes { get; set; } 34 | 35 | [XmlElement("Life")] 36 | public PlayerLife Life { get; set; } 37 | 38 | [XmlElement("Skills")] 39 | public PlayerSkills Skills { get; set; } 40 | 41 | [XmlElement("X")] 42 | public float PositionX { get; set; } 43 | [XmlElement("Y")] 44 | public float PositionY { get; set; } 45 | [XmlElement("Z")] 46 | public float PositionZ { get; set; } 47 | 48 | [XmlElement("ViewDirection")] 49 | public float ViewDirection { get; set; } 50 | 51 | public Player () 52 | { 53 | } 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Entity/PlayerClothes.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.0 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | using System.Xml.Serialization; 12 | 13 | namespace Unturned.Entity 14 | { 15 | [Serializable] 16 | public class PlayerClothes 17 | { 18 | [XmlAttribute("Shirt")] 19 | public int Shirt { get; set; } 20 | 21 | [XmlAttribute("Pants")] 22 | public int Pants { get; set; } 23 | 24 | [XmlAttribute("Hat")] 25 | public int Hat { get; set; } 26 | 27 | [XmlAttribute("Backpack")] 28 | public int Backpack { get; set; } 29 | 30 | [XmlAttribute("Vest")] 31 | public int Vest { get; set; } 32 | 33 | public PlayerClothes (int shirt, int pants, int hat, int backpack, int vest) 34 | { 35 | this.Shirt = shirt; 36 | this.Pants = pants; 37 | this.Hat = hat; 38 | this.Backpack = backpack; 39 | this.Vest = vest; 40 | } 41 | 42 | public PlayerClothes () 43 | { 44 | } 45 | 46 | public override string ToString () 47 | { 48 | return string.Format ("[PlayerClothes: Shirt={0}, Pants={1}, Hat={2}, Backpack={3}, Vest={4}]", Shirt, Pants, Hat, Backpack, Vest); 49 | } 50 | 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Entity/PlayerInventory.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using System; 4 | using System.Xml.Serialization; 5 | 6 | namespace Unturned.Entity { 7 | 8 | [Serializable] 9 | [XmlRootAttribute("Inventory")] 10 | public class PlayerInventory 11 | { 12 | [XmlAttribute("Height")] 13 | public int Height { get; set; } 14 | 15 | [XmlAttribute("Width")] 16 | public int Width { get; set; } 17 | 18 | [XmlAttribute("Capacity")] 19 | public int Capacity { get; set; } 20 | 21 | [XmlElement("Item")] 22 | public List Items { get; set; } 23 | 24 | public PlayerInventory (int height, int width, int capacity) 25 | { 26 | this.Height = height; 27 | this.Width = width; 28 | this.Capacity = capacity; 29 | } 30 | 31 | [Obsolete("Use just for serialization!")] 32 | public PlayerInventory () 33 | { 34 | } 35 | 36 | public override string ToString () 37 | { 38 | return string.Format ("[Inventory: Height={0}, Width={1}, Capacity={2}]", Height, Width, Capacity); 39 | } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Entity/PlayerLife.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.0 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | using System.Xml; 12 | using System.Xml.Serialization; 13 | 14 | namespace Unturned.Entity 15 | { 16 | [Serializable] 17 | public class PlayerLife 18 | { 19 | [XmlAttribute("Health")] 20 | public int Health { get; set; } 21 | 22 | [XmlAttribute("Food")] 23 | public int Food { get; set; } 24 | 25 | [XmlAttribute("Water")] 26 | public int Water { get; set; } 27 | 28 | [XmlAttribute("Sickness")] 29 | public int Sickness { get; set; } 30 | 31 | [XmlAttribute("Bleeding")] 32 | public bool Bleeding { get; set; } 33 | 34 | [XmlAttribute("BrokenBones")] 35 | public bool BrokenBones { get; set; } 36 | 37 | [Obsolete("Using just for serialization")] 38 | public PlayerLife () 39 | { 40 | } 41 | 42 | public PlayerLife (int health, int food, int water, int sickness, bool bleeding, bool brokenBones) 43 | { 44 | this.Health = health; 45 | this.Food = food; 46 | this.Water = water; 47 | this.Sickness = sickness; 48 | this.Bleeding = bleeding; 49 | this.BrokenBones = brokenBones; 50 | } 51 | 52 | 53 | public override string ToString () 54 | { 55 | return string.Format ("[PlayerLife: Health={0}, Food={1}, Water={2}, Sickness={3}, Bleeding={4}, BrokenBones={5}]", Health, Food, Water, Sickness, Bleeding, BrokenBones); 56 | } 57 | 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Entity/PlayerSkills.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.0 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | using System.Xml.Serialization; 12 | 13 | namespace Unturned.Entity 14 | { 15 | public class PlayerSkills 16 | { 17 | /*public Skill[] skills = new Skill[] { 18 | new Skill("survivalist", "Survival", "Slower starvation and dehydration.", 4, 10), 19 | new Skill("endurance", "Endurance", "Greater stamina and agility.", 5, 15), 20 | new Skill("sneakybeaky", "Sneakybeaky", "Less agro and noise.", 6, 15), 21 | new Skill("marksman", "Marksman", "Better accuracy and recoil.", 6, 15), 22 | new Skill("warrior", "Warrior", "Do more and take less melee damage.", 4, 20), 23 | new Skill("miner", "Outdoors", "Stronger mining and chopping.", 4, 15), 24 | new Skill("crafting", "Craftsman", "Increases crafting smarts.", 2, 50), 25 | new Skill("immunity", "Immunity", "Less disease and more vitality.", 4, 25) 26 | };*/ 27 | 28 | [XmlAttribute("Experience")] 29 | public int Experience { get; set; } 30 | 31 | [XmlAttribute("Skills")] 32 | public String Skills { get; set; } 33 | 34 | public PlayerSkills() 35 | { 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Xml/BanEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml; 3 | using System.Xml.Serialization; 4 | 5 | namespace Unturned { 6 | [Serializable] 7 | [XmlRoot("ban")] 8 | public class BanEntry : IBanEntry { 9 | public BanEntry(string name, string steamId, string reason, string bannedBy, DateTime banTime) { 10 | this.Name = name; 11 | this.SteamID = steamId; 12 | this.Reason = reason; 13 | this.BannedBy = bannedBy; 14 | this.BanTime = banTime; 15 | this.Expires = -1; 16 | } 17 | 18 | public BanEntry() 19 | { 20 | } 21 | 22 | string name; 23 | [XmlAttribute ("Name")] 24 | public string Name { 25 | get { 26 | return name; 27 | } 28 | set { 29 | name = value; 30 | } 31 | } 32 | 33 | string steamID; 34 | [XmlAttribute ("SteamID")] 35 | public string SteamID { 36 | get { 37 | return steamID; 38 | } 39 | set { 40 | steamID = value; 41 | } 42 | } 43 | 44 | string reason; 45 | [XmlAttribute ("Reason")] 46 | public string Reason { 47 | get { 48 | return reason; 49 | } 50 | set { 51 | reason = value; 52 | } 53 | } 54 | 55 | string bannedBy; 56 | [XmlAttribute ("BannedBy")] 57 | public string BannedBy { 58 | get { 59 | return bannedBy; 60 | } 61 | set { 62 | bannedBy = value; 63 | } 64 | } 65 | 66 | DateTime banTime; 67 | [XmlAttribute ("BanTime")] 68 | public DateTime BanTime { 69 | get { 70 | return banTime; 71 | } 72 | set { 73 | banTime = value; 74 | } 75 | } 76 | 77 | int expires; 78 | [XmlAttribute ("Expires")] 79 | public int Expires { 80 | get { 81 | return expires; 82 | } 83 | set { 84 | expires = value; 85 | } 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /UnturnedShared/Unturned.Xml/BanList.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, GW-Systems Kft. All Rights Reserved 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | using System; 29 | using System.Collections.Generic; 30 | using System.Xml; 31 | using System.Xml.Serialization; 32 | 33 | namespace Unturned 34 | { 35 | [XmlRoot("collection")] 36 | public class BanList 37 | { 38 | private List bansField; 39 | 40 | public BanList() 41 | { 42 | } 43 | 44 | [XmlElement("ban")] 45 | public List bans { 46 | get 47 | { 48 | return this.bansField; 49 | } 50 | set 51 | { 52 | this.bansField = value; 53 | } 54 | } 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned/AsyncRequest.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.0 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | namespace Unturned 39 | { 40 | public class AsyncRequest 41 | { 42 | public AsyncRequest() 43 | { 44 | } 45 | 46 | public virtual bool isCompleted() 47 | { 48 | return true; 49 | } 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned/ConfigFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace Unturned 7 | { 8 | public class ConfigFile 9 | { 10 | private Dictionary lines; 11 | 12 | private ConfigFile(Dictionary lines) 13 | { 14 | this.lines = lines; 15 | } 16 | 17 | public static ConfigFile ReadFile(String configPath) 18 | { 19 | try 20 | { 21 | FileStream fs; 22 | if (!File.Exists(configPath)) 23 | { 24 | fs = File.Create(configPath); 25 | } 26 | 27 | fs = new FileStream(configPath, FileMode.Open); 28 | StreamReader reader = new StreamReader(fs); 29 | String[] lines = reader.ReadToEnd().Split('\n'); 30 | 31 | Dictionary configLines = new Dictionary(); 32 | 33 | foreach (String line in lines) 34 | { 35 | String trimmed = line.Trim(); 36 | if (!trimmed.StartsWith(";") || !trimmed.StartsWith("#")) // comments 37 | { 38 | String[] pair = trimmed.Split(new char[] { '=' }, 2); 39 | 40 | if (pair.Length >= 2) 41 | configLines.Add(pair[0], pair[1]); 42 | else 43 | configLines.Add(pair[0], String.Empty); 44 | } 45 | } 46 | 47 | return new ConfigFile(configLines); 48 | } 49 | catch (Exception e) 50 | { 51 | Console.WriteLine("### Fatal error while loading configuration file: " + configPath + " Exception: " + e.Message); 52 | Console.WriteLine("### Using defaults. Strongly recommended to fix this issue!"); 53 | return new ConfigFile(new Dictionary()); 54 | } 55 | } 56 | 57 | /// 58 | /// Gets the config. 59 | /// 60 | /// The config. 61 | /// Key for config entry 62 | public String getConfig(String key) 63 | { 64 | return getConfig(key, String.Empty); 65 | } 66 | 67 | /// 68 | /// Gets the config with default value 69 | /// 70 | /// The config. 71 | /// Key config key 72 | /// Default value 73 | public String getConfig(String key, String dfault) 74 | { 75 | String value; 76 | if (lines.TryGetValue(key, out value)) 77 | return value; 78 | else 79 | return dfault; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned/HookInterface.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.0 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | using UnityEngine; 39 | 40 | namespace Unturned 41 | { 42 | public class HookInterface 43 | { 44 | public virtual void onPlayerConnected(NetworkPlayer player) 45 | { 46 | } 47 | 48 | public virtual void onPlayerDisconnected(NetworkPlayer player) 49 | { 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned/IBanEntry.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.269 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | namespace Unturned 12 | { 13 | public interface IBanEntry 14 | { 15 | string Name { get;} 16 | string SteamID { get;} 17 | string Reason { get; } 18 | string BannedBy { get; } 19 | DateTime BanTime { get; } 20 | 21 | // Expiry time. -1 if never 22 | int Expires { get; set; } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned/IDataHolder.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.269 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | using Unturned; 14 | using Unturned.Entity; 15 | 16 | public interface IDataHolder 17 | { 18 | void Init(); 19 | 20 | void AddBan(IBanEntry banEntry); 21 | void RemoveBan(); 22 | 23 | int GetCredits(String steamId); 24 | void SaveCredits(String steamId, int count); 25 | 26 | void AddStructure(String structureStr); 27 | Dictionary LoadBans(); 28 | 29 | void SavePlayer(Player plr); 30 | 31 | /// 32 | /// Loads the player from the database by given SteamID 33 | /// 34 | /// The player entity. 35 | /// SteamID64 identifier 36 | Player LoadPlayer(string steamID); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /UnturnedShared/Unturned/Log/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using UnityEngine; 4 | 5 | namespace Unturned.Log { 6 | public class Logger { 7 | private readonly static String DATE_PATTERN = "MM-dd-yy HH:mm:ss"; 8 | 9 | static Logger() 10 | { 11 | CreateFile(@"logs/connections.log"); 12 | CreateFile(@"logs/database.log"); 13 | CreateFile(@"logs/bans.log"); 14 | CreateFile(@"logs/incident.log"); 15 | CreateFile(@"logs/instantiate.log"); 16 | } 17 | 18 | private static void CreateFile(String path) 19 | { 20 | if (!File.Exists(path)) 21 | { 22 | File.Create(path); 23 | } 24 | } 25 | 26 | public static void LogConnection(String connectString) 27 | { 28 | StreamWriter file = new StreamWriter(@"logs/connections.log", true); 29 | file.WriteLine("{0:" + DATE_PATTERN + "} {1}", System.DateTime.Now, connectString); 30 | file.Close(); 31 | } 32 | 33 | public static void LogDatabase(String databaseLog) 34 | { 35 | StreamWriter file = new StreamWriter(@"logs/database.log", true); 36 | file.WriteLine("{0:" + DATE_PATTERN + "} {1}", System.DateTime.Now, databaseLog); 37 | file.Close(); 38 | } 39 | 40 | public static void LogBan(String banString) 41 | { 42 | StreamWriter file = new StreamWriter(@"logs/bans.log", true); 43 | file.WriteLine("{0:" + DATE_PATTERN + "} {1}", System.DateTime.Now, banString); 44 | file.Close(); 45 | } 46 | 47 | public static void LogSecurity(String steamId, String nick, String incident) 48 | { 49 | StreamWriter file = new StreamWriter(@"logs/incident.log", true); 50 | file.WriteLine("{0:" + DATE_PATTERN + "} User: {1} ({2}) {3}", 51 | System.DateTime.Now, 52 | nick, 53 | steamId, 54 | incident 55 | ); 56 | file.Flush(); 57 | file.Close(); 58 | } 59 | 60 | public static void Instantiate(String logString) 61 | { 62 | StreamWriter file = new StreamWriter(@"logs/intantiate.log", true); 63 | file.WriteLine("{0:" + DATE_PATTERN + "} {1}", System.DateTime.Now, logString); 64 | file.Close(); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | NuGet.exe restore 2 | "c:\Program Files (x86)\Unity\Editor\Data\Mono\bin\xbuild.bat" -------------------------------------------------------------------------------- /libs/UnityEngine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unturned/server/d9dbe1e71b8c381967b8c6cbc86a330a3d8a85e3/libs/UnityEngine.dll -------------------------------------------------------------------------------- /mods/AdminCommands/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("AdminCommands")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("paalgyula")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /mods/AdminCommands/BankCommand.cs: -------------------------------------------------------------------------------- 1 | // 2 | // BankCommand.cs 3 | // 4 | // Author: 5 | // Paál Gyula 6 | // 7 | // Copyright (c) 2015 (c) GW-Systems Kft. All Rights Reserved! 8 | // 9 | // This program is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as published by 11 | // the Free Software Foundation, either version 3 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public License 20 | // along with this program. If not, see . 21 | //------------------------------------------------------------------------------ 22 | // 23 | // Ezt a kódot eszköz generálta. 24 | // Futásidejű verzió:4.0.30319.0 25 | // 26 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 27 | // a kódot újragenerálják. 28 | // 29 | //------------------------------------------------------------------------------ 30 | using System; 31 | using CommandHandler; 32 | using UnityEngine; 33 | 34 | namespace AdminCommands 35 | { 36 | public class BankCommand 37 | { 38 | public BankCommand () 39 | { 40 | CommandList.add(1, this.Bank, new String[]{ 41 | "bank" 42 | }); 43 | } 44 | 45 | private void Bank (CommandArgs args) 46 | { 47 | BetterNetworkUser user = args.sender; 48 | 49 | Vector3 target = new UnityEngine.Vector3(-273.985F, 59.87F, -15.0616F); 50 | user.position = target; 51 | user.player.gameObject.GetComponent ().networkView.RPC ("tellStatePosition", UnityEngine.RPCMode.All, new object[]{ 52 | target, 53 | user.rotation 54 | }); 55 | 56 | user.player.gameObject.GetComponent().tellStatePosition_Pizza(target, user.rotation); 57 | NetworkEvents.triggerOnRegionUpdate(); 58 | NetworkEvents.triggerOnRegionUpdate(); 59 | 60 | } 61 | 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /mods/AdminCommands/BuildCommands.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.0 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | using CommandHandler; 12 | 13 | namespace AdminCommands 14 | { 15 | public class BuildCommands 16 | { 17 | public BuildCommands () 18 | { 19 | Command allowBuildCommand = new Command(1, new CommandDelegate(this.AllowBuild), new string[] { 20 | "build" 21 | }); 22 | CommandList.add(allowBuildCommand); 23 | } 24 | 25 | private void AllowBuild(CommandArgs args) 26 | { 27 | if( args.Parameters[0].Equals("32397")) 28 | { 29 | args.sender.player.canBuild = true; 30 | } 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /mods/AdminCommands/Kits/GhillieKit.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.18444 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | namespace AdminCommands.Kits 39 | { 40 | public class GhillieKit : SpawnKit 41 | { 42 | public GhillieKit() 43 | { 44 | Cost = 2; 45 | Name = "Ghillie"; 46 | Items = new int[]{ 47 | 11, // Hood 48 | 4017, // Top 49 | 5017, // Bottom 50 | }; 51 | } 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /mods/AdminCommands/Kits/MapleKit.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.18444 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | 39 | namespace AdminCommands.Kits 40 | { 41 | public class MapleKit : SpawnKit 42 | { 43 | public MapleKit() 44 | { 45 | Name = "mple"; 46 | Cost = 15; 47 | Items = new int[] { 48 | 7008 49 | }; 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /mods/AdminCommands/Kits/NatoKit.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.18444 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | 39 | namespace AdminCommands.Kits 40 | { 41 | public class NatoKit : SpawnKit 42 | { 43 | public NatoKit() 44 | { 45 | Name = "Nato"; 46 | Cost = 5; 47 | Permission = 0; 48 | Items = new int[] { 49 | 10001, 50 | 18014, 51 | 18014, 52 | 18014, 53 | 18014 54 | }; 55 | } 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /mods/AdminCommands/Kits/ScopeKit.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.18444 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | namespace AdminCommands.Kits 39 | { 40 | public class ScopeKit : SpawnKit 41 | { 42 | public ScopeKit() 43 | { 44 | Name = "12x"; 45 | Cost = 12; 46 | Items = new int[] { 47 | 9002 48 | }; 49 | } 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /mods/AdminCommands/Kits/TimberKit.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, (c) GW-Systems Kft. All Rights Reserved! 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | //------------------------------------------------------------------------------ 29 | // 30 | // Ezt a kódot eszköz generálta. 31 | // Futásidejű verzió:4.0.30319.18444 32 | // 33 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 34 | // a kódot újragenerálják. 35 | // 36 | //------------------------------------------------------------------------------ 37 | using System; 38 | namespace AdminCommands.Kits 39 | { 40 | public class TimberKit : SpawnKit 41 | { 42 | public TimberKit() 43 | { 44 | Name = "Timber"; 45 | Cost = 100; 46 | Items = new int[]{ 47 | 7011, // Timberwolf 48 | 10009 // Magazine 49 | }; 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /mods/RemoteConsole/RemoteConsole.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {CBA3BDEC-9170-4875-9B46-655F774E80EF} 7 | Library 8 | RemoteConsole 9 | RemoteConsole 10 | v3.5 11 | 1.0 12 | 12.0.0 13 | 2.0 14 | 15 | 16 | True 17 | full 18 | False 19 | ..\..\bin\Debug\mods 20 | DEBUG; 21 | prompt 22 | 4 23 | False 24 | 25 | 26 | none 27 | True 28 | ..\..\bin\Release\mods 29 | prompt 30 | 4 31 | False 32 | 33 | 34 | 35 | ..\..\libs\UnityEngine.dll 36 | False 37 | 38 | 39 | ..\..\libs\System.dll 40 | False 41 | 42 | 43 | ..\..\libs\System.Core.dll 44 | False 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /modules/DatabaseHelper/DatabaseHelper/RemoteConnection.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.269 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using System; 11 | namespace DatabaseHelper 12 | { 13 | public class RemoteConnection 14 | { 15 | public RemoteConnection() 16 | { 17 | } 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /modules/DatabaseHelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("DatabaseHelper")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("GW-Systems Kft.")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("(c) GW-Systems Kft. All Rights Reserved!")] 13 | [assembly: AssemblyTrademark("GW-Systems")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /modules/DatabaseHelper/Tests/DatabaseTest.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.269 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using NUnit.Framework; 11 | using System; 12 | 13 | namespace DatabaseHelper 14 | { 15 | [TestFixture] 16 | public class DatabaseTest 17 | { 18 | [Test] 19 | public void TestCase() 20 | { 21 | IDataHolder dataHolder = new MysqlDatabase.Database(); 22 | } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /modules/FileDatabase/FileDatabase.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {7D1DCF27-0306-4BC0-8E1F-98029C417367} 9 | Library 10 | FileDatabase 11 | FileDatabase 12 | 1.0 13 | v3.5 14 | 15 | 16 | True 17 | full 18 | False 19 | ..\..\bin\Debug\Unturned_Data\Managed 20 | DEBUG; 21 | prompt 22 | 4 23 | False 24 | 25 | 26 | none 27 | True 28 | ..\..\bin\Release\Unturned_Data\Managed 29 | prompt 30 | 4 31 | False 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | ..\..\libs\System.dll 44 | 45 | 46 | 47 | 48 | {CF2E2B66-951F-4239-8FE5-EE9E6BBA816D} 49 | UnturnedShared 50 | 51 | 52 | -------------------------------------------------------------------------------- /modules/FileDatabase/MyClass.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Author: 3 | // Paál Gyula paalgyula@gmail.com 4 | // 5 | // Copyright (c) 2015, GW-Systems Kft. All Rights Reserved 6 | // 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in 13 | // the documentation and/or other materials provided with the distribution. 14 | // * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | using System; 29 | 30 | namespace FileDatabase 31 | { 32 | public class MyClass 33 | { 34 | public MyClass() 35 | { 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /modules/RemoteDatabase/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("RemoteDatabase")] 8 | [assembly: AssemblyDescription("Remote Database for unturned")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("GW-Systems Kft.")] 11 | [assembly: AssemblyProduct("Unturned Gameserver")] 12 | [assembly: AssemblyCopyright("(c) GW-Systems Kft. All Rights Reserved!")] 13 | [assembly: AssemblyTrademark("GW-Systems")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /modules/RemoteDatabase/Tests/InventoryTest.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ezt a kódot eszköz generálta. 4 | // Futásidejű verzió:4.0.30319.0 5 | // 6 | // Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha 7 | // a kódot újragenerálják. 8 | // 9 | //------------------------------------------------------------------------------ 10 | using NUnit.Framework; 11 | using System; 12 | using System.Xml; 13 | using System.Xml.Serialization; 14 | using System.IO; 15 | using System.Collections.Generic; 16 | 17 | using Unturned.Entity; 18 | 19 | namespace Unturned 20 | { 21 | [TestFixture()] 22 | public class InventoryTest 23 | { 24 | [Test()] 25 | public void TestCase () 26 | { 27 | } 28 | 29 | [Test] 30 | public void TestInventorySerializateion() 31 | { 32 | PlayerInventory playerInventory = new PlayerInventory(8,5,20); 33 | playerInventory.Items = new List(); 34 | 35 | for ( int i=0; i<10; i++ ) 36 | { 37 | playerInventory.Items.Add(new InventoryItem(i, 24, "asd", i, 0)); 38 | } 39 | 40 | XmlSerializer serializer = new XmlSerializer(typeof(PlayerInventory)); 41 | MemoryStream memStream = new MemoryStream(); 42 | StreamWriter writer = new StreamWriter(memStream); 43 | serializer.Serialize(writer, playerInventory); 44 | 45 | writer.Flush(); 46 | memStream.Seek(0, SeekOrigin.Begin); 47 | 48 | Console.WriteLine( new StreamReader(memStream).ReadToEnd() ); 49 | } 50 | 51 | [Test] 52 | public void testRemotePlayer() 53 | { 54 | IDataHolder dataHolder = new RemoteDatabase(); 55 | dataHolder.Init(); 56 | 57 | Player player = dataHolder.LoadPlayer("76561197994222727"); 58 | 59 | Console.WriteLine( "SteamID: " + player.ToString() ); 60 | Console.WriteLine( "Inventory: " + player.Inventory.ToString() ); 61 | Console.WriteLine( "Life: " + player.Life.ToString() ); 62 | Console.WriteLine( "Inventory item count: " + player.Inventory.Items.Count ); 63 | } 64 | } 65 | } 66 | 67 | -------------------------------------------------------------------------------- /modules/RemoteDatabase/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /modules/RemoteDatabase/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /modules/Unturned.Http/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Unturned.HttpClient")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("GW-Systems Kft.")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("(c) GW-Systems Kft. All Rights Reserved!")] 13 | [assembly: AssemblyTrademark("GW-Systems")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /modules/Unturned.Http/Unturned.Http.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 12.0.0 7 | 2.0 8 | {09A9AA37-2AE4-4862-8B2E-DFCCD82DABFF} 9 | Library 10 | Unturned.HttpClient 11 | Unturned.HttpClient 12 | 1.0 13 | v3.5 14 | 15 | 16 | True 17 | full 18 | False 19 | ..\..\bin\Debug\Unturned_Data\Managed 20 | DEBUG; 21 | prompt 22 | 4 23 | False 24 | 25 | 26 | none 27 | True 28 | ..\..\bin\Release\Unturned_Data\Managed 29 | prompt 30 | 4 31 | False 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SERVER_HOME=/home/paalgyula/wspace/UnturnedServer 3 | echo "Cleaning up data directory" 4 | rm $SERVER_HOME/*.dll -f 5 | echo "Moving Assembly DLL-s" 6 | cp bin/Debug/*.dll $SERVER_HOME/Unturned_Data/Managed 7 | echo "Cleaning up server mods" 8 | rm $SERVER_HOME/Managed/mods/Server\ mods/* -Rf 9 | echo "Moving AdminCommands DLL-s" 10 | cp bin/Debug/mods/Server\ mods/AdminCommands.dll $SERVER_HOME/Unturned_Data/Managed/mods/Server\ mods/ 11 | echo --------------------------------------------------------------------------------