asobi 0.1.0 copy "asobi: ^0.1.0" to clipboard
asobi: ^0.1.0 copied to clipboard

Dart client SDK for the Asobi game backend. Real-time multiplayer, matchmaking, leaderboards, economy, social, and more. Works with Flutter, Flame, and standalone Dart.

example/example.dart

import 'package:asobi/asobi.dart';

Future<void> main() async {
  final client = AsobiClient('localhost', port: 8080);

  // Register or login
  await client.auth.register('player1', 'secret123', displayName: 'Player One');

  // Get own profile
  final player = await client.players.getSelf();
  print('Logged in as ${player.displayName}');

  // Submit a score
  await client.leaderboards.submitScore('weekly', 1500);

  // Connect realtime
  client.realtime.onMatchmakerMatched.stream.listen((data) {
    print('Match found: ${data['match_id']}');
  });

  client.realtime.onMatchState.stream.listen((state) {
    print('Game tick: ${state['tick']}');
  });

  await client.realtime.connect();
  await client.realtime.addToMatchmaker(mode: 'arena');

  // Cleanup
  await client.dispose();
}
0
likes
140
points
91
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Dart client SDK for the Asobi game backend. Real-time multiplayer, matchmaking, leaderboards, economy, social, and more. Works with Flutter, Flame, and standalone Dart.

Homepage
Repository (GitHub)
View/report issues

Topics

#game #multiplayer #game-backend #matchmaking #websocket

License

unknown (license)

Dependencies

http, web_socket_channel

More

Packages that depend on asobi