From bb27299d3caf53106b78f988d53afeb517dd27ce Mon Sep 17 00:00:00 2001 From: David Vogel Date: Wed, 22 Jan 2020 15:25:58 +0100 Subject: [PATCH] Prepare for github & add license --- .gitignore | 89 +++++++++++++++++++++ .vscode/settings.json | 7 ++ LICENSE | 21 +++++ README.md | 28 +++++++ lua/autorun/cl_d3stats.lua | 5 ++ lua/d3stats/cl_hud.lua | 5 ++ lua/d3stats/cl_init.lua | 5 ++ lua/d3stats/cl_network.lua | 5 ++ lua/d3stats/gamemodes/sv_zombiesurvival.lua | 5 ++ lua/d3stats/init.lua | 5 ++ lua/d3stats/sh_concommand.lua | 5 ++ lua/d3stats/sh_level.lua | 5 ++ lua/d3stats/sh_settings.lua | 7 +- lua/d3stats/sv_map.lua | 5 ++ lua/d3stats/sv_network.lua | 5 ++ lua/d3stats/sv_storage.lua | 5 ++ lua/d3stats/vgui/overlay.lua | 5 ++ 17 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a787ec4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,89 @@ +# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig + +# Created by https://www.gitignore.io/api/windows,visualstudiocode,lua +# Edit at https://www.gitignore.io/?templates=windows,visualstudiocode,lua + +### Lua ### +# Compiled Lua sources +luac.out + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.gitignore.io/api/windows,visualstudiocode,lua + +# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..42346f0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "cSpell.words": [ + "Vogel", + "garrysmod", + "pointshop" + ] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5ce5494 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 David Vogel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fcca6d1 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# D3stats + +A simple addon managing map statistics and player levels. + +- It outputs statistics about the win ratio of a map at the begging of a round +- It gives the players a level, XP and permission to use or buy the hammer +- XP is earned by gaining pointshop points as human or by killing humans as zombie +- Player levels increase after gathering a certain amount of XP +- Permissions are given after a specific level is reached +- All those things are freely configurable + +## State + +It works, but the addon is not finished, and probably will not be finished in the forseeable future. + +## Usage + +- Create a folder called `d3stats` inside of your addon folder of your Garry's Mod server +- Copy files by either: + - Clone the repository inside the created folder + - If you download the repository as zip, move the **content** of `D3bot-master` inside the created folder +- You should get a folder structure like: `.../garrysmod/addons/d3stats/lua` +- You can change settings as you wish inside of `.../garrysmod/addons/d3stats/lua/d3stats/sh_settings.lua"` +- Done + +## License + +[MIT](LICENSE) diff --git a/lua/autorun/cl_d3stats.lua b/lua/autorun/cl_d3stats.lua index 555c393..1807abb 100644 --- a/lua/autorun/cl_d3stats.lua +++ b/lua/autorun/cl_d3stats.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + if SERVER then include("d3stats/init.lua") else diff --git a/lua/d3stats/cl_hud.lua b/lua/d3stats/cl_hud.lua index 4887b68..a12261f 100644 --- a/lua/d3stats/cl_hud.lua +++ b/lua/d3stats/cl_hud.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + -- Delete HUD and redo if already existent. This will reset the displayed values until the next update from the server if D3stats.D3statsOverlay then D3stats.D3statsOverlay:Remove() diff --git a/lua/d3stats/cl_init.lua b/lua/d3stats/cl_init.lua index 371b8a2..347f0c2 100644 --- a/lua/d3stats/cl_init.lua +++ b/lua/d3stats/cl_init.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + D3stats = D3stats or {} -- Includes diff --git a/lua/d3stats/cl_network.lua b/lua/d3stats/cl_network.lua index 30b335e..fa6a557 100644 --- a/lua/d3stats/cl_network.lua +++ b/lua/d3stats/cl_network.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + net.Receive("D3stats_UpdateXP", function() local XP = net.ReadUInt(32) diff --git a/lua/d3stats/gamemodes/sv_zombiesurvival.lua b/lua/d3stats/gamemodes/sv_zombiesurvival.lua index b554a20..f9d4a5b 100644 --- a/lua/d3stats/gamemodes/sv_zombiesurvival.lua +++ b/lua/d3stats/gamemodes/sv_zombiesurvival.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + --[[ Any "zombie survival" gamemode specific code goes in here diff --git a/lua/d3stats/init.lua b/lua/d3stats/init.lua index ed9d40b..ce678fb 100644 --- a/lua/d3stats/init.lua +++ b/lua/d3stats/init.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + --[[ XP and statistics addon for the "Zombie Survival" gamemode diff --git a/lua/d3stats/sh_concommand.lua b/lua/d3stats/sh_concommand.lua index 5a1158f..d2e373a 100644 --- a/lua/d3stats/sh_concommand.lua +++ b/lua/d3stats/sh_concommand.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + if SERVER then concommand.Add("D3stats_clearall", function(ply, cmd, args, argsString) diff --git a/lua/d3stats/sh_level.lua b/lua/d3stats/sh_level.lua index 396d686..197086c 100644 --- a/lua/d3stats/sh_level.lua +++ b/lua/d3stats/sh_level.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + -- Calculate the level from the given XP function D3stats.CalculateLevel(XP) local Level = 1 diff --git a/lua/d3stats/sh_settings.lua b/lua/d3stats/sh_settings.lua index e332eb1..5363b8e 100644 --- a/lua/d3stats/sh_settings.lua +++ b/lua/d3stats/sh_settings.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + --[[ Settings and level definitions are stored in here @@ -7,7 +12,7 @@ Settings and level definitions are stored in here -- Permissions -- - Everything not in this list will be allowed by default -- - AllowIfLessThan: If the amount of players who have the permission is lower than this number, allow it anyway --- - Team: AllowIfLessThan only counts the specified team. In ZS: TEAM_SURVIVOR = 4, +-- - Team: Only counts "AllowIfLessThan" in the specified team. In ZS: TEAM_SURVIVOR = 4, D3stats.Permissions = { --["Buy_Hammer"] = {AllowIfLessThan = 4, Team = 4}, --["Use_Hammer"] = {AllowIfLessThan = 4, Team = 4}, diff --git a/lua/d3stats/sv_map.lua b/lua/d3stats/sv_map.lua index c0ed52b..855f6cf 100644 --- a/lua/d3stats/sv_map.lua +++ b/lua/d3stats/sv_map.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + function D3stats.Map_Message(roundend, ply) local map = game.GetMap() local count, wins, avg_players = D3stats.Storage.Map_Get(map) diff --git a/lua/d3stats/sv_network.lua b/lua/d3stats/sv_network.lua index 7ff3985..a76cf6d 100644 --- a/lua/d3stats/sv_network.lua +++ b/lua/d3stats/sv_network.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + util.AddNetworkString("D3stats_UpdateXP") local meta = FindMetaTable("Player") diff --git a/lua/d3stats/sv_storage.lua b/lua/d3stats/sv_storage.lua index ff5f949..6d78481 100644 --- a/lua/d3stats/sv_storage.lua +++ b/lua/d3stats/sv_storage.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + --[[ Storage stuff diff --git a/lua/d3stats/vgui/overlay.lua b/lua/d3stats/vgui/overlay.lua index b08f7cb..c5f5445 100644 --- a/lua/d3stats/vgui/overlay.lua +++ b/lua/d3stats/vgui/overlay.lua @@ -1,3 +1,8 @@ +-- Copyright (c) 2020 David Vogel +-- +-- This software is released under the MIT License. +-- https://opensource.org/licenses/MIT + local PANEL = {} function PANEL:Init()