Table of Contents

Method RegisterScriptHandler

Namespace
Anvil.Services
Assembly
NWN.Anvil.dll

RegisterScriptHandler(string, Func<CallInfo, ScriptHandleResult>)

Registers the specified action as a callback for the specified script name.

public ScriptCallbackHandle RegisterScriptHandler(string scriptName, Func<CallInfo, ScriptHandleResult> callback)

Parameters

scriptName string

The script name to be handled.

callback Func<CallInfo, ScriptHandleResult>

The function invoked when this script is called by the Virtual Machine.

Returns

ScriptCallbackHandle

A handle that can be disposed to remove the handler.

Exceptions

ArgumentException

Thrown if the specified script name is internally used by Anvil.

InvalidOperationException

Thrown if the specified script already has a handler defined.