Git Product home page Git Product logo

Comments (12)

molanp avatar molanp commented on June 2, 2024 1

Thanks

from minestat.

molanp avatar molanp commented on June 2, 2024 1

It`s OK

Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from data_source import *
>>> ms=MineStat('w1024jk.asia',30080)
>>> ms.version
'1.19.2'
>>> ms.motd
'{"text": "SiTanCraft Server"}'
>>> ms.slp_protocol
<SlpProtocols.JSON: 3>
>>> ms.connection_status
<ConnStatus.SUCCESS: 0>
>>>

from minestat.

ldilley avatar ldilley commented on June 2, 2024

Greetings, @molanp.

I just successfully tested using Python versions 3.9.2 and 3.10.4 to connect to an address containing a hyphen ('-'). I tested against a version 1.8 Java server and a version 1.19.50 Bedrock server. See the output below. Is it possible that there is a bug in your custom code?

<23:28:58> (~/projects/minestat/Python) [master *?]
[ldilley@winux] :) {2120}$ python3 -V
Python 3.10.4
<23:29:01> (~/projects/minestat/Python) [master *?]
[ldilley@winux] :) {2121}$ python3 example.py
Minecraft server status of test-host.dom on port 19132:
Server is online running version 1.19.50 Bedrock level(MCPE) with 0 out of 10 players.
Message of the day: Dedicated Server
Message of the day without formatting: Dedicated Server
Latency: 0ms
Connected using protocol: BEDROCK_RAKNET
<23:36:23> (~/projects/minestat/Python) [master *?]
[ldilley@winux] :) {2123}$ python3 -V
Python 3.9.2
<23:36:54> (~/projects/minestat/Python) [master *?]
[ldilley@winux] :) {2124}$ python3 example.py
Minecraft server status of test-host.dom on port 25565:
Server is online running version 1.8 with 0 out of 20 players.
Message of the day: A Minecraft Server
Message of the day without formatting: A Minecraft Server
Latency: 0ms
Connected using protocol: JSON

from minestat.

molanp avatar molanp commented on June 2, 2024

The source code of the package was copied last night (1/12 21:31UTC+8), just now I tested it again, and the output is as follows
image
There are two more lines of code than the original package because I declared the source at the beginning of the file

from minestat.

molanp avatar molanp commented on June 2, 2024

Is the version of this server bedrock_server0.14 too old?😂

from minestat.

ldilley avatar ldilley commented on June 2, 2024

It looks like this server does not send a secondary MotD or a game mode. If I refrain from reading those fields, I get an acceptable response per the output below. I'll submit a fix tomorrow that validates whether or not those fields are populated prior to reading them. This symptom may also be present in the other language implementations. As a result, these may require a fix as well. Thank you for raising this issue, @molanp.

Raw response:

MCPE;§6生存斧§4服§2务§1器  §5QQ群625015871;70;0.14;23;24

Typically, we would see something like below (note all the additional fields). Unique server ID, secondary MotD, game mode, numeric game mode, IPv4 port number, and IPv6 port number must have been added later.

MCPE;Dedicated Server;390;1.14.60;0;10;13253860892328930865;Bedrock level;Survival;1;19132;19133;

Successful test after omitting the absent fields:

Minecraft server status of mc-kkk.top on port 19132:
Server is online running version 0.14 with 23 out of 24 players.
Message of the day: §6生存斧§4服§2务§1器  §5QQ群625015871
Message of the day without formatting: 生存斧服务器  QQ群625015871
Latency: 1ms
Connected using protocol: BEDROCK_RAKNET

from minestat.

ldilley avatar ldilley commented on June 2, 2024

The PyPI package has been updated to version 2.4.2, @molanp. Please let me know if that resolved your issue.

from minestat.

molanp avatar molanp commented on June 2, 2024

oh...(Two lines of comments are still added at the beginning of the code)
image
image

from minestat.

ldilley avatar ldilley commented on June 2, 2024

Hm. The latest Python code from commit 0ba8e04 is working here using the same server now:

Minecraft server status of mc-kkk.top on port 19132:
Server is online running version 0.14 (MCPE) with 6 out of 7 players.
Message of the day: §6生存斧§4服§2务§1器  §5QQ群625015871
Message of the day without formatting: 生存斧服务器  QQ群625015871
Latency: 228ms
Connected using protocol: BEDROCK_RAKNET

from minestat.

molanp avatar molanp commented on June 2, 2024

OK,now it's up and running

from minestat.

molanp avatar molanp commented on June 2, 2024

Well,there's another issue here, and I don't think it needs to raise another issue.
Everything works fine, but TIMEOUT
image

from minestat.

ldilley avatar ldilley commented on June 2, 2024

What happens if you modify line 250 to the following?

250     if self.online:
251       self.connection_status = ConnStatus.SUCCESS
252     else:
253       self.connection_status = result

from minestat.

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.