dart_minecraft
dart_minecraft copied to clipboard
I can't ping servers that have a port other than 25565
Hello, I noticed that only the server with port 25565 is displayed. If the server has a different port, it is not displayed.
below my code:
https://pastebin.com/Ne5igc2m
You're using the function incorrectly. The ping function takes the port as a separate parameter:
https://github.com/spnda/dart_minecraft/blob/54542c24bb9a497a93dd2fcc3f97d0b77e35c73b/lib/src/ping/server_ping_io.dart#L32-L33
are you able to help me how to get this feature to work properly? because some servers actually only display, but most are not displayed.
I'm not sure what you're asking exactly. I have told you exactly how to use the ping function, which as far as I know works in all cases. Without any more debug information from your side about which servers are not showing up, if its because of the port, or other information that might be relevant, I can't do much. So, please give me more information or I simply can't help you.
When I run this function, I get an error saying 'ServerStatus' not found
Building with Flutter multidex support enabled. lib/screens/server_list_screen.dart:40:10: Error: Type 'ServerStatus' not found. Future<ServerStatus> ping(String address) async { ^^^^^^^^^^^^ lib/screens/server_list_screen.dart:171:8: Error: Type 'ServerStatus' not found. Future<ServerStatus> pingServer(String address) async { ^^^^^^^^^^^^ lib/screens/server_list_screen.dart:127:40: Error: 'ServerStatus' isn't a type. return FutureBuilder<ServerStatus>( ^^^^^^^^^^^^ Target kernel_snapshot failed: Exception
this is my full code:
https://pastebin.com/hSvss4PP
ServerStatus is not a type and I'm not sure where you got that from. The ping function from the library returns a ResponsePacket? in a Future.
You still haven't fixed the actual issue you had with the fix I told you, by passing the int as a separate parameter to the ping function. That should be the first thing to do.
All of the questions so far have been normal Dart questions that seem to arise because of unfamiliarity with the language, so I'd recommend asking on a dedicated Dart help forum about these questions.
can you add support for bedrock edition servers?