generated from VLADIMIR/template
up
This commit is contained in:
@@ -51,6 +51,20 @@ func (s *server) GetGameExport(ctx context.Context, req *proto.GetGameExportReq)
|
||||
return &proto.GameExportRsp{Export: mapGameExport(result)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ResetGameLocalMode(ctx context.Context, req *proto.ResetGameLocalModeReq) (*proto.ResetGameLocalModeRsp, error) {
|
||||
claims, err := claimsFromContext(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !canExportGame(claims) {
|
||||
return nil, status.Error(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
if err := s.gameExportService.ResetLocalMode(ctx, int(req.GetID()), req.GetExportID()); err != nil {
|
||||
return nil, gameExportErrorStatus(err)
|
||||
}
|
||||
return &proto.ResetGameLocalModeRsp{}, nil
|
||||
}
|
||||
|
||||
// GameExportDownloadHandler authenticates with the existing JWT processor and streams private ZIPs.
|
||||
func GameExportDownloadHandler(jwt processor_jwt.IProcessorJWT, exports *game_export_service.GameExportService) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user