Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Buzzkill

Pages: [1] 2
1
Releases / SteamTeam - Steam Group Membership Award System
« on: May 24, 2016, 10:32:31 AM »
SteamTeam - Steam Group Membership Award System
Written by Buzzkill -- thehundredacrebloodbath.com
https://github.com/100acrebb/thab_tools

(I apologize for the name. It's stupid, but it stuck)

SteamTeam is a framework for detecting player membership to a Steam group and awarding in-game bonuses as a result. It is currently a work in progress, and support for multiple groups and
multiple bonus types is forthcoming, as well as separating out and improving the configuration of groups/bonuses.


An example configuration is included in source, with notes on important values. This is probably the best approach to configuration documentation for now.

Membership is checked upon user initial spawn as well as every 10 mins.
NOTE: IT CURRENTLY ONLY SUPPORTS A SINGLE GROUP AND A SINGLE BONUS (Pointshop 1 points as well as a configurable callback -- see inline notes in source below).

Code: [Select]
-- One group for now
STEAMTEAM.Groups[1] = {}
-- URL of the target group
STEAMTEAM.Groups[1].URL = "http://steamcommunity.com/groups/100acrebb"
-- A configurable callback. In this example, I set a networked boolean if the user is a member of the above group.
-- I'm using this in other areas - for example, a custom icon in HatsChat
STEAMTEAM.Groups[1].OnIsMember = function(self, ply) ply:SetNWBool( "THABMember", true ) end
STEAMTEAM.Groups[1].Bonus = {}

-- One bonus for now
STEAMTEAM.Groups[1].Bonus[1] = {}
-- The bonus type (PSPOINTS only, for now)
STEAMTEAM.Groups[1].Bonus[1].Type = "PS1POINTS"
-- The number of points
STEAMTEAM.Groups[1].Bonus[1].Amount = 10000


https://github.com/100acrebb/thab_tools/blob/master/lua/autorun/server/steamteam.lua

2
Suggestions / UCL docs edit?
« on: April 22, 2016, 08:38:18 AM »
Noticed this today in the UCL lib docs..


Quote
Player:CheckGroup

This function is similar to IsUserGroup(), but this one checks the UCL group chain as well.  For example, if a user is in group “owner” which inherits from “superadmin”, this function will return true if you check the user against “superadmin”, where IsUserGroup() wouldn’t.

Since creating a group above superadmin is understandably frowned upon, maybe the docs should be changed so as to not highlight that pattern?  :)

Thanks,
Buzz

3
Releases / MapTractor
« on: April 21, 2016, 06:21:43 AM »
MapTractor  - GMod Map Stats Tracking Routine
Written by Buzzkill / thehundredacrebloodbath.com
https://github.com/100acrebb/thab_tools/blob/master/lua/autorun/server/maptractor.lua


MapTractor generates statistics around server map usage, with a focus on identifying what maps attract or repel players. MapTractor polls the server every minute and updates
the json file "data/maptractor.txt" with statistics for the current map. Here's an example entry:

Code: [Select]
"deathrun_cb_egypt_v1":      <- map name
{
"version": 2, <- statistics version.
"totaltime": 3734, <- total minutes the map has run on the server.
"timempty": 695, <- total minutes the map has been empty.
"playerscore": 27746, <- cumulative total players seen in this map, per minute.
"magnetscore": 11673, <- cumulative total players added to this map since it started, per minute.
"playermetric": 7.4306, <- the map's player score / total time
"magnetmetric": 3.1261 <- the map's magnet score / total time
},

"playermetric" is essentially the average playercount for the map.  "magnetmetric" takes it further and considers how many players were on the map when it started versus at the moment,
thereby indicating the relative attractiveness or repulsiveness of a certain map.  In other words, do players tend to join or leave the server while this map is running?

A sample ULX implementation is included.  The ulx command "ulx mapstats / !mapstats" will generate a list of map statistics sorted by magnetmetric to console.

To Do:
  Build out an optional routine to load the most popular map(s) when the server goes empty.
  Eliminate the need for ULX for the !mapstats command
  Incorporate peak time / off time concepts, so maps don't get penalized for running during off-hours, etc.

4
Off-Topic / npc_citizen and vehicle noclip
« on: April 05, 2016, 07:44:28 AM »
Trying to prevent noclipping of npc_citizens through player-spawned vehicles (ie, I want to be able to run over npc_citizens).  Works as expected w/ npc_combine_s.  Not sure what setter or keypair for citizens would resolve this.  Have gone up and down the exposed garrysmod code and can't find it.

For what I'm trying to do, using npc_citizens would be much simpler than creating my own npc from scratch  (or trying to make npc_combine_s act like a citizen).

Thanks,
Buzz

5
Releases / Gag4Me
« on: April 02, 2016, 08:59:57 AM »
I saw this https://scriptfodder.com/jobs/view/8053 and a couple other similar requests here and figured I might as well release.  For gamemodes that don't natively support mic gagging (Alien Isolation, Elevator, etc, etc), this provides users with a ulx command to toggle local mic gagging of individuals



Code: [Select]
CATEGORY_NAME = "THAB"
function ulx.gag4me( calling_ply, target_plys, should_ungag )
local players = player.GetAll()
if calling_ply.ulx_gagged4me == nil then
calling_ply.ulx_gagged4me = {}
end

for i=1, #target_plys do
local v = target_plys[ i ]

calling_ply.ulx_gagged4me[ v:SteamID() ] = not should_ungag

end

if not should_ungag then
ulx.fancyLogAdmin( calling_ply, true, "#A gagged4me #T", target_plys )
else
ulx.fancyLogAdmin( calling_ply, true, "#A ungagged4me #T", target_plys )
end
end
local gag4me = ulx.command( CATEGORY_NAME, "ulx gag4me", ulx.gag4me, "!gag4me", true )
gag4me:addParam{ type=ULib.cmds.PlayersArg }
gag4me:addParam{ type=ULib.cmds.BoolArg, invisible=true }
gag4me:defaultAccess( ULib.ACCESS_ALL )
gag4me:help( "Gag target (mute mic) for individuals. For gamemodes that don't support mic mute on scoreboard." )
gag4me:setOpposite( "ulx ungag4me", {_, _, true}, "!ungag4me" )

local function gag4meHook( listener, talker )
if listener.ulx_gagged4me == nil then return end

if listener.ulx_gagged4me[talker:SteamID()] then
return false
end
end
hook.Add( "PlayerCanHearPlayersVoice", "ULXGag4Me", gag4meHook )

6
Community Servers / The Hundred Acre Bloodbath
« on: April 01, 2016, 03:55:56 PM »
My signature was cute at one point, but it's getting obnoxious even for me, so I've decided to put one post here with the THAB server info and do away with the signature from <censor>.

The Hundred Acre Bloodbath is a community of 28 servers running over 30 gamemodes.  If you're in the neighborhood, check us out!

THAB Steam Group

In no particular order....



7
Releases / LagDetector
« on: March 26, 2016, 12:47:22 AM »

  /)          /)                       
 // _   _   _(/  _ _/_  _  _ _/_ _____
(/_(_(_(_/_(_(__(/_(___(/_(__(__(_)/ (_
      .-/                             
     (_/           
   
                 
GMod Server Lag Detection Routine
Written by Buzzkill    --    thehundredacrebloodbath.com
https://github.com/100acrebb/thab_tools
http://steamcommunity.com/sharedfiles/filedetails/?id=654334461

LagDetector is a simple tool to help detect and manage server-side lag.  It uses differences between SysTime() and CurTime() to detect
unexpected server lag, and once these deltas have exceeded a certain threshold, action can be taken to help correct.

These thresholds and actions are configurable through cvars:
lagdet_range      - if the difference between SysTime and CurTime exceeds this value in a frame, we have detected frame lag and the system increments the lag counter. Default is 0.07
lagdet_count      - if the lag counter reaches this value, we have detected server lag and we execute lagdet_execute. Default is 5
lagdet_quiet      - indicates how long we must go (in seconds) with no frame lag before our lag counter resets to 0.
lagdet_execute      - the console command(s) to execute if we detect server lag. Default is a simple say
lagcount_meltdown   - if we detect this many frame lags without a reset, we execute lagexecute_meltdown. Default is 100
lagexecute_meltdown   - these console command(s) are executed in the event of massive lag.  Server is probably in a collision loop or something. Good time to restart the map. Default is a simple say

So, using the defaults..
LagDetector will compare SysTime and CurTime every second.  If the difference between the two >= 0.07, the lag counter increases.
If we go 15 seconds without detecting frame lag, the lag counter resets to 0.
If the lag counter hits 5, we execute the commands in lagdet_execute
If the lag counter hits 100, we execute the commands in lagexecute_meltdown

8
Releases / DBugR
« on: October 10, 2015, 10:50:25 AM »
************* NOT MINE ******************

This clone of oubliette32's brilliant DBugR tool includes a small fix to support revisions in hook architecture in recent months.  All credit goes to oubilette32. This tool has been indispensable to me in tracking down CPU-hungry addons, etc.

https://github.com/100acrebb/DBugR
https://github.com/100acrebb/DBugR/archive/master.zip


Original release/docs by oubliette32
https://github.com/oubliette32/DBugR

9
Releases / ULX Groupmembers
« on: October 10, 2015, 10:32:36 AM »
Simple ULX addon that allow you to dump a list of group members or complete staff members to console. 

!groupmembers <groupname>
!staffmembers

(Staff groups are currently set to superadmin, admin, operator and moderator.  You'll need to update the list in the lua file to accommodate different groups)


https://github.com/100acrebb/ulx-groupmembers
https://github.com/100acrebb/ulx-groupmembers/archive/master.zip

10
Releases / ULX MatManager
« on: October 10, 2015, 10:21:40 AM »
This simple ULX addon will allow players to turn off trails (!notrails) or custom materials (!nomaterials) for their current map round.  This is useful for players who experience lag when a high number of trails are in use.

To clarify -- this doesn't actually turn trails off -- it prevents other people's trails from rendering on the player's local machine.  The materials option is secondary, and may not be as valuable to anyone.  I wrote it to allow local players to toggle the rendering of custom playermodel materials that are sold in Pointshop on THAB servers.

https://github.com/100acrebb/ulx-matmanager
https://github.com/100acrebb/ulx-matmanager/archive/master.zip

11
Releases / Cards Against GMod 0.10
« on: October 10, 2015, 09:18:02 AM »
I'm starting to formalize some of the things I've worked on over the past few months and releasing as my pay-it-forward moment.  Even though not everything is ULib / ULX related, I'd like to release here since this is where I received the vast majority of support when I first came on the scene. 

First up is actually the most recent thing I created -- a chat based version of Cards Against Humanity.  This allows players to play CaH (or, rather, CaG) while in-game.  No docs yet, but the majority of the code is in sv_cag1.lua and is a pretty easy read.  You can also say "!cag help" in game for in-game docs.

The questions and answers are, of course, directly from CaH (and covered under their Creative Commons license, which I do need to place in the code).  Anyone who isn't familiar with CaH, be warned -- they can get quite vulgar.  Sense of humor needed.  :)


https://github.com/100acrebb/cards-against-gmod   (GitHub Source)
https://github.com/100acrebb/cards-against-gmod/archive/master.zip   (direct zip download from GitHub)

12
Developers Corner / ULibCommandCalled and args
« on: July 26, 2015, 07:39:48 AM »
Hey all.  Quick question.  I'm building a secondary logging system to highlight the use of ULX commands (I want this in the console logs and in a specific format, so the current logging options don't work for me).  I'm hooking into ULibCommandCalled.  I'm seeing tokenized target ids in the arguments (e.g., $3371261519) when someone uses the ULX gui to issue a target-based command.   Is there a simple way to translate these back into player ents?   I know I can use ULibPlayerTarget(s), but I'd rather only use one hook for target-based and non-target based commands.

Thanks!

13
Developers Corner / Shell from lua
« on: June 07, 2015, 12:35:56 PM »
I know there has been discussions and projects around this in the past, but most roads I've walked down have turned into dead-ends.  I've written a small set of python scripts that let me do things globally across all of my servers (via the python-valve libraries that let me push commands to rcon).  I would now like to be able to call these python scripts from within ULX, so I can globally manage / globally communicate across all the servers.

The gm_python project looked interesting, but it appears dead and I can't find the source anywhere.  Does anyone have any leads on how to call either python or shell from within gmod lua  (without having to use a thrift or socket server as middleware, if possible).

Thanks.

14
Hey all.  We're testing out a new gamemode that came out recently called Bug Boys.  It's a pretty cool tower defense game.  The author has done some amazing work. You can check out a trailer here:  https://www.youtube.com/watch?v=4YLl-7Xzxes  and the full release thread here:  http://facepunch.com/showthread.php?t=1461407

There are a few servers listed on that thread, and we're running ours at sbox1.thehundredacredbloodbath.com:27615.   Stop by if you'd like to take a peek.

Cheers,
Buzz

15
Releases / Nomalua -- GMod/Lua malware scanner (v1.20)
« on: April 19, 2015, 09:54:02 AM »
Nomalua v1.20 (released 2015-04-21)


Nomalua is a malware scanner for GMod Lua files.  It scans Lua files on the server (including those mounted through Steam Workshop GMA files) and reports on any suspicious code or code patterns that may warrant further invesitgation.

IT IS IMPORTANT to understand that detection by Nomalua does NOT necessarily mean you have a problem -- simply that a code construct or pattern exists that meets Nomalua's critera for reporting.  **The vast majority of alerts will be false positives**.  However, when you run an addon you are trusting that author to be a good citizen. Addons can harbor backdoors and other nefarious code.  It's better to trust but verify rather than simply trust blindly. Nomalua allows server administrators to have better insight into what's running without having to analyze every addon line-by-line. This is especially true as more server administrators use addons through the Steam Workshop, which makes it harder for admins to review code and track updates.


----------  DEVELOPER & SUPPORT  ----------

Nomalua was developed by "BuzzKill".  Visit http://forums.ulyssesmod.net/index.php/topic,8477.0.html for support and release info.



----------  REQUIREMENTS  ----------

Nomalua has no requirements.



----------  INSTALLATION  ----------

To install Nomalua, simply extract the files from the archive to your garrysmod/addons folder.
When you've done this, you should have a file structure like this--
   <garrysmod>/addons/nomalua/lua/autorun/init.lua
   <garrysmod>/addons/nomalua/lua/sv_nomalua.lua
etc..


Please note that installation is the same on dedicated servers. Installation requires a server restart.



----------  USAGE  ----------

Once installed and the server restarted, you can run the scanner by opening console and issuing the "nomalua_scan" command.  If running directly on the server, you should immediately begin to see output (sample below).  If running through a client, you must have superadmin priviledges. When running through a client console there may be a delay before output is rendered. Nomalua is rather resource-intensive, so it's not recommended that you run it when the server is particularly busy.

Nomalua reports back the following (sample):

Code: [Select]
2 - AUTHENT (Presence of Steam ID) gamemodes/jailbreak/gamemode/core/cl_menu_help_options.lua:218 : Excl (STEAM_0:0:19441588) - Lead developer in charge of Jail Break since version 1
4 - NETWORK (HTTP server call) addons/hatschat2/lua/hatschat/cl_init.lua:196 http.Fetch( FUrl, function( body, len, header, code)
2 - BANMGMT (Ban by IP address) addons/customcommands_onecategory/lua/ulx/modules/sh/cc_util.lua:283 local banip = ulx.command( "Custom", "ulx banip", ulx.banip )
2 - DYNCODE (Dynamic code execution) lua/autorun/luapad.lua:152 RunString(file.Read("luapad/_server_globals.txt", "DATA"));
2 - FILESYS (File deletion) addons/customcommands_onecategory/lua/ulx/modules/sh/cc_util.lua:909 file.Delete( "watchlist/" .. id .. ".txt" )
3 - OBFUSC (Obfuscated / encrypted code) lua/includes/extensions/string.lua:34 str = str:gsub( "\226\128\168", "\\\226\128\168" )

The first column contains the risk rating, check type and description.  Currently, Nomalua detects dynamic code (code that executes dynamically, using compilestring, etc), authentication checks (references to Steam IDs), network activity (calls to http.Post and Fetch), ban related items (changes in ban status), obfuscated code (bytecode, encryption) and file system calls (file deletions). The risk rating is from 1 through 5, 5 being the highest.  Currently the rating system is rather arbitrary -- it will be firmed up over time.

The second column points to the file and line number of the detection.  Note that if this addon is contained within in a GMA, you will need to manually decompress the .gma file in order to view the file directly.

The third column shows the line itself, with the detection phrase highlighted in yellow.



----------  CONFIGURATION  ----------

Whitelisting (beta):  Whitelisting is currently managed in the sv_nomalua_whitelist.lua file, specifically via calls to NOMALUA.AddWhiteListElement, which takes 3 parameters.  The first parameter in the call is a Lua pattern  (see http://lua-users.org/wiki/PatternsTutorial for a tutorial in Lua patterns).  The second parameter is the line number (0 to match all), and the third is the detection group ("*" to match all). Whitelisting is currently Beta and will be moved to a proper data file in a future release.

Whitelist samples:

Code: Lua
  1.         NOMALUA.AddWhiteListElement("addons/nomalua/lua/sv_nomalua.lua", 0, "*")                -- prevents Nomalua from reporting on its own pattern checks
  2.         NOMALUA.AddWhiteListElement("addons/cac%-release%-.*.lua", 0, "*")                      -- ignores Cake Anti-cheat
  3.         NOMALUA.AddWhiteListElement("addons/ulib/lua/ulib/server/player.lua", 0, "BANMGMT")     -- Ignores ban related items in ULib's player.lua
  4.  



----------  CHANGELOG  ----------

v1.20 - *(2015-04-21)*
-- * Added risk rank (currently 1 - 5, 5 highest.  Rather arbitrary for now.  Still beta. <censor>, the whole thing is still beta)
-- * Optimized check type and pattern check definition code
-- * Fixed bug in directory recursion code
-- * misc minor optimizations
-- * Added additional pattern checks

v1.11 - *(2015-04-20)*
   * Bug fix.  AddLuaFiles returning nil under certain conditions, causing scan to error out.
   
v1.10 - *(2015-04-20)*
   * Adjusted directory recursion logic to prepend root search directory
   * Added whitelisting and some default whitelist items
   * Restructured lua file search so that matching files in addons/<addonname>/lua/... and lua/... purposely collide in storage table (de-dupe)
   * Refactored scan to queue output, eliminating need to pass ply var around.

v1.00 - *(2015-04-19)*
   * Initial version

   

----------  LICENSE  ----------

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to
Creative Commons
543 Howard Street
5th Floor
San Francisco, California 94105
USA



(what the heck does "nomalua" mean?  No-Mal-Lua. Get it?  Don't worry - the code is better than the name.  :)  )

Pages: [1] 2