• Print

Author Topic: [Code Dump] Two addons from my now defunct TTT server  (Read 16348 times)

0 Members and 1 Guest are viewing this topic.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
[Code Dump] Two addons from my now defunct TTT server
« on: February 15, 2016, 01:01:59 pm »
So, my TTT server had a long run, but ultimately I was forced to close it down due to a major security hole that had slipped under my nose that allowed for an attacker with some know-how to grab a list of the current online players' IP addresses. For those who are curious, it's a known exploit in PAC3, and if possible you should use some sort of http redirect to prevent serving content from unknown sources.

Anyway. I have two addons lying around that I had put together (probably from some other people's code, but at this point it's been too long to tell) for the server that I would rather not go to waste. They're small and mundane, but I know at least someone will get some use out of them.

I tried reformatting and refactoring these so they were at least a tiny bit sensible, but I can't say for sure if they work now. If they don't, I can release the original, untouched, working versions... you'll just have to edit out the pony stuff.

TTT Killer Stats
All this does is print out some information about who killed a player to chat in a nice format. Useful for raging at yourself for getting someone down to 1 HP but not killing them, or for more serious things like determining RDM.
TO DOWNLOAD: See the attached files in small font below this post.

TTT Role Counter
LIke the last one, this is pretty simple. This just counts the number of players with each role on the start of a round, and prints it to chat and to server console. Useful for knowing how at-risk you are. :p
TO DOWNLOAD: See the attached files in small font below this post.

NOTE: You MUST be registered and logged in to see attached files!

Update: I've signed the zip files with my PGP key, so if you want to verify your download, you can use their signatures:
pp2_ttt_killer_stats.zip.asc
pp2_ttt_role_counter.zip.asc
(yes, it's kind of complicated -- run gpg --verify <filename>.zip.asc <filename>.zip and see if that works. ;P)
« Last Edit: March 20, 2016, 09:43:36 am by Bytewave »
bw81@ulysses-forums ~ % whoami
Homepage

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #1 on: February 15, 2016, 05:19:23 pm »
Instructions unclear: Do I need to be logged in to see the files or no?
Once you get to know me, you'll find you'll have never met me at all.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #2 on: February 15, 2016, 06:18:50 pm »
Instructions unclear: Do I need to be logged in to see the files or no?
hue
bw81@ulysses-forums ~ % whoami
Homepage

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #3 on: February 15, 2016, 07:09:43 pm »
Where/how do I download?
:D

Nice to see you contributing code again, even if due to bad reasons.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Tom Lucette

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
  • I am Tom Lucette
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #4 on: February 17, 2016, 10:47:23 am »
Is there a way to make it so I can type "!rdm" like a ulx command and it tells me that information

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #5 on: February 18, 2016, 07:18:03 am »
Is there a way to make it so I can type "!rdm" like a ulx command and it tells me that information
Not that I know of, unless you explicitly store attacker data. Perhaps it is possible, but my addons don't support it at this time. I may take a look into it, but no promises.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Vilobion

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #6 on: February 28, 2016, 11:56:17 am »
Killer stats didn't seem to have any effect once I placed it into addons.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #7 on: February 28, 2016, 02:43:20 pm »
Killer stats didn't seem to have any effect once I placed it into addons.
I suspected there might be some issues.
Do you get any errors on either the client or server? And how did you install the addon?
bw81@ulysses-forums ~ % whoami
Homepage

Offline Vilobion

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #8 on: February 28, 2016, 07:25:14 pm »
I renamed the folder "ttt_killer_stats" and dropped it in the usual addons folder for my server.

I get no console messages on kill.

Killer stats is showing on server launch (it's listed below).
Code: Lua
  1. Extracting...
  2. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/boom_body'
  3. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/customcommands'
  4. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/extraulxcommands'
  5. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/gmod-defibrillator-master'
  6. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/gmod-mapvote-master'
  7. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/jihad_bomb2'
  8. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/melon_launcher'
  9. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/molotov'
  10. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/motd'
  11. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/niandrastrails'
  12. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/pointshop'
  13. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/rpg'
  14. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/ttt-weapons'
  15. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/ttt_killer_stats'
  16. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/ttt_loadout_menu-master'
  17. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/ttt_sb_ranks_for_ulx'
  18. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/tttdamagelogs'
  19. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/ulib'
  20. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/ulx'
  21. Adding Filesystem Addon '/home/tcagame_svc12783/TravisE/12783/garrysmod/addons/utime-master'
  22. Unknown command "cl_cmdrate"
  23. Unknown command "cl_updaterate"
  24. Unknown command "rate"
  25. Changing gamemode to Trouble in Terrorist Town (terrortown)
  26. WARNING: Port 27005 was unavailable - bound to port 27007 instead
  27. Network: IP 69.197.181.43, mode MP, dedicated Yes, ports 27035 SV / 27007 CL
  28. PREP OK
  29. SOLID_VPHYSICS static prop with no vphysics model! (models/props_buildings/buildingskybox_002a.mdl)
  30. SOLID_VPHYSICS static prop with no vphysics model! (models/props_buildings/buildingskybox_002a.mdl)
  31. HTTP failed - ISteamHTTP isn't available!
  32.  

Did get this though (Most of it I believe is related to what I did to the ULX MOTD file, but some lists Killer_Stats explicitly:
Code: Lua
  1. [HeavensEagle|3|STEAM_0:1:93435304] Lua Error:
  2.  
  3. [ERROR] addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22: attempt to index global 'LANG' (a nil value)
  4.   1. unknown - addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22
  5.  
  6.  
  7. [HeavensEagle|3|STEAM_0:1:93435304] Lua Error:
  8.  
  9. [ERROR] lua/includes/extensions/net.lua:32: Received bad RPC, invalid function (ulx.rcvMotd)!
  10.   1. func - [C]:-1
  11.    2. unknown - lua/includes/extensions/net.lua:32
  12.  
  13.  
  14. [HeavensEagle|3|STEAM_0:1:93435304] Lua Error:
  15.  
  16. [ERROR] lua/includes/extensions/net.lua:32: Received bad RPC, invalid function (ulx.showMotdMenu)!
  17.   1. func - [C]:-1
  18.    2. unknown - lua/includes/extensions/net.lua:32
  19.  
  20.  
  21. Dropped HeavensEagle from server (Disconnect by user.)
  22. [Vilobion|2|STEAM_0:1:32495114] Lua Error:
  23. SetFontInternal: font doesn't exist (TheDefaultSettingstwo)
  24.  
  25. [Vilobion|2|STEAM_0:1:32495114] Lua Error:
  26. SetFontInternal: font doesn't exist (TheDefaultSettingstwo)
  27.  
  28. [Vilobion|2|STEAM_0:1:32495114] Lua Error:
  29.  
  30. [ERROR] addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22: attempt to index global 'LANG' (a nil value)
  31.   1. unknown - addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22
  32.  
  33.  
  34. [Vilobion|2|STEAM_0:1:32495114] Lua Error:
  35.  
  36. [ERROR] lua/includes/extensions/net.lua:32: Received bad RPC, invalid function (ulx.rcvMotd)!
  37.   1. func - [C]:-1
  38.    2. unknown - lua/includes/extensions/net.lua:32
  39.  
  40.  
  41. [Vilobion|2|STEAM_0:1:32495114] Lua Error:
  42.  
  43. [ERROR] lua/includes/extensions/net.lua:32: Received bad RPC, invalid function (ulx.showMotdMenu)!
  44.   1. func - [C]:-1
  45.    2. unknown - lua/includes/extensions/net.lua:32
  46.  

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #9 on: February 29, 2016, 08:20:58 am »
-snip-

Did get this though (Most of it I believe is related to what I did to the ULX MOTD file, but some lists Killer_Stats explicitly:
Code: Lua
  1. [HeavensEagle|3|STEAM_0:1:93435304] Lua Error:
  2.  
  3. [ERROR] addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22: attempt to index global 'LANG' (a nil value)
  4.   1. unknown - addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22
  5.  
  6. [Vilobion|2|STEAM_0:1:32495114] Lua Error:
  7.  
  8. [ERROR] addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22: attempt to index global 'LANG' (a nil value)
  9.   1. unknown - addons/ttt_killer_stats/lua/autorun/client/pp2_ttt_killer_stats_cl.lua:22
  10.  

Yeah, okay. I thought there would be an issue with translations.
I'll try and read up on how to get that fixed.Currently, I don't have access to the original code for these addons, but they're not hard to put back together--just remove any LANG calls and hardcode them.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: [Code Dump] Two addons from my now defunct TTT server
« Reply #10 on: March 18, 2016, 07:48:43 pm »
Bump

The code in both addons should be working now, at the expense of hardcoded strings. The attached files in the OP have been updated.

Sorry about the long wait. I've had a lot on my plate recently.
bw81@ulysses-forums ~ % whoami
Homepage

  • Print