New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Discord Forward Hook #420

Closed
wants to merge 20 commits into
base: v1.x
from

Conversation

Projects
None yet
5 participants
@rumblefrog
Copy link
Member

rumblefrog commented Mar 13, 2018

Description

Listens for forward SBPP_OnBanPlayer and SBPP_OnReportPlayer and sends it to Discord's webhook endpoint(s)

Requires SteamWorks & SMJansson to be installed

Motivation and Context

Following the broad trend of Discord users, thought it might benefit a lot of users

How Has This Been Tested?

  • SBPP's Main, Report & Discord Plugin with the latest commit on this branch
  • Sourcemod 1.8.6041
  • SteamWorks Git 126
  • SMJansson 2.3.1.3

Screenshots (if appropriate):

Ban
Report

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

rumblefrog and others added some commits Mar 12, 2018

🐛 SBPP Ban Forward Invalid Target
As a result of target being kicked within then next few tick(s), the target ID passed in the original forward will not be valid
🔒 Made Hook Endpoints Private
Appended protected flag to endpoint cvars

@rumblefrog rumblefrog self-assigned this Mar 13, 2018

@rumblefrog rumblefrog requested a review from Groruk Mar 13, 2018

@rumblefrog rumblefrog changed the title Discord Forward Hook :sparkles: Discord Forward Hook Mar 13, 2018

@rumblefrog rumblefrog changed the title :sparkles: Discord Forward Hook ✨ Discord Forward Hook Mar 13, 2018

@rumblefrog

This comment has been minimized.

Copy link
Member

rumblefrog commented Mar 13, 2018

For release which ships precompiled binary, it should ship within the disabled folder as it requires additional dependency and convars to setup and not everyone is going to have it.

@CrazyHackGUT

This comment has been minimized.

Copy link
Contributor

CrazyHackGUT commented Mar 13, 2018

SteamWorks

SteamWorks have problems with sending HTTP requests. Sometimes with small chance it starts sending the same request thousands of times.
I implemented similar module with using REST in Pawn a 9 months ago.
default
default
https://github.com/CrazyHackGUT/Discord/blob/master/addons/sourcemod/scripting/discord_sb.sp

@rumblefrog

This comment has been minimized.

Copy link
Member

rumblefrog commented Mar 13, 2018

Sometimes with small chance it starts sending the same request thousands of times.

Is there an issue registered with this? I personally never experienced this.

@CrazyHackGUT

This comment has been minimized.

Copy link
Contributor

CrazyHackGUT commented Mar 14, 2018

Nope, but one my friend encountered this. Sometimes him plugin "arranges DDoS", and one game server sends 1000+ requests on him server.
img

@Sarabveer

This comment has been minimized.

Copy link
Member

Sarabveer commented Mar 14, 2018

@Groruk

This comment has been minimized.

Copy link
Member

Groruk commented Mar 15, 2018

For release which ships precompiled binary, it should ship within the disabled folder as it requires additional dependency and convars to setup and not everyone is going to have it.

Theoreticaly we could move the PR into it's own repo and make it an optional extension for SourceBans++ that way. Just like the DonationControl++ is an optional extension for the webpanel and has it's own repo.

@Groruk

Groruk approved these changes Mar 15, 2018

@KyleSanderson

This comment has been minimized.

Copy link

KyleSanderson commented Mar 15, 2018

???

If there's an issue with SteamWorks.ext this is the first time in 4 years anyone has mentioned it. If this is a real issue create a test case and actually file a bug. I can't read russian glyphs and there's zero code.

Rest in Pawn to my knowledge still segfaults like crazy and has a bunch of race conditions; but dealers choice.

@CrazyHackGUT

This comment has been minimized.

Copy link
Contributor

CrazyHackGUT commented Mar 16, 2018

I forked Rest in Pawn half-year ago, and fixed this segfault.

@rumblefrog

This comment has been minimized.

Copy link
Member

rumblefrog commented Mar 16, 2018

Closing this in favor of a separate repo: https://github.com/sbpp/discord-forward

@rumblefrog rumblefrog closed this Mar 16, 2018

@rumblefrog rumblefrog deleted the discord-forward-hook branch Mar 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment