quarry
quarry copied to clipboard
How can I run multiple clients in one program?
I want to send different upstream packets from multiple clients to the same server from a single program. This is probably stupid, I'm not familiar with twisted at all, I tried to do something like this:
def main():
serverAddress = ("x.x.x.x", 25565)
bot1 = MinecraftFactory(OfflineProfile.from_display_name("bot1"))
bot2 = MinecraftFactory(OfflineProfile.from_display_name("bot2"))
bot1.connect(*serverAddress)
bot2.connect(*serverAddress)
reactor.run()
This seems to work, but the clients connect at the same time and this causes Connection throttled! Please wait before reconnecting.
for one of them
That seems to be server sided, in the bukkit.yml
set connection-throttle
to -1
This is not my server and I can't change its settings. But the main thing is that I want a normal way to control start of the clients
This is not my server and I can't change its settings. But the main thing is that I want a normal way to control start of the clients
add a sleep between connects
add a sleep between connects
I've already tried this. But the thing is that all connections actually start only when reactor.run()
is called and it doesn't matter what the delay was between .connect()
's
lmk if you find a way around it