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

[Question] MCDC Multi-Server Help #112

Open
2 tasks done
Maelan2 opened this issue Jan 28, 2023 · 14 comments
Open
2 tasks done

[Question] MCDC Multi-Server Help #112

Maelan2 opened this issue Jan 28, 2023 · 14 comments
Labels
pending question Further information is requested

Comments

@Maelan2
Copy link

Maelan2 commented Jan 28, 2023

Checks

Description

Hello, What is the procedure to link 2 servers together with MCDC. Thanks in advance

@Maelan2 Maelan2 added the question Further information is requested label Jan 28, 2023
@Maelan2
Copy link
Author

Maelan2 commented Jan 28, 2023

I'm sorry but I can't find an answer to my questions.
I have two servers under velocity (so same machine).

"multiServer": { "enable": true, "host": "127.0.0.1", "port": 5000, "name": "SMP", "botIds": [] }

"multiServer": { "enable": true, "host": "127.0.0.1", "port": 5000, "name": "CMP", "botIds": [] }

But it does not work, no message from one server appears on the other.

@Xujiayao
Copy link
Owner

Xujiayao commented Jan 29, 2023

Have you created two Discord bots? One each, so the bot token of two config are different. Like this:

image

SMP

{
  "generic": {
    "botToken": "tokenA",
    "webhookUrl": "sameLink",
    "channelId": "sameChannel"
  },
  "multiServer": {
    "enable": true,
    "host": "127.0.0.1",
    "port": 5000,
    "name": "SMP",
    "botIds": [
      "tokenA",
      "tokenB"
    ]
  }

CMP

{
  "generic": {
    "botToken": "tokenB",
    "webhookUrl": "sameLink",
    "channelId": "sameChannel"
  },
  "multiServer": {
    "enable": true,
    "host": "127.0.0.1",
    "port": 5000,
    "name": "CMP",
    "botIds": [
      "tokenA",
      "tokenB"
    ]
  }

Try this setup and start one of them 10 seconds before another. If still have problem send both server logs.

@OrionFE
Copy link

OrionFE commented Jan 29, 2023

Hi , we tried what you said and everything is working except one thing :

So we have a CMP server and a SMP server.
When we type something in the chat on both server , everything is redirecte on the discord channel 💹
When we type something in the discord channel , the message is redirect on both server CMP and SMP 💹

But when i'm on the CMP server , i can't see in game the message that someone wrote in the SMP server and vise versa from SMP to CMP.

Do you know what's the problem ?

Here's the log :

[13:58:08] [main/INFO]: -----------------------------------------
[13:58:08] [main/INFO]: MCDiscordChat (MCDC) 2.1.2
[13:58:08] [main/INFO]: By Xujiayao
[13:58:08] [main/INFO]:
[13:58:08] [main/INFO]: More information + Docs:
[13:58:08] [main/INFO]: https://blog.xujiayao.top/posts/4ba0a17a/
[13:58:08] [main/INFO]: -----------------------------------------
[13:58:10] [main/INFO]: Login Successful!
[13:58:10] [JDA MainWS-ReadThread/INFO]: Connected to WebSocket
[13:58:11] [JDA MainWS-ReadThread/INFO]: Finished Loading!
[13:58:11] [main/INFO]: Loading configuration...
[13:58:11] [Thread-18/INFO]: [MultiServer] Server has been created and is listening on port 5000

Ty in advance

@Xujiayao
Copy link
Owner

So we have a CMP server and a SMP server.
When we type something in the chat on both server , everything is redirecte on the discord channel 💹
When we type something in the discord channel , the message is redirect on both server CMP and SMP 💹

This works because the two Discord bots do their own job well.

But when i'm on the CMP server , i can't see in game the message that someone wrote in the SMP server and vise versa from SMP to CMP.

Which means the servers did not connect to each other. Full log of both servers?

@OrionFE
Copy link

OrionFE commented Jan 29, 2023

@Xujiayao
Copy link
Owner

I have two servers under velocity (so same machine).

Confirm? Are the servers accessing the same 127.0.0.1? From your logs it seems that both servers created its own MCDC server on unoccupied ports 5000.

@OrionFE
Copy link

OrionFE commented Jan 29, 2023

In the config both are one 127.0.0.1 :
"multiServer": {
"enable": true,
"host": "127.0.0.1",
"port": 5000,

But in velocity toml , both server are on 172.18.0.1 :

survival = "172.18.0.1:25565"
creatif = "172.18.0.1:25566"

@Xujiayao
Copy link
Owner

172.18.0.1 is private IP address. Try set both MCDC config to 172.18.0.1 then?

@OrionFE
Copy link

OrionFE commented Jan 29, 2023

When you put the 172.18.0.1 , we are getting kicked when we type something and there are error in the console :

[17:07:07] [main/INFO]: MCDiscordChat (MCDC) 2.1.2
[17:07:07] [main/INFO]: By Xujiayao
[17:07:07] [main/INFO]:
[17:07:07] [main/INFO]: More information + Docs:
[17:07:07] [main/INFO]: https://blog.xujiayao.top/posts/4ba0a17a/
[17:07:07] [main/INFO]: -----------------------------------------
[17:07:09] [main/INFO]: Login Successful!
[17:07:09] [JDA MainWS-ReadThread/INFO]: Connected to WebSocket
[17:07:10] [JDA MainWS-ReadThread/INFO]: Finished Loading!
[17:07:10] [main/INFO]: Loading configuration...
[17:07:10] [Thread-19/INFO]: [MultiServer] Server has been created and is listening on port 5000
[17:07:10] [main/INFO]: Loading Xaero's Minimap - Stage 1/2 (Server)
[17:07:10] [main/INFO]: Loading Xaero's World Map - Stage 1/2 (Server)
[17:07:10] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[17:07:11] [Thread-19/ERROR]: java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:579)
at java.base/sun.nio.ch.Net.connect(Net.java:568)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at java.base/java.net.Socket.connect(Socket.java:583)
at java.base/java.net.Socket.(Socket.java:507)
at java.base/java.net.Socket.(Socket.java:287)
at top.xujiayao.mcdiscordchat.multiServer.client.Client.connect(Client.java:18)
at top.xujiayao.mcdiscordchat.multiServer.MultiServer.run(MultiServer.java:37)

@Xujiayao
Copy link
Owner

Xujiayao commented Jan 29, 2023

??? Not sure how Velocity and Pterodactyl works. Try set host to localhost? And randomly change the port? (Keep both the same)

Just tested my SMP and CMP on a Windows machine, 127.0.0.1:5000 works perfectly, if still not working then I have no idea.

@Maelan2
Copy link
Author

Maelan2 commented Jan 29, 2023

Hello, I'm on the config with OrionFE
Here is what happens when I perform a /reload of discord and that only on one of the 2 bots.

[21:09:56] [JDA MainWS-ReadThread/INFO]: [Survie] Maelan executed /reload command!
[21:09:56] [Thread-148/INFO]: [MultiServer] A client has disconnected from the server
[21:09:56] [Thread-147/INFO]: [MultiServer] Disconnected from the server
[21:09:56] [Thread-146/INFO]: [MultiServer] Server has stopped
[21:09:56] [Thread-152/INFO]: [MultiServer] Server has been created and is listening on port 25335
[21:09:57] [ForkJoinPool.commonPool-worker-5/ERROR]: RestAction queue returned failure: [ErrorResponseException] 10062: Unknown interaction
net.dv8tion.jda.api.exceptions.ContextException: null
at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.api.requests.Request.(Request.java:73) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.requests.RestActionImpl.queue(RestActionImpl.java:200) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.requests.restaction.interactions.InteractionCallbackImpl.queue(InteractionCallbackImpl.java:74) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:572) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:538) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at top.xujiayao.mcdiscordchat.discord.DiscordEventListener.onSlashCommandInteraction(DiscordEventListener.java:73) ~[mcdiscordchat-1_19_x-2.1.2-3b834a6de7ba4c61.jar:?]
at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:424) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:171) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleCommand(InteractionCreateHandler.java:112) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:83) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:984) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:870) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:848) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1023) ~[net_dv8tion_jda-5.0.0-beta.2-187ce86b90da7eed.jar:?]
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385) ~[com_neovisionaries_nv-websocket-client-2.14-284fcff6bd34bc70.jar:?]
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276) ~[com_neovisionaries_nv-websocket-client-2.14-284fcff6bd34bc70.jar:?]
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996) ~[com_neovisionaries_nv-websocket-client-2.14-284fcff6bd34bc70.jar:?]
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755) ~[com_neovisionaries_nv-websocket-client-2.14-284fcff6bd34bc70.jar:?]
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) ~[com_neovisionaries_nv-websocket-client-2.14-284fcff6bd34bc70.jar:?]
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) ~[com_neovisionaries_nv-websocket-client-2.14-284fcff6bd34bc70.jar:?]
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) ~[com_neovisionaries_nv-websocket-client-2.14-284fcff6bd34bc70.jar:?]
[21:09:57] [Thread-152/INFO]: [MultiServer] Connected to the server
[21:09:57] [Thread-156/INFO]: [MultiServer] A client is connected to the server

@Xujiayao
Copy link
Owner

Are u two for the same server?

@Xujiayao
Copy link
Owner

From this log the another client is still not connected to this server, the client in this log is from the server itself. What happens if you reload one server and 10 seconds after reload another server?

The exception is normal.

[21:09:56] [JDA MainWS-ReadThread/INFO]: [Survie] Maelan executed /reload command!
[21:09:56] [Thread-148/INFO]: [MultiServer] A client has disconnected from the server
[21:09:56] [Thread-147/INFO]: [MultiServer] Disconnected from the server
[21:09:56] [Thread-146/INFO]: [MultiServer] Server has stopped
[21:09:56] [Thread-152/INFO]: [MultiServer] Server has been created and is listening on port 25335

@Xujiayao
Copy link
Owner

Xujiayao commented Jan 30, 2023

You may try this simplest SMP and CMP setup, simply modify ONLY the xxxs in the config. If this works, then you may have to check the other mods or Velocity or Pterodactyl.

Test.zip

@Xujiayao Xujiayao changed the title smp [Question] MCDC Multi-Server Help Jan 30, 2023
@Xujiayao Xujiayao closed this as completed Feb 2, 2023
@Xujiayao Xujiayao reopened this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants