public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream) { switch (methodId) { case 1: { ClientRequest request = new ClientRequest(); request.MergeFrom(stream); ClientResponse response = new ClientResponse(); BattlenetRpcErrorCode status = HandleProcessClientRequest(request, response); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.ProcessClientRequest(bgs.protocol.game_utilities.v1.ClientRequest: {1}) returned bgs.protocol.game_utilities.v1.ClientResponse: {2} status: {3}.", GetCallerInfo(), request.ToString(), response.ToString(), status); if (status == 0) { SendResponse(1, token, response); } else { SendResponse(1, token, status); } break; } case 2: { PresenceChannelCreatedRequest request = new PresenceChannelCreatedRequest(); request.MergeFrom(stream); Bgs.Protocol.NoData response = new Bgs.Protocol.NoData(); BattlenetRpcErrorCode status = HandlePresenceChannelCreated(request, response); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.PresenceChannelCreated(bgs.protocol.game_utilities.v1.PresenceChannelCreatedRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.", GetCallerInfo(), request.ToString(), response.ToString(), status); if (status == 0) { SendResponse(2, token, response); } else { SendResponse(2, token, status); } break; } case 3: { GetPlayerVariablesRequest request = new GetPlayerVariablesRequest(); request.MergeFrom(stream); GetPlayerVariablesResponse response = new GetPlayerVariablesResponse(); BattlenetRpcErrorCode status = HandleGetPlayerVariables(request, response); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetPlayerVariables(bgs.protocol.game_utilities.v1.GetPlayerVariablesRequest: {1}) returned bgs.protocol.game_utilities.v1.GetPlayerVariablesResponse: {2} status: {3}.", GetCallerInfo(), request.ToString(), response.ToString(), status); if (status == 0) { SendResponse(3, token, response); } else { SendResponse(3, token, status); } break; } case 6: { ServerRequest request = new ServerRequest(); request.MergeFrom(stream); ServerResponse response = new ServerResponse(); BattlenetRpcErrorCode status = HandleProcessServerRequest(request, response); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.ProcessServerRequest(bgs.protocol.game_utilities.v1.ServerRequest: {1}) returned bgs.protocol.game_utilities.v1.ServerResponse: {2} status: {3}.", GetCallerInfo(), request.ToString(), response.ToString(), status); if (status == 0) { SendResponse(6, token, response); } else { SendResponse(6, token, status); } break; } case 7: { GameAccountOnlineNotification request = new GameAccountOnlineNotification(); request.MergeFrom(stream); BattlenetRpcErrorCode status = HandleOnGameAccountOnline(request); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.OnGameAccountOnline(bgs.protocol.game_utilities.v1.GameAccountOnlineNotification: {1}) status: {2}.", GetCallerInfo(), request.ToString(), status); if (status != 0) { SendResponse(7, token, status); } break; } case 8: { GameAccountOfflineNotification request = new GameAccountOfflineNotification(); request.MergeFrom(stream); BattlenetRpcErrorCode status = HandleOnGameAccountOffline(request); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.OnGameAccountOffline(bgs.protocol.game_utilities.v1.GameAccountOfflineNotification: {1}) status: {2}.", GetCallerInfo(), request.ToString(), status); if (status != 0) { SendResponse(8, token, status); } break; } case 9: { GetAchievementsFileRequest request = new GetAchievementsFileRequest(); request.MergeFrom(stream); GetAchievementsFileResponse response = new GetAchievementsFileResponse(); BattlenetRpcErrorCode status = HandleGetAchievementsFile(request, response); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetAchievementsFile(bgs.protocol.game_utilities.v1.GetAchievementsFileRequest: {1}) returned bgs.protocol.game_utilities.v1.GetAchievementsFileResponse: {2} status: {3}.", GetCallerInfo(), request.ToString(), response.ToString(), status); if (status == 0) { SendResponse(9, token, response); } else { SendResponse(9, token, status); } break; } case 10: { GetAllValuesForAttributeRequest request = new GetAllValuesForAttributeRequest(); request.MergeFrom(stream); GetAllValuesForAttributeResponse response = new GetAllValuesForAttributeResponse(); BattlenetRpcErrorCode status = HandleGetAllValuesForAttribute(request, response); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetAllValuesForAttribute(bgs.protocol.game_utilities.v1.GetAllValuesForAttributeRequest: {1}) returned bgs.protocol.game_utilities.v1.GetAllValuesForAttributeResponse: {2} status: {3}.", GetCallerInfo(), request.ToString(), response.ToString(), status); if (status == 0) { SendResponse(10, token, response); } else { SendResponse(10, token, status); } break; } default: Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId); SendResponse(methodId, token, BattlenetRpcErrorCode.RpcInvalidMethod); break; } }
BattlenetRpcErrorCode HandleOnGameAccountOnline(GameAccountOnlineNotification request) { Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method GameUtilitiesService.OnGameAccountOnline: {1}", GetCallerInfo(), request.ToString()); return(BattlenetRpcErrorCode.RpcNotImplemented); }