ServerMod / SCPDiscord

A ServerMod plugin which adds remote interaction to an SCP:SL server through Discord.
https://karlofduty.com
GNU General Public License v3.0
21 stars 29 forks source link

Integration/Piping with other Plugins #205

Closed PatPeter closed 5 years ago

PatPeter commented 5 years ago

Describe what you want to be implemented My plugin, Friendly Fire Autoban, allows players to type .forgive in the player console. If a player is forgiven for a teamkill, my moderators need to be able to know if that teamkill was forgiven so that they don't have to investigate that.

Are there any PipeEvents or PipeMethods in SCPDiscord for me to implement?

Motivate why this change is needed/appreciated by the community My plugin is used by many Russian servers in addition to my own, but above all that, it would be great if plugins could inject custom events into SCPDiscord.

I looked through the wiki and couldn't find anything on this. If it's possible please let me know.

KarlOfDuty commented 5 years ago

Yes there are, check this function if you want to re-use a channel defined in the scpdiscord config: https://github.com/KarlOfDuty/SCPDiscord/blob/21ede153f1598d303ac7800fb87dd434c8f28ae1/SCPDiscordPlugin/SCPDiscord.cs#L248 Otherwise check this function if you want to enter a channel id yourself: https://github.com/KarlOfDuty/SCPDiscord/blob/21ede153f1598d303ac7800fb87dd434c8f28ae1/SCPDiscordPlugin/SCPDiscord.cs#L261

KarlOfDuty commented 5 years ago

I don't really know if the piping functions work though as they were broken in smod back when I added them to the plugin.

KarlOfDuty commented 5 years ago

Oh, and they always return true, apparently returning void broke the piping.

PatPeter commented 5 years ago

I've been meaning to create an issue on ServerMod2 about how piping is broken, specifically PipeEvents which are implemented in the inverse of how they should be (which is that the host plugin triggers the custom event, and the event definition captures the event and executes custom code).

KarlOfDuty commented 5 years ago

Yeah, I don't really have any idea what's up with any of the piping things.

KarlOfDuty commented 5 years ago

Anyways, closing this as it seems answered.