Nebula
Loading...
Searching...
No Matches
Scripting Namespace Reference

Namespaces

namespace  Api

Classes

struct  AssemblyId
struct  DotNET_API
class  MemoryProfile
 The managed runtime's memory state, as this side can read it. More...
class  NSharpServer
 C# backend for the Nebula scripting subsystem. More...
class  PropertyLevelExtension
 The level formats' contribution for managed properties. More...
class  ScriptFeatureUnit

Typedefs

typedef void(CORECLR_DELEGATE_CALLTYPE *) ReadMemorySampleFn(void *)
typedef void(CORECLR_DELEGATE_CALLTYPE *) CollectManagedGarbageFn()
typedef int(CORECLR_DELEGATE_CALLTYPE *) SerializePropertiesFn(uint64_t, void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) ApplyPropertiesFn(uint64_t, const char *, int)
typedef void(CORECLR_DELEGATE_CALLTYPE *) DrawPropertiesFn(uint64_t)
typedef int(CORECLR_DELEGATE_CALLTYPE *) HasPropertyFn(uint64_t, const char *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) DefaultPropertyJsonFn(const char *, int, void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) SerializeKeysFn(uint64_t, const char *, int, void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) JsonKeysFn(const char *, int, void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) MergeJsonFn(const char *, int, const char *, int, void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) ResolveJsonFn(const char *, int, const char *, int, void *, int)
typedef void(CORECLR_DELEGATE_CALLTYPE *) SetRefContextFn(const char *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) TextRefsFn(const char *, int, void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) RemapRefsFn(const char *, int, const char *, int, void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) ClearWorldMirrorFn(uint32_t)
typedef int(CORECLR_DELEGATE_CALLTYPE *) FlushEntityCreateQueueFn(void *, int)
typedef int(CORECLR_DELEGATE_CALLTYPE *) CollectGarbageFn(uint32_t)
typedef int(CORECLR_DELEGATE_CALLTYPE *) ClearWorldFn(uint32_t)

Enumerations

enum  HostFxrStatusCode { Success = 0 , Success_HostAlreadyInitialized = 0x00000001 , Success_DifferentRuntimeProperties = 0x00000002 }

Functions

void N_Print (const char *string, int32_t is_stdout)
void N_Error (const char *string, int32_t is_stdout)
void N_Log (const char *log_domain, const char *log_level, const char *message, int32_t fatal, void *user_data)
void N_AssertEx (const char *expression, const char *file, int32_t line, const char *message, const char *stack, bool value)
void N_FaultReport (const char *report)
void RecordPropertyChange (uint64_t entityId, const char *path, const char *oldText, const char *newText)
 The managed write path calls this when it writes a field.
void RequestPropertyRevert (uint64_t entityId, const char *path)
 The managed inspector calls this when the override marker on a row is pressed.
bool PropertyExtension_IsAuthored (uint64_t entityId, const char *path)
 The managed inspector calls this for a row, to ask whether the editor's marker says the entity authored that key.
void PropertyExtension_AddName (const char *propertyName)
 The property names the editor's dropdown lists.
void PropertyExtension_ClearNames ()
 __ImplementClass (Scripting::NSharpServer, 'N#Sv', Core::RefCounted)
 __ImplementSingleton (Scripting::NSharpServer)
static void ToDotNetString (Util::String const &str, char_t *out)
 nethost and hostfxr take char_t strings: wchar_t (UTF-16) on Windows, char (UTF-8) on Linux.
load_assembly_and_get_function_pointer_fn LoadAssemblyAndGetExport (Util::String const &configPath)
 __ImplementClass (Scripting::ScriptFeatureUnit, 'SCFU', Game::FeatureUnit)
 __ImplementSingleton (ScriptFeatureUnit)

Variables

static DotNET_API api

Typedef Documentation

◆ ApplyPropertiesFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::ApplyPropertiesFn(uint64_t, const char *, int)

◆ ClearWorldFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::ClearWorldFn(uint32_t)

◆ ClearWorldMirrorFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::ClearWorldMirrorFn(uint32_t)

◆ CollectGarbageFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::CollectGarbageFn(uint32_t)

◆ CollectManagedGarbageFn

typedef void(CORECLR_DELEGATE_CALLTYPE *) Scripting::CollectManagedGarbageFn()

◆ DefaultPropertyJsonFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::DefaultPropertyJsonFn(const char *, int, void *, int)

◆ DrawPropertiesFn

typedef void(CORECLR_DELEGATE_CALLTYPE *) Scripting::DrawPropertiesFn(uint64_t)

◆ FlushEntityCreateQueueFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::FlushEntityCreateQueueFn(void *, int)

◆ HasPropertyFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::HasPropertyFn(uint64_t, const char *, int)

◆ JsonKeysFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::JsonKeysFn(const char *, int, void *, int)

◆ MergeJsonFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::MergeJsonFn(const char *, int, const char *, int, void *, int)

◆ ReadMemorySampleFn

typedef void(CORECLR_DELEGATE_CALLTYPE *) Scripting::ReadMemorySampleFn(void *)

◆ RemapRefsFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::RemapRefsFn(const char *, int, const char *, int, void *, int)

◆ ResolveJsonFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::ResolveJsonFn(const char *, int, const char *, int, void *, int)

◆ SerializeKeysFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::SerializeKeysFn(uint64_t, const char *, int, void *, int)

◆ SerializePropertiesFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::SerializePropertiesFn(uint64_t, void *, int)

◆ SetRefContextFn

typedef void(CORECLR_DELEGATE_CALLTYPE *) Scripting::SetRefContextFn(const char *, int)

◆ TextRefsFn

typedef int(CORECLR_DELEGATE_CALLTYPE *) Scripting::TextRefsFn(const char *, int, void *, int)

Enumeration Type Documentation

◆ HostFxrStatusCode

Enumerator
Success 
Success_HostAlreadyInitialized 
Success_DifferentRuntimeProperties 

Function Documentation

◆ __ImplementClass() [1/2]

Scripting::__ImplementClass ( Scripting::NSharpServer ,
'N#Sv' ,
Core::RefCounted  )

◆ __ImplementClass() [2/2]

Scripting::__ImplementClass ( Scripting::ScriptFeatureUnit ,
'SCFU' ,
Game::FeatureUnit  )

◆ __ImplementSingleton() [1/2]

Scripting::__ImplementSingleton ( ScriptFeatureUnit )

◆ __ImplementSingleton() [2/2]

Scripting::__ImplementSingleton ( Scripting::NSharpServer )

◆ LoadAssemblyAndGetExport()

load_assembly_and_get_function_pointer_fn Scripting::LoadAssemblyAndGetExport ( Util::String const & configPath)

◆ N_AssertEx()

NEBULA_EXPORT void Scripting::N_AssertEx ( const char * expression,
const char * file,
int32_t line,
const char * message,
const char * stack,
bool value )

◆ N_Error()

NEBULA_EXPORT void Scripting::N_Error ( const char * string,
int32_t is_stdout )

◆ N_FaultReport()

NEBULA_EXPORT void Scripting::N_FaultReport ( const char * report)

◆ N_Log()

NEBULA_EXPORT void Scripting::N_Log ( const char * log_domain,
const char * log_level,
const char * message,
int32_t fatal,
void * user_data )

◆ N_Print()

NEBULA_EXPORT void Scripting::N_Print ( const char * string,
int32_t is_stdout )

◆ PropertyExtension_AddName()

NEBULA_EXPORT void Scripting::PropertyExtension_AddName ( const char * propertyName)

The property names the editor's dropdown lists.

The managed side mirrors its registry into the extension with these, because the panel reads names and text and has no way to read a managed dictionary.

Same reason as RecordPropertyChange: these have to be in the object library for a managed DllImport to find them.

◆ PropertyExtension_ClearNames()

NEBULA_EXPORT void Scripting::PropertyExtension_ClearNames ( )

◆ PropertyExtension_IsAuthored()

NEBULA_EXPORT bool Scripting::PropertyExtension_IsAuthored ( uint64_t entityId,
const char * path )

The managed inspector calls this for a row, to ask whether the editor's marker says the entity authored that key.

The marker is the editor's own and the managed side cannot read it, so this is the only way a row learns whether it is the instance's own. A path with no field asks whether any field of the property is authored, which is what a section row asks with.

Same reason as RecordPropertyChange: this has to be in the object library for a managed DllImport to find it.

◆ RecordPropertyChange()

NEBULA_EXPORT void Scripting::RecordPropertyChange ( uint64_t entityId,
const char * path,
const char * oldText,
const char * newText )

The managed write path calls this when it writes a field.

It reports the text the entity had and the text it would have after the write, and the editor turns that into a command. Nothing is attached in a build with no editor, and this does nothing for that build.

The path is the key inside the text the change is about, as the extension names it. A path with no field is the whole property, which is what an add and a removal report.

This is here rather than in propertyextension.cc, because the object library is what puts the symbol in the executable's dynamic symbol table. A symbol from the static nsharp archive is not one a managed DllImport can find.

◆ RequestPropertyRevert()

NEBULA_EXPORT void Scripting::RequestPropertyRevert ( uint64_t entityId,
const char * path )

The managed inspector calls this when the override marker on a row is pressed.

It says which key was pressed on, and the editor decides what that means: the value the prefab chain gives for that key, put back over what the instance authored for the rest. Nothing is attached in a build with no editor, and this does nothing for that build.

Same reason as RecordPropertyChange: this has to be in the object library for a managed DllImport to find it.

◆ ToDotNetString()

void Scripting::ToDotNetString ( Util::String const & str,
char_t * out )
static

nethost and hostfxr take char_t strings: wchar_t (UTF-16) on Windows, char (UTF-8) on Linux.

Util::String is UTF-8, so this converts on Windows and copies on Linux. out must be at least NEBULA_MAXPATH char_t wide.

Variable Documentation

◆ api

DotNET_API Scripting::api
static