Skip to content
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

Basic plugin system #33

Merged
merged 5 commits into from
Apr 7, 2021
Merged

Basic plugin system #33

merged 5 commits into from
Apr 7, 2021

Conversation

S-S-X
Copy link
Member

@S-S-X S-S-X commented Apr 6, 2021

Transform most "core" chat functionality into isolated extensions and uses single entry point for chat message handling.
Closes #18

These are moved, check after tested

  • pm @player hello world and /msg player hello world
  • whisper $ hello world and $50 hello world
  • hash #channel and #channel hello world
  • me /me hello world

Todo

@S-S-X S-S-X added enhancement New feature or request wip work in progress labels Apr 6, 2021
@S-S-X
Copy link
Member Author

S-S-X commented Apr 6, 2021

Whispering $150 Hello world works but also prints command to chat so result what players see is
|#main| <SX> whispers: $150 Hello world
It should drop $150 from message.

@S-S-X
Copy link
Member Author

S-S-X commented Apr 6, 2021

Noticed that this also fixes case where whisper radius is more than max radius: in addition to error message whole chat line was printed to main channel.
This PR seems to fix that too to not print to main if radius is larger than max and will correctly still print error message.

@S-S-X
Copy link
Member Author

S-S-X commented Apr 6, 2021

Also fixes on_receive callback possibly executed multiple times in certain situations, so far nothing got actually affected by this but there's no reason to go through it more than once when message is received.

That on_mods_loaded hack must be fixed or error removed from end of main message handler in router.lua, before that is done if player without shout privilege send message it will crash server with Beerchat was unable to handle message: .... Added that error just for easy testing if anything falls through.

@S-S-X S-S-X removed the wip work in progress label Apr 7, 2021
@S-S-X
Copy link
Member Author

S-S-X commented Apr 7, 2021

Some code changes to whispering, tested functionality again and seems to work just fine.
Everything seems to be fine.

@BuckarooBanzay how does structure/changes look for you? Good enough?

My personal opinion: Even while this is not bringing complete API or automated plugin loading I think this is better for development than everything in large pile.

@BuckarooBanzay
Copy link
Member

@BuckarooBanzay how does structure/changes look for you? Good enough?

they involve a bit more "magic" than just plain dofile calls but that will work in this case 👍

My personal opinion: Even while this is not bringing complete API or automated plugin loading I think this is better for development than everything in large pile.

Better something imperfect now than something perfect someday :)

@S-S-X
Copy link
Member Author

S-S-X commented Apr 7, 2021

Then sounds good enough 😄

@S-S-X S-S-X merged commit 49c1898 into master Apr 7, 2021
@BuckarooBanzay BuckarooBanzay deleted the plugin-system branch August 20, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use single entry point for chat messages
2 participants