magx_client

Last updated:

0 purchases

magx_client Image
magx_client Images
Add to Cart

Description:

magx client

Magx Dart client #
Dart Client for MagX multiplayer game server.
See node MagX server implementation
Usage #
A simple usage example:
import 'package:magx_client/magx_client.dart';

main() {
var client = new MagxClient(MagxClientParams());
}
copied to clipboard
Connecting to server #
import 'package:magx_client/magx_client.dart';

main() async {
final client = MagxClient(
MagxClientParams(address: 'localhost', port: 3001, secure: true),
tokenStorage: MemoryTokenStorage(),
);

// authenticate
await client.authenticateGuest(deviceId: 'random_identifier');

// or verify your session
// if token is not provided it will take token from [TokenStorage]
await client.verify(token: 'optional_token');

// get available rooms
final rooms = await client.getRooms(["room_name"]);

// create new room
final room = await client.createRoom(name, params);

// or join to existing room
final room = await client.joinRoom(roomData);

// or reconnect to room
final room = await client.connectRoom(roomData, reconnect: boolean);
}
copied to clipboard
Features and bugs #
Please file feature requests and bugs at the issue tracker.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.