rIIh / magx_dart_client

Dart Client for MagX multiplayer game server.
MIT License
4 stars 1 forks source link

Working example #2

Open RafaelBarbosatec opened 2 years ago

RafaelBarbosatec commented 2 years ago

I'm trying to use this package running without android for the example (https://github.com/udamir/magx/tree/master/examples) but I'm not getting it. The authenticateGuest gives success. But calling createAndConnect simply returns null.


    final _client = MagxClient(
      MagxClientParams(address: '192.168.0.39', port: 3001, secure: false),
    );
    final response = await _client.authenticateGuest(deviceId: '123456'); 
    print(response.body?.token);
    final room = await _client.createAndConnect('snake');
    print(room.body);
    print(room.body?.id);

You could leave an example here in the repository working to serve as a basis.

zhangyc commented 2 years ago

I'm trying to use this package running without android for the example (https://github.com/udamir/magx/tree/master/examples) but I'm not getting it. The authenticateGuest gives success. But calling createAndConnect simply returns null.

    final _client = MagxClient(
      MagxClientParams(address: '192.168.0.39', port: 3001, secure: false),
    );
    final response = await _client.authenticateGuest(deviceId: '123456'); 
    print(response.body?.token);
    final room = await _client.createAndConnect('snake');
    print(room.body);
    print(room.body?.id);

You could leave an example here in the repository working to serve as a basis. I had the same problem I tried postman and observed browser http://localhost:3001/advanced/snake.html the request headers and parameters used, but keeps returning null