quarry icon indicating copy to clipboard operation
quarry copied to clipboard

How can I run multiple clients in one program?

Open zax2002 opened this issue 3 years ago • 5 comments

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

zax2002 avatar May 20 '21 00:05 zax2002

That seems to be server sided, in the bukkit.yml set connection-throttle to -1

fizzrepo avatar May 31 '21 07:05 fizzrepo

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

zax2002 avatar Jun 08 '21 11:06 zax2002

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

u9g avatar Jun 12 '21 01:06 u9g

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

zax2002 avatar Jun 13 '21 04:06 zax2002

lmk if you find a way around it

Daddy-Talpapa avatar Nov 19 '21 11:11 Daddy-Talpapa