Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Live-updating of servers, passing args to wssreceiver #22

Closed
flancast90 opened this issue May 17, 2022 · 31 comments
Closed

Live-updating of servers, passing args to wssreceiver #22

flancast90 opened this issue May 17, 2022 · 31 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation websocket Questions related to ws

Comments

@flancast90
Copy link

As I'm building a live-dashboard for servers right now, I am in need of a live-updating method whereby the latest changes are mirrored from Aternos. Currently, I use a login function like this (working):

def update():
    global session, servers

    try:
        session = Client.from_credentials(credentials['username'], credentials['password'])
        servers = session.list_servers()
    except:
        raise Exception('Login information incorrect, or not given. Please set your credentials in \'credentials.py\'')

However, in the future it would be nice to have this built-in, perhaps using modified save and recall session functions.

@DarkCat09
Copy link
Owner

DarkCat09 commented May 17, 2022

You need to subscribe to the status websocket stream. Here's an example code:

import asyncio
from python_aternos import Client, atwss

aternos = Client.from_credentials(user, pswd)

server = aternos.list_servers()[0]
socket = server.wss()

@socket.wssreceiver(atwss.Streams.status)
async def state(msg):
    print('Changed the server status!')
    server._info = msg
    # ... your code ...

async def dashboard():
    print('Starting web-server!')
    # flask.run()

async def main():
    await asyncio.gather(dashboard(), socket.connect())

asyncio.run(main())

@flancast90
Copy link
Author

socket = server.wss()

This is similar to what I was looking for, however, I am needing to listen on the websockets of every server within my user. How could I go about dynamically adding/listening on these websockets?

The adding of them should be easy enough with a for loop, but dynamically creating the decorators could be difficult.

@flancast90
Copy link
Author

flancast90 commented May 18, 2022

Any updates on this, I was thinking you may be able to achieve it with setattr(). The easiest method may be to use the decorator like socket.wssreceiver(atwss.Streams.status)(updateFunc) within the setattr somehow in the for loop. Here's a Stack link that seems helpful https://stackoverflow.com/questions/33134609/python-setattr-for-dynamic-method-creator-with-decorator , but I'm still confused since I don't know the system design overall that well.

@DarkCat09
Copy link
Owner

I added *args argument to the decorator in 1.0.5.
Here's the example code for your case:

# your function must be a coroutine
async def update_func(msg, args):
    server_num = args[0]
    user.servers[server_num]._info = msg
    dashboard.update_info()

# num = index, s = AternosServer object
for num, s in enumerate(user.servers):
    socket = s.wss()
    # num will be passed to update_func
    socket.wssreceiver(atwss.Streams.status, num)(update_func)

@flancast90
Copy link
Author

@DarkCat09 , I'm getting an error testing the code you sent:

socket.wssreceiver(atwss.Streams.status, i)(update)
    TypeError: AternosWss.wssreceiver() takes 2 positional arguments but 3 were given

Here is the code I am using for it:

async def update(data, *args):
    global PLAYERS

    server = servers[args[0]]
    server._info = data

    for server in servers:
        PLAYERS = PLAYERS + server._info['players']
        status = 'offline' if server._info['status'] == 0 else 'online'
        LIST[server.subdomain] = {
            'status': status,
            'domain': server.domain,
            'port': server.port,
            'online': str(server._info['players'])+"/"+str(server._info['slots']),
            'version': server.version
        }

try:
    session = Client.from_credentials(credentials['username'], credentials['password'])
    servers = session.list_servers()

    for i, server in enumerate(servers):
        socket = server.wss()
        socket.wssreceiver(atwss.Streams.status, i)(update)

except:
    raise Exception('Login information incorrect, or not given. Please set your credentials in \'credentials.py\'')

@DarkCat09
Copy link
Owner

pip install -U python-aternos

@DarkCat09
Copy link
Owner

Looks like you didn't update the module.

@flancast90
Copy link
Author

pip install -U python-aternos

That did it; Didn't realize this feature was in a new version!

Now, I don't get an error, but I never receive any data from the websocket. Do I need to call asyncio.run() on my update function to start it?

@flancast90
Copy link
Author

Here's my code for reference. The update() function is never reached (I tested with print statements) and manually toggling the server state.

async def update(data, *args):
    # get server number, and fill with
    # changed data
    server = db['servers'][args[0]]
    server._info = data

try:
    # atconnect.REQHEADERS = {}
    # initialise session DB
    db = jsonDB()
        
    session = Client.from_credentials(credentials['username'], credentials['password'])
    db['servers'] = session.list_servers()

    for i, server in enumerate(db['servers']):
        # update db with defaults.
        status = 'offline' if server._info['status'] == 0 else 'online'
        db['server_data'][server.subdomain] = {'status': status,'domain': server.domain,'port': server.port,'online': str(server._info['players'])+"/"+str(server._info['slots']),'version': server.version}

        # subscribe to wss sockets for each server
        # for live updates
        socket = server.wss()
        socket.wssreceiver(atwss.Streams.status, i)(update)

except:
    raise Exception('Login information incorrect, or not given. Please set your credentials in \'credentials.py\'')

@DarkCat09
Copy link
Owner

Oh, I'm sorry, I forgot about:

await socket.connect()

@flancast90
Copy link
Author

Oh, I'm sorry, I forgot about:

await socket.connect()

Thank you, I'll test it out soon. Can't believe I didn't see that either!

@DarkCat09
Copy link
Owner

wssreceiver decorator is just for saving your function as a receiver in AternosWss object. connect establishes a websocket connection with Aternos and runs these functions.

@DarkCat09
Copy link
Owner

DarkCat09 commented May 19, 2022

import asyncio

async def update(data, *args):
    global PLAYERS

    server = servers[args[0]]
    server._info = data

    for server in servers:
        PLAYERS = PLAYERS + server.players_count
        status = server.status
        LIST[server.subdomain] = {
            'status': status,
            'domain': server.domain,
            'port': server.port,
            'online': f'{server.players_count}/{server.slots}',    
            'version': server.version
        }

try:
    session = Client.from_credentials(credentials['username'], credentials['password'])
    servers = session.list_servers()
    asyncio.run(set_receivers())

except:
    raise Exception('Login information incorrect, or not given. Please set your credentials in \'credentials.py\'')

async def set_receivers():
    for i, server in enumerate(servers):
        socket = server.wss()
        socket.wssreceiver(atwss.Streams.status, i)(update)
        await socket.connect()

@flancast90
Copy link
Author

For some reason the websocket still never fires. The websockets are being added correctly, but the update() function never receives data. Here's my code:

# conntect to websockets
async def set_receivers():
    for i, server in enumerate(db['servers']):
        status = 'offline' if server._info['status'] == 0 else 'online'
        db['server_data'][server.subdomain] = {'status': status,'domain': server.domain,'port': server.port,'online': str(server._info['players'])+"/"+str(server._info['slots']),'version': server.version}
        
        socket = server.wss()
        socket.wssreceiver(atwss.Streams.status, i)(update)
        await socket.connect()

# update when we receive data from websockets
async def update(data, *args):
    # get server number, and fill with
    # changed data
    server = db['servers'][args[0]]

    if server._info['status'] == 0 and data['status'] != 0:
        # server booted, email mailing list
        pass

    server._info = data
    
if __name__ == "app.views":
    # initialise session DB and persistent DB
    db = jsonDB()
    pdb = persistentDB("emails.sqlite")

    try:
        # atconnect.REQHEADERS = {}
            
        session = Client.from_credentials(credentials['username'], credentials['password'])
        db['servers'] = session.list_servers()
        asyncio.run(set_receivers())
    except:
        raise Exception('Login information incorrect, or not given. Please set your credentials in \'credentials.py\'')

@flancast90
Copy link
Author

flancast90 commented May 20, 2022

@DarkCat09 , I've been working on figuring out why the update listener never fires, but have been having trouble. Before I start modifying the library itself, do you see anything wrong in my above code?

@DarkCat09
Copy link
Owner

@flancast90, try to change await socket.connect() in set_receivers to asyncio.gather(socket.connect())
It's an AsyncIO feature which I can't understand. Just use gather instead of await.

@flancast90
Copy link
Author

flancast90 commented May 20, 2022

@flancast90, try to change await socket.connect() in set_receivers to asyncio.gather(socket.connect()) It's an AsyncIO feature which I can't understand. Just use gather instead of await.

ok, I'll test this out now and let you know of the results

@flancast90
Copy link
Author

Nope @DarkCat09 , the update() loop still doesn't fire. Maybe you could make a new StackOverflow question and see if anyone knows how to fix it.

@DarkCat09
Copy link
Owner

        socket = server.wss()
        socket.wssreceiver(atwss.Streams.status, i)(update)
        await socket.connect()

Maybe, this will work:

socket = server.wss()
@socket.wssreceiver(atwss.Streams.status, i)
async def update(msg, args):
    # you should move the "update" function here
await socket.connect()

I don't know how much can this code take RAM for example, if a user has 5 servers in his account.
But this should work. I always use @decorator(args) newline def func: instead of a hard-readable decorator(args)(func)

@DarkCat09
Copy link
Owner

DarkCat09 commented May 21, 2022

Compare your code to the example. await loop() is just keeps the script running.

@DarkCat09
Copy link
Owner

You are using flask, right?
Web server might block async tasks.
Try to use it asynchronously.

Also, could you give me a detailed log? Add this two lines to the beginning of your python-script.

import logging
logging.basicConfig(level=logging.DEBUG)

@flancast90
Copy link
Author

You are using flask, right?

Web server might block async tasks.

Try to use it asynchronously.

Also, could you give me a detailed log? Add this two lines to the beginning of your python-script.

import logging

logging.basicConfig(level=logging.DEBUG)

Good idea, I didn't even think that Flask could be blocking it, but that would make sense. I'll start the logger, although I'm not sure the problem is in my file.

@flancast90
Copy link
Author

import logging
logging.basicConfig(level=logging.DEBUG)

The only logs are that it connected to cloudflare successfully. Nothing related to websockets in there...

@flancast90
Copy link
Author

flancast90 commented May 21, 2022

socket = server.wss()
@socket.wssreceiver(atwss.Streams.status, i)
async def update(msg, args):
    # you should move the "update" function here
await socket.connect()

Yes, this is the ideal way. However, this only will listen to one server. I need to listen on all the servers, which means that a standard decorator won't work

@flancast90
Copy link
Author

@DarkCat09 , I noticed in the example that you start the server before connecting the websocket. Does the websocket only open once the server is started? If so, maybe the code was all right, I just needed to start each server beforehand.

@flancast90
Copy link
Author

flancast90 commented May 21, 2022

@DarkCat09 , I've begun messing with the library source. Could you explain what AternosWss.connect.streamsfunc() does? I've noticed that it's called whenever the wssreceiver decorator is created, and that strm.stream has no value at first. Is this a function used later to parse messages, or should it be getting some sort of data when it first fires?

Here's a log of the wssreceiver args that the program receives when my file first creates the decorator. I can confirm that the decorator calls the function correctly.

{<Streams.status: (0, None)>: (<function update at 0x000002422E06C3A0>, (0,))}
{<Streams.status: (0, None)>: (<function AternosWss.connect.<locals>.confirmfunc at 0x000002422E1A52D0>, ())}
{<Streams.status: (0, None)>: (<function AternosWss.connect.<locals>.streamsfunc at 0x000002422E1A5360>, ())}

Does this give you any ideas of what's going wrong?

@DarkCat09
Copy link
Owner

Hello. I'm sorry for not answering.

Let me explain what is streamsfunc used for.
According to the websocket messages from the web site, Aternos can't receive any data from a stream (e.g. console) until it requests this stream via the special message to the websocket server: {"stream":"console","type":"start"} on which the server responses with: {"type":"connected"}
Also, there are RAM (used heap) and TPS (ticks per second) streams which must be enabled before tryng to get information.
Enabling the stream for listening the server status is not needed, these data is sent by default, so there's None value in the second item of the stream type (<Streams.status: (0, None)>).

@DarkCat09
Copy link
Owner

[darkcat09@dc09pc examples]$ python websocket_args_example.py
Username: world35g 
Password: 
Show detailed logs? (y/n) Y
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'X-Requested-With': 'XMLHttpRequest'}
DEBUG:root:params={'TOKEN': '3WKyxcMWpVyqjFSyOZt3', 'SEC': '198ju8owioj00000:8xuncgtztlb00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_198ju8owioj00000=8xuncgtztlb00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3WKyxcMWpVyqjFSyOZt3&SEC=198ju8owioj00000%3A8xuncgtztlb00000 HTTP/1.1" 200 None
INFO:root:POST completed with 200 status
DEBUG:root:Requesting(GET)https://aternos.org/servers/
DEBUG:root:headers={}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': 'KaNd0QWFDdH8r562Zqbr3H8ZhpOfGoRRQl8uj8IBwZPOGUH2vnSwMPe7MkpQLYX36ixwIdB7XU5HC0q16uxe4Ss5B0IyoGFCje8a'}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_198ju8owioj00000=8xuncgtztlb00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /servers/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(GET)https://aternos.org/panel/ajax/status.php
DEBUG:root:headers={'X-Requested-With': 'XMLHttpRequest'}
DEBUG:root:params={'TOKEN': '3WKyxcMWpVyqjFSyOZt3', 'SEC': '198ju8owioj00000:8xuncgtztlb00000'}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SERVER': 'LsyDGWcthimWnFVH', 'ATERNOS_SESSION': 'KaNd0QWFDdH8r562Zqbr3H8ZhpOfGoRRQl8uj8IBwZPOGUH2vnSwMPe7MkpQLYX36ixwIdB7XU5HC0q16uxe4Ss5B0IyoGFCje8a'}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_198ju8owioj00000=8xuncgtztlb00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /panel/ajax/status.php?TOKEN=3WKyxcMWpVyqjFSyOZt3&SEC=198ju8owioj00000%3A8xuncgtztlb00000 HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:root:Requesting(GET)https://aternos.org/panel/ajax/start.php
DEBUG:root:headers={'X-Requested-With': 'XMLHttpRequest'}
DEBUG:root:params={'headstart': 0, 'TOKEN': '3WKyxcMWpVyqjFSyOZt3', 'SEC': '198ju8owioj00000:8xuncgtztlb00000'}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SERVER': 'LsyDGWcthimWnFVH', 'ATERNOS_SESSION': 'KaNd0QWFDdH8r562Zqbr3H8ZhpOfGoRRQl8uj8IBwZPOGUH2vnSwMPe7MkpQLYX36ixwIdB7XU5HC0q16uxe4Ss5B0IyoGFCje8a'}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_198ju8owioj00000=8xuncgtztlb00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /panel/ajax/start.php?headstart=0&TOKEN=3WKyxcMWpVyqjFSyOZt3&SEC=198ju8owioj00000%3A8xuncgtztlb00000 HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:websockets.client:= connection is CONNECTING
DEBUG:websockets.client:> GET /hermes/ HTTP/1.1
DEBUG:websockets.client:> Host: aternos.org
DEBUG:websockets.client:> Origin: https://aternos.org
DEBUG:websockets.client:> Upgrade: websocket
DEBUG:websockets.client:> Connection: Upgrade
DEBUG:websockets.client:> Sec-WebSocket-Key: KsKFOIcs6rHRC1lcEyfqUw==
DEBUG:websockets.client:> Sec-WebSocket-Version: 13
DEBUG:websockets.client:> Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
DEBUG:websockets.client:> Host: aternos.org
DEBUG:websockets.client:> User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36 OPR/85.0.4341.47
DEBUG:websockets.client:> Cookie: ATERNOS_SESSION=KaNd0QWFDdH8r562Zqbr3H8ZhpOfGoRRQl8uj8IBwZPOGUH2vnSwMPe7MkpQLYX36ixwIdB7XU5HC0q16uxe4Ss5B0IyoGFCje8a; ATERNOS_SERVER=LsyDGWcthimWnFVH
DEBUG:websockets.client:< HTTP/1.1 101 Switching Protocols
DEBUG:websockets.client:< Date: Fri, 17 Jun 2022 08:21:45 GMT
DEBUG:websockets.client:< Connection: upgrade
DEBUG:websockets.client:< upgrade: websocket
DEBUG:websockets.client:< sec-websocket-accept: 8DusS1Ao/UvZr3JYmjJh775b6po=
DEBUG:websockets.client:< CF-Cache-Status: DYNAMIC
DEBUG:websockets.client:< Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
DEBUG:websockets.client:< Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
DEBUG:websockets.client:< X-Content-Type-Options: nosniff
DEBUG:websockets.client:< Server: cloudflare
DEBUG:websockets.client:< CF-RAY: 71ca5f9d7c4d7a6d-DME
DEBUG:websockets.client:= connection is OPEN
DEBUG:websockets.client:< TEXT '{"type":"ready","data":"LsyDGWcthimWnFVH"}' [42 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":37,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":23,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":35,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":34,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":29,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":23,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":37,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":34,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":36,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":38,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":35,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":37,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":34,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":35,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":32,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":29,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":23,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":36,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":38,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":34,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":35,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":38,\\"maxtime\\":2}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":38,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"queue_reduced","message":"{\\"queue\\"...":35,\\"maxtime\\":3}"}' [77 bytes]
DEBUG:websockets.client:< TEXT '{"type":"status","message":"{\\"brand\\":\\"ate...ull,\\"port\\":null}}"}' [818 bytes]
DEBUG:websockets.client:< TEXT '{"type":"status","message":"{\\"brand\\":\\"ate...\"185.107.193.27\\"}}"}' [896 bytes]
DEBUG:root:Enabling console stream
DEBUG:websockets.client:> TEXT '{"stream": "console", "type": "start"}' [38 bytes]
DEBUG:websockets.client:< TEXT '{"type":"connected"}' [20 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"started"}' [37 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"Start...ecraft.server.Main\\r"}' [80 bytes]
Server 1 received Starting net.minecraft.server.Main
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ptimized datafixer\\r"}' [106 bytes]
Server 1 received [12:22:02] [ServerMain/INFO]: Building unoptimized datafixer
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...m\', name=\'PROD\'\\r"}' [279 bytes]
Server 1 received [12:22:04] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
DEBUG:websockets.client:% sending keepalive ping
DEBUG:websockets.client:> PING fa e5 53 8e [binary, 4 bytes]
DEBUG:websockets.client:< PONG fa e5 53 8e [binary, 4 bytes]
DEBUG:websockets.client:% received keepalive pong
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...: Loaded 7 recipes\\r"}' [92 bytes]
Server 1 received [12:22:09] [ServerMain/INFO]: Loaded 7 recipes
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2... 1179 advancements\\r"}' [100 bytes]
Server 1 received [12:22:09] [ServerMain/INFO]: Loaded 1179 advancements
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...o minecraft:normal\\r"}' [142 bytes]
Server 1 received [12:22:11] [ServerMain/WARN]: Failed to parse level-type default, defaulting to minecraft:normal
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...erver version 1.19\\r"}' [117 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...Loading properties\\r"}' [97 bytes]
Server 1 received [12:22:11] [Server thread/INFO]: Starting minecraft server version 1.19
Server 1 received [12:22:11] [Server thread/INFO]: Loading properties
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ame type: SURVIVAL\\r"}' [106 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...Generating keypair\\r"}' [97 bytes]
Server 1 received [12:22:11] [Server thread/INFO]: Default game type: SURVIVAL
Server 1 received [12:22:11] [Server thread/INFO]: Generating keypair
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2... server on *:15172\\r"}' [115 bytes]
Server 1 received [12:22:11] [Server thread/INFO]: Starting Minecraft server on *:15172
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...epoll channel type\\r"}' [103 bytes]
Server 1 received [12:22:11] [Server thread/INFO]: Using epoll channel type
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2... level \\"world\\"\\r"}' [104 bytes]
Server 1 received [12:22:12] [Server thread/INFO]: Preparing level "world"
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...inecraft:overworld\\r"}' [135 bytes]
Server 1 received [12:22:12] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
Server 1 received [12:22:24] [Worker-Main-1/INFO]: Preparing spawn area: 0%
DEBUG:websockets.client:% sending keepalive ping
DEBUG:websockets.client:> PING a0 6a 88 cc [binary, 4 bytes]
DEBUG:websockets.client:< PONG a0 6a 88 cc [binary, 4 bytes]
DEBUG:websockets.client:% received keepalive pong
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
DEBUG:websockets.client:< TEXT '{"stream":"console","type":"line","data":"[12:2...ing spawn area: 0%\\r"}' [103 bytes]
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%
Server 1 received [12:22:26] [Worker-Main-1/INFO]: Preparing spawn area: 0%

@DarkCat09
Copy link
Owner

@flancast90, python_aternos must print something like this (above) when you enable logging.DEBUG.

@DarkCat09
Copy link
Owner

DarkCat09 commented Jun 17, 2022

If you still can't connect to websocket, try to start websocket_args_example from the main branch. Then, send me logs.

@DarkCat09 DarkCat09 added documentation Improvements or additions to documentation bug Something isn't working labels Jun 28, 2022
@DarkCat09 DarkCat09 added the websocket Questions related to ws label Jul 24, 2022
@DarkCat09 DarkCat09 changed the title Add live-updating of servers + status Live-updating of servers, passing args to wssreceiver Jul 26, 2022
Repository owner deleted a comment from RuochenFu21 Aug 1, 2022
@DarkCat09
Copy link
Owner

Maybe, @flancast90's problem was the same as #55.
The issue has been closed due to long inactivity in its discussion.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Improvements or additions to documentation websocket Questions related to ws
Projects
None yet
Development

No branches or pull requests

2 participants