destruc7i0n / shulker

A Discord to Vanilla Minecraft Chat Gateway
ISC License
135 stars 47 forks source link

2 Shulker instances in the same channel can's see each other #49

Open UndarkAido opened 4 years ago

UndarkAido commented 4 years ago

image

I've got 2 instances of Shulker each running on different servers and I was hoping this would bridge their chats in addition to showing them on Discord, but it just makes it into a situation where you only hear one side of a telephone conversation. Is there a way to fix this?

blandin commented 4 years ago

I've only just found Shulker today, so I haven't done any testing myself with multiple instances, but I've been messing around with Discord webhooks/bots and I know my way around JavaScript.

When Shulker decides whether to forward messages to the Minecraft server, one of the checks it makes is this: https://github.com/destruc7i0n/shulker/blob/b174e696b2667990720b0b427eb9905a350c648f/src/Discord.ts#L56-L57

Are you using the same Discord channel webhook for both instances, by any chance?

UndarkAido commented 4 years ago

That line is saying "if shulker is configured to use webhooks and the message is made by any webhook, ignore it"

On Sun, Apr 19, 2020, 8:14 AM Ben Landin notifications@github.com wrote:

I've only just found Shulker today, so I haven't done any testing myself with multiple instances, but I've been messing around with Discord webhooks/bots and I know my way around JavaScript.

When Shulker decides whether to forward messages to the Minecraft server, one of the checks it makes is this: https://github.com/destruc7i0n/shulker/blob/b174e696b2667990720b0b427eb9905a350c648f/src/Discord.ts#L56-L57

Are you using the same Discord channel webhook for both instances, by any chance?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/destruc7i0n/shulker/issues/49#issuecomment-616131607, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYT6YVU7K4XZTHLQGBTHWTRNL2KBANCNFSM4L3KE72A .

blandin commented 4 years ago

Oh, whoops. Completely missed that it's checking for thruthiness and not comparing the value. You're right.

destruc7i0n commented 4 years ago

I pushed an option for this here https://github.com/destruc7i0n/shulker/commit/e288b74fabf5a6d69ebdf32182fadd35b2ace1b3

UndarkAido commented 4 years ago

I need to spin up my second server again, I shut it down when my server was lagging because of my uncle's 252 turtles:

Version: 1.15.2
Time span: 9699 ms
Tick span: 138 ticks
// This is approximately 14.23 ticks per second. It should be 20 ticks per second
...
minecraft:turtle(34776/252) - 37.55%/31.94%

I should be able to get to it this weekend or just after, my finals are wrapping up soon.