Giter Club home page Giter Club logo

Comments (7)

edwardsd97 avatar edwardsd97 commented on August 20, 2024 1

I am getting this same problem with a Valheim server I am running on linux.

from python-a2s.

kira-xc avatar kira-xc commented on August 20, 2024 1

if u do ping localhost command or server ip => you will get 64 bytes from localhost icmp_seq=1 ttl=46 time=162 ms (DUP!)

the (DUP!)* Duplicate and Damaged Packets

so ... after this ping command u not receive other error
so for fix this error u need to add exception => every timeout error do : ping 5 times or 8 times on target address

from python-a2s.

Nereg avatar Nereg commented on August 20, 2024

Yeah same here. Here is output of my test script on 189.1.168.21:26921:

$ py test.py
sent: b'TSource Engine Query\x00'
Received single packet: b'A\xdcm\x05N'
sent: b'TSource Engine Query\x00\xdcm\x05N'
Received single packet: b'I\x11deadheim\x00deadheim\x00valheim\x00\x00\x00\x00\x052\x00dl\x01\x001.0.0.0\x00\xb1(i\x05D\xb6{\xf7H@\x010.203.11-MagicOverhaul1.5.2\x00*\xa0\r\x00\x00\x00\x00\x00'
sent: b'U\x00\x00\x00\x00'
Received single packet: b'A\xdcm\x05N'
sent: b'U\xdcm\x05N'
Received single packet: b'D\x05\x00\x00\x00\x00\x00\x00\xd5\xdf\xc2E\x00\x00\x00\x00\x00\x00\xa1B\x9eE\x00\x00\x00\x00\x00\x00\xc6\xec(E\x00\x00\x00\x00\x00\x00\xaa\x1e E\x00\x00\x00\x00\x00\x00\xd9\x0cmD'
sent: b'V\x00\x00\x00\x00'
Received single packet: b'A\xdcm\x05N'
sent: b'V\xdcm\x05N'
Traceback (most recent call last):
  File "test.py", line 29, in <module>
    data = asyncio.get_event_loop().run_until_complete(a2s.arules(address))
  File "c:\users\oleg\appdata\local\programs\python\python38\lib\asyncio\base_events.py", line 608, in run_until_complete
    return future.result()
  File "D:\Projects\Current\ARK Server monitor\lib\site-packages\a2s\rules.py", line 18, in arules
    return await request_async(address, timeout, encoding, RulesProtocol)
  File "D:\Projects\Current\ARK Server monitor\lib\site-packages\a2s\a2s_async.py", line 22, in request_async
    response = await request_async_impl(conn, encoding, a2s_proto)
  File "D:\Projects\Current\ARK Server monitor\lib\site-packages\a2s\a2s_async.py", line 43, in request_async_impl
    return await request_async_impl(
  File "D:\Projects\Current\ARK Server monitor\lib\site-packages\a2s\a2s_async.py", line 28, in request_async_impl
    resp_data = await conn.request(a2s_proto.serialize_request(challenge))
  File "D:\Projects\Current\ARK Server monitor\lib\site-packages\a2s\a2s_async.py", line 137, in request
    return await self.recv()
  File "D:\Projects\Current\ARK Server monitor\lib\site-packages\a2s\a2s_async.py", line 130, in recv
    raise asyncio.TimeoutError()
asyncio.exceptions.TimeoutError

It seems like valheim isn't responding to rules request (see https://developer.valvesoftware.com/wiki/Server_queries#A2S_RULES). Sadly there is nothing library can do with such case.

from python-a2s.

Yepoleb avatar Yepoleb commented on August 20, 2024

@Nereg Thanks for being so quick to help others!

If the server is not responding to the request there's nothing I can do about it. If the game has a player list somewhere in the server browser I might be able to help you to reverse engineer that, but that's out of scope for this particular library.

from python-a2s.

jensbrak avatar jensbrak commented on August 20, 2024

Well, now I tried to get this working but get similar problem - only that it's showing with a2s.info too:

>>> import a2s
>>> a = ("localhost", 2457)
>>> i = a2s.info(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/dist-packages/a2s/info.py", line 182, in info
    return request_sync(address, timeout, encoding, InfoProtocol)
  File "/usr/local/lib/python3.9/dist-packages/a2s/a2s_sync.py", line 22, in request_sync
    response = request_sync_impl(conn, encoding, a2s_proto)
  File "/usr/local/lib/python3.9/dist-packages/a2s/a2s_sync.py", line 28, in request_sync_impl
    resp_data = conn.request(a2s_proto.serialize_request(challenge))
  File "/usr/local/lib/python3.9/dist-packages/a2s/a2s_sync.py", line 92, in request
    return self.recv()
  File "/usr/local/lib/python3.9/dist-packages/a2s/a2s_sync.py", line 67, in recv
    packet = self._socket.recv(65535)
socket.timeout: timed out

from python-a2s.

Nereg avatar Nereg commented on August 20, 2024

Can you get player list/server info from LAN tab in Steam server browser? If not then library can't help because it implements protocol which is used in the browser.

from python-a2s.

jensbrak avatar jensbrak commented on August 20, 2024

It works just fine for me. Now.

Not sure why it started to work but maybe it is how the server is started or perhaps it needs a while before responding. I have to dig som more to get to know the workings of the Valheim server I run. But it does work now.

from python-a2s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.