GithubHelp home page GithubHelp logo

Comments (6)

spnda avatar spnda commented on September 25, 2024

You're using the function incorrectly. The ping function takes the port as a separate parameter:

Future<ResponsePacket?> ping(String serverUri,
{int port = 25565, Duration timeout = const Duration(seconds: 30)}) async {

from dart_minecraft.

KamilPaciorek avatar KamilPaciorek commented on September 25, 2024

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.

from dart_minecraft.

spnda avatar spnda commented on September 25, 2024

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.

from dart_minecraft.

KamilPaciorek avatar KamilPaciorek commented on September 25, 2024

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 ping(String address) async {
^^^^^^^^^^^^
lib/screens/server_list_screen.dart:171:8: Error: Type 'ServerStatus' not found.
Future pingServer(String address) async {
^^^^^^^^^^^^
lib/screens/server_list_screen.dart:127:40: Error: 'ServerStatus' isn't a type.
return FutureBuilder(
^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

this is my full code:

https://pastebin.com/hSvss4PP

from dart_minecraft.

spnda avatar spnda commented on September 25, 2024

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.

from dart_minecraft.

KamilPaciorek avatar KamilPaciorek commented on September 25, 2024

can you add support for bedrock edition servers?

from dart_minecraft.

Related Issues (8)

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.