Tommy228 / tttdamagelogs

Damagelogs and RDM Manager for Trouble in Terrorist Town (a Garry's Mod gamemode)
GNU General Public License v3.0
57 stars 73 forks source link

Bugs - Please Fix? #390

Open SouthpawAnex opened 4 years ago

SouthpawAnex commented 4 years ago

Bugs in order of importance:

First bug: The player "huminater" is a Traitor and kills two players, which comes up in red. But then the player "violet" is also a Traitor and kills a player, but her logs are the normal colour? I've even watched this bug happen in real-time, as in the colour goes from how it should usually look, and changes to red, for a log recording that shouldn't be red. Seems like the logs aren't turning into the correct colours sometimes.

Second bug: If you are reported multiple times, you can't respond to all the reports and are forced to reconnect.

Third bug: The report chat that Admins can open, no longer closes. This is quite irritating.

Fourth bug: If you !aslay (player) (amount) but leave the reason blank, it shows as (s) in chat and doesn't default to any preset reason. Probably because the default reason has been removed from the config.lua - and I'm not on about the list of default reasons in the ban / slay feature via the F8 menu.

Please fix these asap.

RockonBen commented 4 years ago

Found a "fix" to the admin chat bug. In server/chat.lua, line 308, there's an if statement that references an entity "to_add". This entity does not work properly, and is null. Thus, whenever you try to close the chat, the function just exits out. I changed it to only check ply:CanUseRDMManager(). This will allow the function to complete as normal. The stable release used to only check ply:CanUseRDMManager(), and I don't know why they added the additional checks.

I say "fix", however, because if a player disconnects from the server and tries to reconnect to the chat later, including the admin, the panel will glitch out and be completely unable to draw. I have no idea how to fix that. But at least the chat closes now.

RockonBen commented 4 years ago

Also - bug 4 has an easy fix: before they added the 16 default reasons instead of 1, there was a line in the config that said Damagelog.Autoslay_DefaultReason = "your string here" WITHOUT a number, unlike the rest of them (Damagelog.Autoslay_DefaultReason1, Damagelog.Autoslay_DefaultReason2, etc.). For some reason they removed it from the config. Readd that line, bug gets fixed.

For bug 2, I can't seem to duplicate it. Had 3 people report me as a test, all 3 exited out just fine. I have, however, seen people reconnecting because of this, but I think this happens in the stable 3.0.0 release as well. I think it's just random.

RockonBen commented 4 years ago

I fixed the logging colors but it's a fucking mess. Basically they changed the logging to go off of SteamID64's for some reason, probably because TTT2 compatibility. So I basically copied and pasted code from the stable v3.0.0 release and commented out the newer versions of those functions.

events.zip I've attached my code. Note that this will not work with TTT2. Go into tttdamagelogs/lua/damagelogs/shared and delete events.lua and the events/ folder. Extract my zip once you've done that. Use at your own risk.

SouthpawAnex commented 4 years ago

Thank you so much, would it be easier to just upload a zip of the damagelogs with these fixes? You're using the latest version right?

RockonBen commented 4 years ago

Unfortunately, you should use my notes/zip files. I've injected some code specific to my server purposes so it would cause errors on yours.

BadgerCode commented 4 years ago

I'll have a go at recreating these changes @RockonBen . Thanks a lot!

BadgerCode commented 4 years ago

Regarding the default slay reason, I followed your steps RockonBen. In lua/damagelogs/config/config.lua

Damagelog.Autoslay_DefaultReason = "broke server rules"

However, I did also have to change the code, as the aslay interface automatically sets "no reason specified" as the reason. In lua/damagelogs/client/tabs/rdm_manager.lua

-- Replace this (line 1024)
self.CustomReason:SetText(TTTLogTranslate(GetDMGLogLang, "DefaultReason"))

-- With this
self.CustomReason:SetText("")

https://github.com/BadgerCode/tttdamagelogs/pull/1/commits/c9c38baae9b6fa9b2f619d9ef9ae686920341a33

BadgerCode commented 4 years ago

Your other fixes seem to work for issue 1 (row colours incorrect) and issue 3 (can't close admin report). We're going to try to reproduce and understand issue 2 (multiple reports).

Thanks a lot for your help @RockonBen !

BadgerCode commented 4 years ago

Steps to reproduce multiple reports issue

This only seems to happen some of the time.

  1. New round starts
  2. Player A kills player B. Player B reports player A.
  3. Player A kills player C. Player C reports player A.
  4. Player A dies and is automatically requested to answer their reports
  5. Player A answers player B's report and submits their answer.

Expected result Player A's response to player B's report is submitted. Player A is requested to answer player C's report.

Actual result Player A's response to player B's report is submitted. Player B's report is still visible. Player C's report cannot be selected (clicking the button does nothing). Submit button is disabled.