sourcebans-pp icon indicating copy to clipboard operation
sourcebans-pp copied to clipboard

Fix Comms, Nasty Issue (LOL)

Open ClaudiuHKS opened this issue 4 years ago • 6 comments

I can't understand how it hasn't been fixed by now.

ClaudiuHKS avatar May 14 '20 07:05 ClaudiuHKS

I'm guessing it hasn't been fixed since it isn't actually an issue as the TempUnBlock function resets the DataPack before doing anything else with it (LOL)

The-Doggy avatar May 14 '20 10:05 The-Doggy

I'm guessing it hasn't been fixed since it isn't actually an issue as the TempUnBlock function resets the DataPack before doing anything else with it (LOL)

Actually he right. Here: https://github.com/sbpp/sourcebans-pp/blob/2dca124299f4690fb61c9933bd3485ae16d1b9a0/game/addons/sourcemod/scripting/sbpp_comms.sp#L1514 And here: https://github.com/sbpp/sourcebans-pp/blob/2dca124299f4690fb61c9933bd3485ae16d1b9a0/game/addons/sourcemod/scripting/sbpp_comms.sp#L1519 Plugin write cell on position. With 16 it's corrupt reason string in datapack. Third cell is type: https://github.com/sbpp/sourcebans-pp/blob/2dca124299f4690fb61c9933bd3485ae16d1b9a0/game/addons/sourcemod/scripting/sbpp_comms.sp#L2531

... Actually... For what pass DataPack in function and unpack it's again? I think we must pass normal params in this function.

TheByKotik avatar May 14 '20 11:05 TheByKotik

Oh yeah, my bad. His pull request just sounded super condescending to me so I wanted to be super condescending back :p But yeah normal params could be used instead of DataPack here if need be, would save having to declare variables for them inside the function at least.

The-Doggy avatar May 14 '20 12:05 The-Doggy

It was throwing error logs. I hate seeing error logs in my logs folder. It only happened for !ungag !unsilence or !unmute.

ClaudiuHKS avatar May 15 '20 15:05 ClaudiuHKS

Wrong. Value must be 2. My mistake. Positions start from 0. Actually this code can be removed. https://github.com/sbpp/sourcebans-pp/blob/39ca1c51e56a81f0ec3abe1e3f4a1cd94d8caa65/game/addons/sourcemod/scripting/sbpp_comms.sp#L1393 https://github.com/sbpp/sourcebans-pp/blob/39ca1c51e56a81f0ec3abe1e3f4a1cd94d8caa65/game/addons/sourcemod/scripting/sbpp_comms.sp#L1425 https://github.com/sbpp/sourcebans-pp/blob/39ca1c51e56a81f0ec3abe1e3f4a1cd94d8caa65/game/addons/sourcemod/scripting/sbpp_comms.sp#L1499-L1523 This checks always false: https://github.com/sbpp/sourcebans-pp/blob/39ca1c51e56a81f0ec3abe1e3f4a1cd94d8caa65/game/addons/sourcemod/scripting/sbpp_comms.sp#L1512 https://github.com/sbpp/sourcebans-pp/blob/39ca1c51e56a81f0ec3abe1e3f4a1cd94d8caa65/game/addons/sourcemod/scripting/sbpp_comms.sp#L1517 Because b_success == true only here: https://github.com/sbpp/sourcebans-pp/blob/39ca1c51e56a81f0ec3abe1e3f4a1cd94d8caa65/game/addons/sourcemod/scripting/sbpp_comms.sp#L1425 But if target != 0 (second check on 1499 line) called this function above:

  1. PerformUnMute(target);
  2. stock void PerformUnMute(int target)
  3. MarkClientAsUnMuted(target);
  4. stock void MarkClientAsUnMuted(int target)
  5. g_MuteType[target] = bNot;

(Almost same trace for PerformUnGag) And checks never pass. If any magic forced this checks passed, we have new error: DataPack closed in TempUnBlock() and new stacktrace here! Also i not found any other need to call this code.

TheByKotik avatar May 19 '20 13:05 TheByKotik

Сan someone test this version? https://github.com/TheByKotik/sourcebans-pp/blob/comms-fix-and-cleanup/game/addons/sourcemod/scripting/sbpp_comms.sp I'm did little changes and tried fix that. I can't test it in different situations also i haven't time for fix it by another way. It must resolve this completely for now.

TheByKotik avatar Jun 23 '20 10:06 TheByKotik