public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream) { switch (methodId) { case 1: { AccountStateNotification request = new AccountStateNotification(); request.MergeFrom(stream); BattlenetRpcErrorCode status = HandleOnAccountStateUpdated(request); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnAccountStateUpdated(AccountStateNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status); if (status != 0) { SendResponse(token, status); } break; } case 2: { GameAccountStateNotification request = new GameAccountStateNotification(); request.MergeFrom(stream); BattlenetRpcErrorCode status = HandleOnGameAccountStateUpdated(request); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameAccountStateUpdated(GameAccountStateNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status); if (status != 0) { SendResponse(token, status); } break; } case 3: { GameAccountNotification request = new GameAccountNotification(); request.MergeFrom(stream); BattlenetRpcErrorCode status = HandleOnGameAccountsUpdated(request); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameAccountsUpdated(GameAccountNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status); if (status != 0) { SendResponse(token, status); } break; } case 4: { GameAccountSessionNotification request = new GameAccountSessionNotification(); request.MergeFrom(stream); BattlenetRpcErrorCode status = HandleOnGameSessionUpdated(request); Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameSessionUpdated(GameAccountSessionNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status); if (status != 0) { SendResponse(token, status); } break; } default: Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId); SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod); break; } }
BattlenetRpcErrorCode HandleOnGameAccountsUpdated(GameAccountNotification request) { Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountListener.OnGameAccountsUpdated: {1}", GetCallerInfo(), request.ToString()); return(BattlenetRpcErrorCode.RpcNotImplemented); }
private void HandleAccountNotify_GameAccountsUpdated(RPCContext context) { GameAccountNotification notification = GameAccountNotification.ParseFrom(context.Payload); base.ApiLog.LogDebug("HandleAccountNotify_GameAccountsUpdated, data=" + notification); }