Closed Daddy-Talpapa closed 1 year ago
I'm probably doing something very stupid here, this is my code:
from quarry.net.client import ClientFactory, ClientProtocol, SpawningClientProtocol from quarry.net.auth import OfflineProfile, ProfileCLI from twisted.protocols import basic import quarry class ExampleClientProtocol(ClientProtocol): pass class ExampleClientFactory(ClientFactory): protocol = ExampleClientProtocol @defer.inlineCallbacks def send(msg): self.send_packet("chat_message", self.buff_type.pack_string(msg)) def main(): profile = OfflineProfile("user") factory = ExampleClientFactory(profile) factory = yield factory.connect("x.x.x.x", 24589) send("hello world") if __name__ == "__main__": main() reactor.run()
It should send a chat message saying "hello world" but it doesnt. What am I doing wrong?
Thanks.
i think you forgot to import defer and reactor from twisted.internet
defer
reactor
twisted.internet
This issue is resolved and should be closed.
I'm probably doing something very stupid here, this is my code:
It should send a chat message saying "hello world" but it doesnt. What am I doing wrong?
Thanks.