Class ScriptServiceImpl
java.lang.Object
com.soulfiremc.grpc.generated.ScriptServiceGrpc.ScriptServiceImplBase
com.soulfiremc.server.grpc.ScriptServiceImpl
- All Implemented Interfaces:
ScriptServiceGrpc.AsyncService, io.grpc.BindableService
gRPC service implementation for visual script management.
Handles CRUD operations for scripts and script execution lifecycle.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateScript(ActivateScriptRequest request, io.grpc.stub.StreamObserver<ScriptEvent> responseObserver) Activates a script by registering its trigger event listeners.voidcreateScript(CreateScriptRequest request, io.grpc.stub.StreamObserver<CreateScriptResponse> responseObserver) Creates a new script in the specified instance.voiddeactivateScript(DeactivateScriptRequest request, io.grpc.stub.StreamObserver<DeactivateScriptResponse> responseObserver) Deactivates an active script.voiddeleteScript(DeleteScriptRequest request, io.grpc.stub.StreamObserver<DeleteScriptResponse> responseObserver) Permanently deletes a script.voiddryRunScript(DryRunScriptRequest request, io.grpc.stub.StreamObserver<ScriptEvent> responseObserver) Dry-runs a script from a specified trigger with mock inputs.voidgetNodeTypes(GetNodeTypesRequest request, io.grpc.stub.StreamObserver<GetNodeTypesResponse> responseObserver) Gets all available node types with their metadata.voidgetRegistryData(GetRegistryDataRequest request, io.grpc.stub.StreamObserver<GetRegistryDataResponse> responseObserver) Gets Minecraft registry data for autocomplete and validation.voidgetScript(GetScriptRequest request, io.grpc.stub.StreamObserver<GetScriptResponse> responseObserver) Retrieves a specific script by its ID.voidgetScriptStatus(GetScriptStatusRequest request, io.grpc.stub.StreamObserver<GetScriptStatusResponse> responseObserver) Gets the current status of a script.voidlistScripts(ListScriptsRequest request, io.grpc.stub.StreamObserver<ListScriptsResponse> responseObserver) Lists all scripts in the specified instance.voidStarts all non-paused scripts across all instances.voidstartAllNonPausedScripts(UUID instanceId) Starts all non-paused scripts for a given instance.voidsubscribeScriptLogs(SubscribeScriptLogsRequest request, io.grpc.stub.StreamObserver<ScriptLogEntry> responseObserver) Subscribes to log entries generated during script execution.voidupdateScript(UpdateScriptRequest request, io.grpc.stub.StreamObserver<UpdateScriptResponse> responseObserver) Updates an existing script's metadata and/or node graph.voidvalidateScript(ValidateScriptRequest request, io.grpc.stub.StreamObserver<ValidateScriptResponse> responseObserver) Validates a script graph without saving it.Methods inherited from class ScriptServiceGrpc.ScriptServiceImplBase
bindService
-
Constructor Details
-
ScriptServiceImpl
-
-
Method Details
-
startAllNonPausedScripts
Starts all non-paused scripts for a given instance. Called on server startup. -
startAllNonPausedScripts
public void startAllNonPausedScripts()Starts all non-paused scripts across all instances. Called on server startup. -
createScript
public void createScript(CreateScriptRequest request, io.grpc.stub.StreamObserver<CreateScriptResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceCreates a new script in the specified instance. The script can be created with initial nodes and edges, or as a blank script to be edited later. Returns: The complete script data including the generated ID Errors: NOT_FOUND if instance does not exist Errors: PERMISSION_DENIED if user lacks script creation permission Errors: INVALID_ARGUMENT if required fields are missing or invalid
-
getScript
public void getScript(GetScriptRequest request, io.grpc.stub.StreamObserver<GetScriptResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceRetrieves a specific script by its ID. Returns the complete script data including all nodes and edges. Errors: NOT_FOUND if instance or script does not exist Errors: PERMISSION_DENIED if user lacks script read permission
-
updateScript
public void updateScript(UpdateScriptRequest request, io.grpc.stub.StreamObserver<UpdateScriptResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceUpdates an existing script's metadata and/or node graph. Only specified fields are updated; others remain unchanged. Use update_nodes/update_edges flags to explicitly set empty lists. Errors: NOT_FOUND if instance or script does not exist Errors: PERMISSION_DENIED if user lacks script update permission Errors: INVALID_ARGUMENT if update data is invalid
-
deleteScript
public void deleteScript(DeleteScriptRequest request, io.grpc.stub.StreamObserver<DeleteScriptResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServicePermanently deletes a script. If the script is currently active, it will be deactivated first. This operation cannot be undone. Errors: NOT_FOUND if instance or script does not exist Errors: PERMISSION_DENIED if user lacks script delete permission
-
listScripts
public void listScripts(ListScriptsRequest request, io.grpc.stub.StreamObserver<ListScriptsResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceLists all scripts in the specified instance. Returns summary information (ScriptInfo) without full node/edge data to reduce response size. Errors: NOT_FOUND if instance does not exist Errors: PERMISSION_DENIED if user lacks script read permission
-
activateScript
public void activateScript(ActivateScriptRequest request, io.grpc.stub.StreamObserver<ScriptEvent> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceActivates a script by registering its trigger event listeners. The script will begin responding to trigger events (tick, chat, etc.). Returns a stream of execution events as triggers fire and nodes execute. The stream remains open until the script is deactivated. Errors: NOT_FOUND if instance or script does not exist Errors: PERMISSION_DENIED if user lacks script execution permission Errors: FAILED_PRECONDITION if script is already active Errors: INVALID_ARGUMENT if script graph is invalid (e.g., no trigger nodes)
-
deactivateScript
public void deactivateScript(DeactivateScriptRequest request, io.grpc.stub.StreamObserver<DeactivateScriptResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceDeactivates an active script. Unregisters all event listeners and cancels any pending async operations. Errors: NOT_FOUND if instance or script does not exist Errors: PERMISSION_DENIED if user lacks script execution permission Errors: FAILED_PRECONDITION if script is not active
-
getScriptStatus
public void getScriptStatus(GetScriptStatusRequest request, io.grpc.stub.StreamObserver<GetScriptStatusResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceGets the current status of a script. Returns whether the script is active, which node is executing, and activation count. Errors: NOT_FOUND if instance or script does not exist Errors: PERMISSION_DENIED if user lacks script read permission
-
subscribeScriptLogs
public void subscribeScriptLogs(SubscribeScriptLogsRequest request, io.grpc.stub.StreamObserver<ScriptLogEntry> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceSubscribes to log entries generated during script execution. Returns a stream of log entries at or above the specified minimum level. The stream remains open until cancelled by the client. Errors: NOT_FOUND if instance or script does not exist Errors: PERMISSION_DENIED if user lacks script log subscription permission
-
getNodeTypes
public void getNodeTypes(GetNodeTypesRequest request, io.grpc.stub.StreamObserver<GetNodeTypesResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceGets all available node types with their metadata. This enables clients to render the node editor without hardcoded knowledge of specific node types. The response includes port definitions, categories, display names, and all other information needed to render and validate nodes. This endpoint is cacheable - node types only change between server versions.
-
getRegistryData
public void getRegistryData(GetRegistryDataRequest request, io.grpc.stub.StreamObserver<GetRegistryDataResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceGets Minecraft registry data for autocomplete and validation. Returns blocks, entities, items, and biomes that can be used in scripts. This endpoint is cacheable - registry data only changes between server versions.
-
validateScript
public void validateScript(ValidateScriptRequest request, io.grpc.stub.StreamObserver<ValidateScriptResponse> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceValidates a script graph without saving it. Returns all diagnostics (errors and warnings) for the given nodes and edges. Useful for live validation in the editor without requiring a save.
-
dryRunScript
public void dryRunScript(DryRunScriptRequest request, io.grpc.stub.StreamObserver<ScriptEvent> responseObserver) Description copied from interface:ScriptServiceGrpc.AsyncServiceDry-runs a script from a specified trigger with mock inputs. Executes the graph without requiring an active instance. Returns execution events as a stream for the editor to display.
-