AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Sourcebridge (BETA) (https://forums.alliedmods.net/showthread.php?t=337893)

gabuch2 05-23-2022 23:50

[ANY] Sourcebridge (BETA)
 
1 Attachment(s)
https://i.imgur.com/IYlbs3T.png
Sourcebridge
Author: gabuch2
Powered by Matterbridge, Sourcebridge is a plugin for Sourcemod that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.

https://i.imgur.com/3tcvbb8.png

Description

Using Matterbridge API, this plugin allows you to bridge your game server with a Matterbridge installation, relaying messages from/to a growing number of protocols.

You can also bridge multiple servers together so the players can chat between each one.

Protocols natively supported in Matterbridge
  • Mattermost
  • IRC
  • XMPP
  • Gitter
  • Slack
  • Discord
  • Telegram
  • Rocket.chat
  • Matrix
  • Steam (Bugged for now)
  • Twitch
  • Ssh-chat
  • WhatsApp
  • Zulip
  • Keybase

Dependencies

This plugin requires the following to work:
Supported Games

This plugin is supposed to be mod agnostic. All official games should work out of the box.

Tested Games
  • Left 4 Dead 2

Installation Instructions
  • Do not download the .smx file from here. As the webcompiler lacks the includes needed to generate the plugin correctly.
  • Download all requirements, plus the .sm file.
  • Place include files in the /scripting/includes directory.
  • Compile the plugin and install the newly generated .smx file. (Remember to install the latest version of REST in Pawn in your server)

Setting up Sourcebridge

This quickstart guide assumes you already have a working Matterbridge installation.

Open your matterbridge.toml file and add the following lines:

Code:

[api.myserver]
BindAddress="0.0.0.0:1337"
Token="verysecrettoken"
Buffer=1000
RemoteNickFormat="{NICK}"

Where "myserver" is goes the name of the relay, you can put anything.

Find your gateway where you want to relay the messages.
Quote:

[[gateway]]
name="cstrike"
enable=true

[[gateway.inout]]
account="discord.mydiscord"
channel="general"

[[gateway.inout]]
account="api.myserver"
channel="api"
Where cstrike is goes the gateway name. You can change it using cvars, you can add more gateway.inout entries depending on how many protocols do you want to relay messages.

Avatar Spoofing

It's possible to set up avatars for each user on protocols that support it. You need to get a Steam Web API key and place it in the respective cvar.

Roadmap

As this is a port of my previous project, MatterAMXX. The roadmap is to implement most of its features so you can enjoy Sourcebridge at its fullest. The plugin is already in an usable state but lacks most of MatterAMXX features.

Console Variables
Code:
// Enable Sourcebridge. // - // Default: "1" sm_sourcebridge_enabled "1" // Matterbridge gateway on where Sourcebridge should connect to. // - // Default: "" sm_sourcebridge_gateway "" // Domain of where your Matterbridge instance is hosted. // - // Default: "localhost" sm_sourcebridge_host "localhost" // Define whether Sourcebridge should print incoming messages. // - // Default: "1" sm_sourcebridge_incoming "1" // Define whether Sourcebridge should send server chat messages. // - // Default: "1" sm_sourcebridge_outgoing "1" // Define whether the plugin should add a zero-width space after the @ sign in the messages. // - // Default: "1" sm_sourcebridge_outgoing_chat_zwsp_at "1" // Define whether the plugin should output the map name at the start of the game. // - // Default: "0" sm_sourcebridge_outgoing_display_map "0" // Define whether the plugin should output join messages. // - // Default: "1" sm_sourcebridge_outgoing_join "1" // Define whether the plugin should output leave messages. // - // Default: "1" sm_sourcebridge_outgoing_quit "1" // URL pointing to the avatar system messages should use. It takes effect after restart. // - // Default: "" sm_sourcebridge_outgoing_system_avatar "" // The name of system messages whenever they get send to the Matterbridge instance (join/leaves, kills, etc). It takes effect after restart. // - // Default: "Server" sm_sourcebridge_outgoing_system_name "Server" // Port on where your Matterbridge instance is running. // - // Default: "1337" sm_sourcebridge_port "1337" // Protocol of your Matterbridge instance. (http/https) // - // Default: "http" sm_sourcebridge_protocol "http" // Define how much Sourcebridge should wait before querying new incoming messages. It takes effect after restart. // - // Default: "3" sm_sourcebridge_retry_delay "3" // Token for Steam API queries. Required for player avatars. // - // Default: "" sm_sourcebridge_steam_token "" // Token of your Matterbridge gateway. // - // Default: "" sm_sourcebridge_token ""

Change Log
  • 0.9.2 BETA
    • Request handles are no longer freed. Fixes an error in the plugin.
  • 0.9.1 BETA
    • Bots no longer trigger join/leave messages
  • 0.9 BETA
    • Public Beta Release

Credits
  • 42wim
    Main developer of Matterbridge.
  • Michael Wieland
    His MatterBukkit plugin for Minecraft inspired me to create MatterAMXX and this.

gabuch2 05-23-2022 23:51

Re: Sourcebridge (BETA)
 
Reserved for future use.

This is my first Sourcemod plugin!

gabuch2 05-24-2022 00:20

Re: [ANY] Sourcebridge (BETA)
 
0.9.1 BETA released A.K.A. how could I forget about bots?
  • 0.9.1 BETA
    • Bots no longer trigger join/leave messages

Drixevel 05-24-2022 03:11

Re: [ANY] Sourcebridge (BETA)
 
Sexy

AuricYoutube 05-24-2022 06:44

Re: [ANY] Sourcebridge (BETA)
 
I am getting handle invalid errors.

Quote:

L 05/24/2022 - 14:42:08: [SM] [1] Line 141, C:\sourcemod-1.10.0-git6528-windows\addons\sourcemod\scripting\sourcebrid ge.sp::ReadMessagesFromBridge
L 05/24/2022 - 14:42:09: [SM] Exception reported: Handle fb8b0c03 is invalid (error 3)
L 05/24/2022 - 14:42:09: [SM] Blaming: sourcebridge.smx
L 05/24/2022 - 14:42:09: [SM] Call stack trace:
L 05/24/2022 - 14:42:09: [SM] [0] CloseHandle
L 05/24/2022 - 14:42:09: [SM] [1] Line 141, C:\sourcemod-1.10.0-git6528-windows\addons\sourcemod\scripting\sourcebrid ge.sp::ReadMessagesFromBridge
Edit: I am on CSGO.

gabuch2 05-24-2022 09:20

Re: [ANY] Sourcebridge (BETA)
 
Quote:

Originally Posted by AuricYoutube (Post 2780064)
I am getting handle invalid errors.



Edit: I am on CSGO.

Looks like deleting the HTTP handle wasn't needed after all!
  • 0.9.2 BETA
    • Request handles are no longer freed. Fixes an error in the plugin.

eyal282 05-24-2022 09:29

Re: [ANY] Sourcebridge (BETA)
 
Can this thing be used to relay SQLite Bans from one server to the other without MySQL?

Some servers cannot get a MySQL to themselves without a price.

mrmiki 05-24-2022 10:41

Re: [ANY] Sourcebridge (BETA)
 
Quote:

Originally Posted by eyal282 (Post 2780073)
Can this thing be used to relay SQLite Bans from one server to the other without MySQL?

Some servers cannot get a MySQL to themselves without a price.




im using rcon with your plugin to add ban on other servers

gabuch2 05-24-2022 11:11

Re: [ANY] Sourcebridge (BETA)
 
Quote:

Originally Posted by eyal282 (Post 2780073)
Can this thing be used to relay SQLite Bans from one server to the other without MySQL?

Some servers cannot get a MySQL to themselves without a price.

I'm afraid that's out of the scope of this project.

While in MatterAMXX (AMX Mod X's counterpart of this plugin) is possible for other plugins to interact with it via API, I don't think it would be convenient to relay bans via chat. Besides you would still need to host a Matterbridge instance.

Adding an API to Sourcebridge is part of the roadmap.

AuricYoutube 05-26-2022 08:32

Re: [ANY] Sourcebridge (BETA)
 
Suggestion: add cvar to not send messages that start with ! from game


All times are GMT -4. The time now is 16:08.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.