barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
527 stars 75 forks source link

The skeleton client from readthedocs does not work for me #194

Open TanishiWalter opened 1 year ago

TanishiWalter commented 1 year ago

I copied the code from readthedocs (changed few things, but that should not be the problem), but it does not work. When I try to join server with it, it does not show up on the server's side, even for a second.

Here is the code:

from twisted.internet import defer, reactor from quarry.net.client import ClientFactory, ClientProtocol from quarry.net.auth import OfflineProfile

class ExampleClientProtocol(ClientProtocol): pass

class ExampleClientFactory(ClientFactory): protocol = ExampleClientProtocol

@defer.inlineCallbacks def main(): print("logging in...") profile = OfflineProfile("Walper") factory = ExampleClientFactory(profile) print("connecting...") factory = yield factory.connect("serverIP(should not be the problem too)", 25565) print("connected!")

if name == "main": main() reactor.run()

zax2002 commented 1 year ago

What is variable name at line -3? At a minimum, you should write if __name__ == "__main__":, otherwise the code will not even start running Do you have any errors?

TanishiWalter commented 1 year ago

What is variable name at line -3? At a minimum, you should write if __name__ == "__main__":, otherwise the code will not even start running Do you have any errors?

When waiting , it makes the letters bold, and makes invisible. It accualy is name And main

MajliTech commented 1 year ago

What is variable name at line -3? At a minimum, you should write if __name__ == "__main__":, otherwise the code will not even start running Do you have any errors?

When waiting , it makes the letters bold, and makes invisible. It accualy is name And main

If you want to write those name, use ` and write it inside them. Example:

`__main__`

Outputs: __main__