handleCall method

Future<GeneratedMessage> handleCall(
  1. ServerContext ctx,
  2. String method,
  3. GeneratedMessage request
)
override

Dispatches the call. The request object should come from createRequest.

Implementation

$async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx,
    $core.String method, $pb.GeneratedMessage request) {
  switch (method) {
    case 'PlayerConnect':
      return this.playerConnect(ctx, request as $1.PlayerID);
    case 'PlayerDisconnect':
      return this.playerDisconnect(ctx, request as $1.PlayerID);
    case 'SetPlayerCapacity':
      return this.setPlayerCapacity(ctx, request as $1.Count);
    case 'GetPlayerCapacity':
      return this.getPlayerCapacity(ctx, request as $1.AlphaEmpty);
    case 'GetPlayerCount':
      return this.getPlayerCount(ctx, request as $1.AlphaEmpty);
    case 'IsPlayerConnected':
      return this.isPlayerConnected(ctx, request as $1.PlayerID);
    case 'GetConnectedPlayers':
      return this.getConnectedPlayers(ctx, request as $1.AlphaEmpty);
    default:
      throw $core.ArgumentError('Unknown method: $method');
  }
}