Difference between revisions of "ISXDK:ISInterface"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 21: Line 21:
 
  bool [[ISInterface:AddTopLevelObject|AddTopLevelObject]](char *Name, fLSTopLevelObject Function)
 
  bool [[ISInterface:AddTopLevelObject|AddTopLevelObject]](char *Name, fLSTopLevelObject Function)
 
  bool [[ISInterface:RemoveTopLevelObject|RemoveTopLevelObject]](char *Name)
 
  bool [[ISInterface:RemoveTopLevelObject|RemoveTopLevelObject]](char *Name)
  bool [[ISInterface:AddLSType|AddLSType]](class LSType &Type)
+
  bool [[ISInterface:AddLSTypeDefinition|AddLSTypeDefinition]](class LSTypeDefinition &Type)
  bool [[ISInterface:RemoveLSType|RemoveLSType]](class LSType &Type)
+
  bool [[ISInterface:RemoveLSTypeDefinition|RemoveLSTypeDefinition]](class LSTypeDefinition &Type)
  LSType *[[ISInterface:FindLSType|FindLSType]](char *Name)
+
  LSTypeDefinition *[[ISInterface:FindLSTypeDefinition|FindLSTypeDefinition]](char *Name)
 
  bool [[ISInterface:IsCommand|IsCommand]](char *Name)
 
  bool [[ISInterface:IsCommand|IsCommand]](char *Name)
 
  bool [[ISInterface:IsAlias|IsAlias]](char *Name)
 
  bool [[ISInterface:IsAlias|IsAlias]](char *Name)
 
  bool [[ISInterface:IsTopLevelObject|IsTopLevelObject]](char *Name)
 
  bool [[ISInterface:IsTopLevelObject|IsTopLevelObject]](char *Name)
  bool [[ISInterface:IsLSType|IsLSType]](char *Name)
+
  bool [[ISInterface:IsLSTypeDefinition|IsLSTypeDefinition]](char *Name)
 
  bool [[ISInterface:ResolveCommand|ResolveCommand]](char *Text, char *buf,unsigned long buflen)
 
  bool [[ISInterface:ResolveCommand|ResolveCommand]](char *Text, char *buf,unsigned long buflen)
 
  void *[[ISInterface:GetTempBuffer|GetTempBuffer]](unsigned long Size, void *CopyFrom=0)
 
  void *[[ISInterface:GetTempBuffer|GetTempBuffer]](unsigned long Size, void *CopyFrom=0)

Revision as of 23:29, 7 September 2005

Overview

ISInterface is the interface given to your extension to communicate directly with Inner Space. The functions provided should be sufficient to perform any necessary task. If this is NOT sufficient, please post on our forums requesting whatever features you need.

Interface

LavishScript

char *GetCWD(char *buffer, unsigned long buflen)
char *SetRoot(char *Filename, char *Dest)
bool AddCommand(char *Command, fLSCommand Function, bool Parse=true, bool Hidden=false)
bool RemoveCommand(char *Command)
bool AddAlias(char *Replace, char *With)
bool RemoveAlias(char *Replace)
char *GetArgs(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
char *GetArgsQuoted(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
char *GetArgsQuotedNF(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
void ExecuteTimedCommand(unsigned long DelayMS, const char *Text)
int ExecuteCommand(const char *Text)
int DataParse(const char *ToParse, char *buf, int buflen)
bool RunScript(char *Filename)
bool EndScript(char *Filename)
bool RunCommandFile(char *Filename)
bool AddTopLevelObject(char *Name, fLSTopLevelObject Function)
bool RemoveTopLevelObject(char *Name)
bool AddLSTypeDefinition(class LSTypeDefinition &Type)
bool RemoveLSTypeDefinition(class LSTypeDefinition &Type)
LSTypeDefinition *FindLSTypeDefinition(char *Name)
bool IsCommand(char *Name)
bool IsAlias(char *Name)
bool IsTopLevelObject(char *Name)
bool IsLSTypeDefinition(char *Name)
bool ResolveCommand(char *Text, char *buf,unsigned long buflen)
void *GetTempBuffer(unsigned long Size, void *CopyFrom=0)
void *AddTempObject(CTempObject *pObject)
bool RunScriptFromBuffer(char *Name, char *Buffer, unsigned long buflen) 
bool GetCurrentScript(char *buffer, unsigned long buflen)
unsigned long EnumScripts(fScriptEnumCallback Callback, void *pData)
bool GetScriptCWD(char *ScriptName, char *buffer, unsigned long buflen)
bool QueueCommand(char *ScriptName, char *Command)
unsigned long GetScriptRuntime(char *ScriptName)
unsigned long PauseScripts()
unsigned long ResumeScripts() 
unsigned long GetRuntime()
char *Escape(char *text, char *buf, int buflen)
char *EscapeQuotes(char *text, char *buf, int buflen)
bool CalculateResult(const char *Formula, double &Result)
void Printf(const char *Format, ...)
unsigned long GetTerminalWidth()

Service Master

HISXSERVICE RegisterService(ISXInterface *pMaster, char *Name, fISServiceRequest RequestCallback=0)
bool ServiceBroadcast(ISXInterface *pMaster, HISXSERVICE hService, unsigned long MSG, void *lpData)
bool ServiceNotify(ISXInterface *pMaster, HISXSERVICE hService, ISXInterface *pTarget, unsigned long MSG, void *lpData)
bool ShutdownService(ISXInterface *pMaster, HISXSERVICE hService)

Service Client

HISXSERVICE ConnectService(ISXInterface *pClient, char *ServiceName, fISService NotifyCallback)
bool ServiceRequest(ISXInterface *pClient, HISXSERVICE hService, unsigned long MSG, void *lpData)
void DisconnectService(ISXInterface *pClient, HISXSERVICE hService)

Input

bool AddHotkey(char *Name, char *Combo, char *Command, bool Press=false)
bool IsHotkey(char *Name)
bool RemoveHotkey(char *Name)
bool MouseTo(int X, int Y)
bool GetMousePos(int &X, int &Y)
bool EmulateKeyPress(char *Combo, bool Hold)
bool EmulateKeyRelease(char *Combo)
bool EmulateTyping(char *Text)
bool EmulateMousePress(unsigned long Button, bool Hold)
bool EmulateMouseRelease(unsigned long Button)
void DirectInputMousePosition(int X, int Y)

Lavish Settings

unsigned long OpenSettings(char *Filename)
unsigned long FindFileSet(char *Filename)
unsigned long FindSet(unsigned long &ParentSetGUID, char *Name)
bool ExportSet(unsigned long &SetGUID, char *Filename)
bool ImportToSet(unsigned long &SetGUID, char *Filename)
bool CopySet(unsigned long &ToSetGUID, unsigned long FromSetGUID)
bool UnloadSet(unsigned long &SetGUID)
bool ClearSet(unsigned long &SetGUID)
bool RemoveSetting(unsigned long &SetGUID, char *Setting)
bool GetSetting(unsigned long &SetGUID, char *Setting, char *buf, unsigned long buflen)
bool GetSetting(unsigned long &SetGUID, char *Setting, bool &bValue)
bool GetSetting(unsigned long &SetGUID, char *Setting, int &iValue)
bool GetSetting(unsigned long &SetGUID, char *Setting, float &fValue)
bool GetSetting(unsigned long &SetGUID, char *Setting, unsigned long &ulValue)
bool GetSetting(unsigned long &SetGUID, char *Setting, __int64 &Value)
bool SetSetting(unsigned long &SetGUID, char *Setting, char *Value)
bool SetSetting(unsigned long &SetGUID, char *Setting, int iValue)
bool SetSetting(unsigned long &SetGUID, char *Setting, unsigned long &ulValue)
bool SetSetting(unsigned long &SetGUID, char *Setting, float &fValue)
bool SetSetting(unsigned long &SetGUID, char *Setting, __int64 &Value)
unsigned long EnumSets(unsigned long &SetGUID, fSetEnumCallback Callback, void *pData)
unsigned long EnumSettings(unsigned long &SetGUID, fSettingEnumCallback Callback, void *pData)

Game Setting

void GetGameName(char *buf, unsigned long buflen)
bool GetGameSetting(char *Setting, char *buf, unsigned long buflen)
void SetGameSetting(char *Setting, char *Value)
void SaveGameSettings()

Profile Setting

void GetProfileName(char *buf, unsigned long buflen)
bool GetProfileSetting(char *Setting, char *buf, unsigned long buflen)
void SetProfileSetting(char *Setting, char *Value)
void SaveProfileSettings()

Navigation

bool NavigationLoadXML(char *Filename)
bool NavigationDumpXML(char *Filename)
void NavigationClearPoints()
bool NavigationGetPoint3f(char *World, char *Name, POINT3F &Dest)
bool NavigationSetPoint3f(char *World, char *Name, POINT3F &Pt)
bool NavigationGetPath(char *World, char *From, char *To, CNavPath &Dest)
bool NavigationGetNearestPoint(char *World, POINT3F &To, POINT3F &Dest)
void NavigationRemovePoint(char *World, char *Name)
bool NavigationAddConnection(char *World, char *From, char *To)
void NavigationRemoveConnection(char *World, char *From, char *To)

IPC

void Relay(char *Session, char *Command)
unsigned long GetSessionCount()
bool GetSessionName(unsigned long nSession, char *buf, int buflen)

Display

bool GetDisplaySize(unsigned long &Height, unsigned long &Width)
bool GetPixel(int X, int Y, RGBCOLOR &Color)
bool GetPixels(int X, int Y, unsigned long nRows, unsigned long nColumns, RGBCOLOR **Rows)

Misc

unsigned long GetVersion()
bool LoadExtension(char *Filename)
bool UnloadExtension(char *Filename)
bool IsExtensionLoaded(char *Filename)
char *GetInnerSpacePath(char *buffer, unsigned long buflen)
bool AddElement(char *Name, char *Data, int X, int Y, unsigned long Color, char *Group="Default")
bool RemoveElement(char *Name)
void ClearConsole()


Old Info Functions

Base

 unsigned long GetVersion()

Extensions

 bool LoadExtension(char *Filename)
 bool UnloadExtension(char *Filename)
 bool IsExtensionLoaded(char *Filename)

Paths

 void GetInnerSpacePath(char *buffer, unsigned long buflen)
 char *GetCWD()
 void SetRoot(char *Filename, char *Dest)

Services

Master
 HISXSERVICE RegisterService(ISXInterface *pMaster, char *Name, fISServiceRequest RequestCallback=0)
 bool ServiceBroadcast(ISXInterface *pMaster, HISXSERVICE hService, unsigned long MSG, void *lpData)
 bool ServiceNotify(ISXInterface *pMaster, HISXSERVICE hService, ISXInterface *pTarget, unsigned long MSG, void *lpData)
 bool ShutdownService(ISXInterface *pMaster, HISXSERVICE hService)
Client
 HISXSERVICE ConnectService(ISXInterface *pClient, char *ServiceName, fISService NotifyCallback)
 bool ServiceRequest(ISXInterface *pClient, HISXSERVICE hService, unsigned long MSG, void *lpData)
 void DisconnectService(ISXInterface *pClient, HISXSERVICE hService)

LavishScript

 bool AddCommand(char *Command, fLSCommand Function, bool Parse=true, bool Hidden=false)
 bool RemoveCommand(char *Command)
 bool AddAlias(char *Replace, char *With)
 bool RemoveAlias(char *Replace)
 char *GetArgs(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
 char *GetArgsQuoted(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
 char *GetArgsQuotedNF(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
 void ExecuteTimedCommand(unsigned long DelayMS, const char *Command)
 int ExecuteCommand(const char *Text)
 bool DataParse(char *ToParse)
 bool RunScript(char *Filename)
 bool EndScript(char *Filename)
 bool RunCommandFile(char *Filename)
 bool AddTopLevelObject(char *Name, fLSTopLevelObject Function)
 bool RemoveTopLevelObject(char *Name)
 bool AddLSType(class LSType &Type)
 bool RemoveLSType(class LSType &Type)
 LSType *FindLSType(char *Name)
 bool IsCommand(char *Name)
 bool IsAlias(char *Name)
 bool IsTopLevelObject(char *Name)
 bool IsLSType(char *Name)
 bool ResolveCommand(char *Text, char *buf,unsigned long buflen)

Scripts

 char *GetCurrentScript()
 unsigned long EnumScripts(fScriptEnumCallback Callback, void *pData)
 bool GetScriptCWD(char *ScriptName, char *buffer, unsigned long buflen)
 bool QueueCommand(char *ScriptName, char *Command)
 unsigned long GetScriptRuntime(char *ScriptName)
 unsigned long PauseScripts()
 unsigned long ResumeScripts()

Input

 bool AddHotkey(char *Name, char *Combo, char *Command, bool Press=false)
 bool IsHotkey(char *Name)
 bool RemoveHotkey(char *Name)
 bool MouseTo(int X, int Y)
 bool GetMousePos(int &X, int &Y)
 bool EmulateKeyPress(char *Combo, bool Hold)
 bool EmulateKeyRelease(char *Combo)
 bool EmulateTyping(char *Text)
 bool EmulateMousePress(unsigned long Button, bool Hold)
 bool EmulateMouseRelease(unsigned long Button)
 void DirectInputMousePosition(int X, int Y)

Display

 bool GetDisplaySize(unsigned long &Height, unsigned long &Width)
 bool GetPixel(int X, int Y, RGBCOLOR &Color)
 bool GetPixels(int X, int Y, unsigned long nRows, unsigned long nColumns, RGBCOLOR **Rows)

Main HUD

 bool AddElement(char *Name, char *Data, int X, int Y, unsigned long Color, char *Group="Default")
 bool RemoveElement(char *Name)

Console

 void Printf(const char *Format, ...)
 unsigned long GetConsoleWidth()	// width of console, in characters
 void ClearConsole()

Inter-Process

 void Relay(char *Session, char *Command)
 unsigned long GetSessionCount()
 bool GetSessionName(unsigned long nSession, char *buf, int buflen)

Settings

Game
 void GetGameName(char *buf, unsigned long buflen)
 bool GetGameSetting(char *Setting, char *buf, unsigned long buflen)
 void SetGameSetting(char *Setting, char *Value)
 void SaveGames()
Profile
 void GetProfileName(char *buf, unsigned long buflen)
 bool GetProfileSetting(char *Setting, char *buf, unsigned long buflen)
 void SetProfileSetting(char *Setting, char *Value)
 void SaveProfiles()
Setting Files
 bool OpenSettings(char *Filename)
 bool SaveSettings(char *Filename)
 bool UnloadSettings(char *Filename)
 bool GetSetting(char *Filename, char *Set, char *Setting, char *buf, unsigned long buflen)
 bool SetSetting(char *Filename, char *Set, char *Setting, char *Value)
 bool GetSettingb(char *Filename, char *Set, char *Setting, bool &bValue)
 bool GetSettingi(char *Filename, char *Set, char *Setting, int &iValue)
 bool SetSettingi(char *Filename, char *Set, char *Setting, int iValue)
 bool GetSettingf(char *Filename, char *Set, char *Setting, float &fValue)
 bool SetSettingf(char *Filename, char *Set, char *Setting, float fValue)
 void EnumSets(char *Filename, fSetEnumCallback Callback, void *pData)
 void EnumSettings(char *Filename, char *Set, fSettingEnumCallback Callback, void *pData)

Miscellaneous

 unsigned long GetRuntime()
 char *Escape(char *text, char *buf, int buflen)
 char *EscapeQuotes(char *text, char *buf, int buflen)
 bool CalculateResult(const char *Formula, double &Result)

Navigation

 bool NavigationLoadXML(char *Filename)
 bool NavigationDumpXML(char *Filename)
 void NavigationClearPoints()
 bool NavigationGetPoint3f(char *World, char *Name, POINT3F &Dest)
 bool NavigationSetPoint3f(char *World, char *Name, POINT3F &Pt)
 bool NavigationGetPath(char *World, char *From, char *To, CNavPath &Dest)
 bool NavigationGetNearestPoint(char *World, POINT3F &To, POINT3F &Dest)
 void NavigationRemovePoint(char *World, char *Name)
 bool NavigationAddConnection(char *World, char *From, char *To)
 void NavigationRemoveConnection(char *World, char *From, char *To)

See Also