ezEngine Release 26.9
Loading...
Searching...
No Matches
ezMcpEditorAppTool Class Reference

The editor's half of the shared app tools. More...

#include <AppTool.h>

Inheritance diagram for ezMcpEditorAppTool:

Protected Member Functions

virtual ezStringView GetHostNoun () const override
 What this process is, e.g. "editor" or "game". Used in the tool descriptions, so that an agent talking to two servers at once can tell which one it is addressing.
 
virtual ezStringView GetRelaunchHint () const override
 How to start another process like this one, appended to app_quit's description.
 
virtual ezStringView GetBuildTimestamp () const override
 
virtual void AddHostInfo (ezMcpJsonWriter &ref_writer) override
 Anything host specific that app_info should report, added to the same object.
 
virtual ezResult CanQuit (bool bDiscardChanges) override
 Whether quitting is allowed right now. Return EZ_FAILURE to refuse.
 
virtual void AddQuitRefusalInfo (ezMcpJsonWriter &ref_writer) override
 Explains a refusal from CanQuit(). Writes into the result object, after "quitting": false.
 
virtual void AddQuitInfo (ezMcpJsonWriter &ref_writer) override
 Anything worth reporting about a quit that is going ahead, e.g. what got discarded.
 
virtual void RequestQuit (bool bDiscardChanges) override
 Actually shuts the process down.
 

Additional Inherited Members

- Public Member Functions inherited from ezMcpAppTool
virtual void GetSupportedTools (ezDynamicArray< ezMcpToolDesc > &out_tools) const override
 Appends the description of every tool that this provider implements.
 
virtual void Execute (ezStringView sToolName, const ezVariantDictionary &arguments, ezMcpToolResult &out_result) override
 Executes one of the tools returned by GetSupportedTools().
 
- Public Member Functions inherited from ezMcpToolProvider
virtual void OnActivate ()
 Called once, right after the provider was instantiated. Use it to hook into the editor.
 
virtual void OnDeactivate ()
 Called once, before the provider is destroyed.
 
- Public Member Functions inherited from ezReflectedClass
virtual const ezRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 
- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 

Detailed Description

The editor's half of the shared app tools.

Everything generic - the process id, the executable, the command line, the bound port - is in ezMcpAppTool. What is left here is what only the editor has: documents that can be unsaved, a log file whose name is derived from '-appid', and a separate engine process to point at.

Member Function Documentation

◆ AddHostInfo()

void ezMcpEditorAppTool::AddHostInfo ( ezMcpJsonWriter ref_writer)
overrideprotectedvirtual

Anything host specific that app_info should report, added to the same object.

Reimplemented from ezMcpAppTool.

◆ AddQuitInfo()

void ezMcpEditorAppTool::AddQuitInfo ( ezMcpJsonWriter ref_writer)
overrideprotectedvirtual

Anything worth reporting about a quit that is going ahead, e.g. what got discarded.

Reimplemented from ezMcpAppTool.

◆ AddQuitRefusalInfo()

void ezMcpEditorAppTool::AddQuitRefusalInfo ( ezMcpJsonWriter ref_writer)
overrideprotectedvirtual

Explains a refusal from CanQuit(). Writes into the result object, after "quitting": false.

Reimplemented from ezMcpAppTool.

◆ CanQuit()

ezResult ezMcpEditorAppTool::CanQuit ( bool  bDiscardChanges)
overrideprotectedvirtual

Whether quitting is allowed right now. Return EZ_FAILURE to refuse.

A refusal must never be a question to the user: a modal dialog with nobody at the keyboard never returns, and the process then hangs holding its port. Destructive choices are parameters, which is what bDiscardChanges is.

Reimplemented from ezMcpAppTool.

◆ GetBuildTimestamp()

ezStringView ezMcpEditorAppTool::GetBuildTimestamp ( ) const
overrideprotectedvirtual

Overridden so that the timestamp is this plugin's, not the Mcp library's: the editor tools live here and change far more often, so this is the binary whose age explains a missing tool.

Reimplemented from ezMcpAppTool.

◆ GetHostNoun()

virtual ezStringView ezMcpEditorAppTool::GetHostNoun ( ) const
inlineoverrideprotectedvirtual

What this process is, e.g. "editor" or "game". Used in the tool descriptions, so that an agent talking to two servers at once can tell which one it is addressing.

Implements ezMcpAppTool.

◆ GetRelaunchHint()

ezStringView ezMcpEditorAppTool::GetRelaunchHint ( ) const
overrideprotectedvirtual

How to start another process like this one, appended to app_quit's description.

Everything an agent needs has to be in the tool list - it has no repo access and no prior session - so this is where 'which executable, which arguments' gets said.

Implements ezMcpAppTool.

◆ RequestQuit()

void ezMcpEditorAppTool::RequestQuit ( bool  bDiscardChanges)
overrideprotectedvirtual

Actually shuts the process down.

Must defer the shutdown past the end of this call. The response has not reached the socket yet, so quitting synchronously drops it and leaves the caller waiting on a connection that closes with no answer - which is indistinguishable from a crash.

Implements ezMcpAppTool.


The documentation for this class was generated from the following files: