Difference between revisions of "Wintermute/Externals"
(Created page with "This page lists known external functions for most Wintermute games. WME allows game scripts to call external functions from DLL libraries. This way game...") |
|||
Line 8: | Line 8: | ||
=== getURLContent === | === getURLContent === | ||
Used to download news headlines at Demo 2012 of James Peris | Used to download news headlines at Demo 2012 of James Peris | ||
HTTP GET result is stored in 3rd param of the call as a plain string | HTTP GET result is stored in 3rd param of the call as a plain string | ||
Specification: external "geturl.dll" cdecl getURLContent(string, string, string) | Specification: external "geturl.dll" cdecl getURLContent(string, string, string) | ||
Known usage: getURLContent("http://www.lacosaweb.com", <DirURL>, <Buffer>) | Known usage: getURLContent("http://www.lacosaweb.com", <DirURL>, <Buffer>) | ||
Sets 3rd param to "Request Error." on error | Sets 3rd param to "Request Error." on error | ||
Line 16: | Line 20: | ||
=== SetValueToReg === | === SetValueToReg === | ||
Used to switch game's windowed/fullscreen mode at games by HeroCraft | Used to switch game's windowed/fullscreen mode at games by HeroCraft | ||
Specification: external "tools.dll" cdecl SetValueToReg(string, string, long) | Specification: external "tools.dll" cdecl SetValueToReg(string, string, long) | ||
Known usage: SetValueToReg("Software\HeroCraft\<GameID>\Video", "Windowed", 1) | Known usage: SetValueToReg("Software\HeroCraft\<GameID>\Video", "Windowed", 1) | ||
=== changeWindowCaption === | === changeWindowCaption === | ||
Used to change game's window caption at games by HeroCraft | Used to change game's window caption at games by HeroCraft | ||
Specification: external "img.dll" cdecl changeWindowCaption(long, string) | Specification: external "img.dll" cdecl changeWindowCaption(long, string) | ||
Known usage: changeWindowCaption(Game.Hwnd, <Title>) | Known usage: changeWindowCaption(Game.Hwnd, <Title>) | ||
=== maximizedWindow === | === maximizedWindow === | ||
Used to change game's window size at games by HeroCraft | Used to change game's window size at games by HeroCraft | ||
Specification: external "img.dll" cdecl maximizedWindow(long, long, long) | Specification: external "img.dll" cdecl maximizedWindow(long, long, long) | ||
Known usage: maximizedWindow(Game.Hwnd, 1024, 768) | Known usage: maximizedWindow(Game.Hwnd, 1024, 768) | ||
Line 32: | Line 42: | ||
=== ShellExecuteA === | === ShellExecuteA === | ||
Used to open URL in browser at Wilma Tetris | Used to open URL in browser at Wilma Tetris | ||
Specification: external "shell32.dll" stdcall long ShellExecuteA(long, string, string, string, string, long) | Specification: external "shell32.dll" stdcall long ShellExecuteA(long, string, string, string, string, long) | ||
Known usage: ShellExecuteA(0, "open", <URL>, "", "", 3) | Known usage: ShellExecuteA(0, "open", <URL>, "", "", 3) | ||
Returns value >32 on success | Returns value >32 on success | ||
Line 41: | Line 54: | ||
=== _InstallUtilAnsi@0 === | === _InstallUtilAnsi@0 === | ||
Used to check if DVD is inserted at Art of Murder: FBI Confidential | Used to check if DVD is inserted at Art of Murder: FBI Confidential | ||
Specification: external "installutil.dll" stdcall long _InstallUtilAnsi@0() | Specification: external "installutil.dll" stdcall long _InstallUtilAnsi@0() | ||
Known usage: _InstallUtilAnsi@0() | Known usage: _InstallUtilAnsi@0() | ||
Returns 1 on success, other value on fail (which leads to Game.QuitGame() in non-Debug mode) | Returns 1 on success, other value on fail (which leads to Game.QuitGame() in non-Debug mode) | ||
Line 48: | Line 64: | ||
=== IRC_init === | === IRC_init === | ||
Used to connect to debug IRC server at games by Corbomite Games | Used to connect to debug IRC server at games by Corbomite Games | ||
Specification: external "dlltest.dll" cdecl long IRC_init(string) | Specification: external "dlltest.dll" cdecl long IRC_init(string) | ||
Known usage: IRC_init(<PlayerName>) | Known usage: IRC_init(<PlayerName>) | ||
Known actions: | Known actions: | ||
1. Connect to irc.starchat.net | 1. Connect to irc.starchat.net | ||
2. Send "NICK ZU_<PlayerName>/" | 2. Send "NICK ZU_<PlayerName>/" | ||
3. Send "USER Blah ZbengHost ZbengServer ZbengRealname" | 3. Send "USER Blah ZbengHost ZbengServer ZbengRealname" | ||
4. Send "Join #Zbeng" | 4. Send "Join #Zbeng" | ||
Returns 0 on success, other value on error | Returns 0 on success, other value on error | ||
=== ChangeNick === | === ChangeNick === | ||
Used to update nick at debug IRC server at games by Corbomite Games | Used to update nick at debug IRC server at games by Corbomite Games | ||
Specification: external "dlltest.dll" cdecl long ChangeNick(string) | Specification: external "dlltest.dll" cdecl long ChangeNick(string) | ||
Known usage: ChangeNick(<PlayerName>) | Known usage: ChangeNick(<PlayerName>) | ||
Return value is never used | Return value is never used | ||
=== IRC_SendString === | === IRC_SendString === | ||
Used to send debug and chat lines to an IRC server at games by Corbomite Games | Used to send debug and chat lines to an IRC server at games by Corbomite Games | ||
Specification: external "dlltest.dll" cdecl IRC_SendString(string, string) | Specification: external "dlltest.dll" cdecl IRC_SendString(string, string) | ||
Known usage: IRC_SendString(<Message>, <Channel>) | Known usage: IRC_SendString(<Message>, <Channel>) | ||
Known Channel values are: "#Zbeng" and "#ZbengDebug" | Known Channel values are: "#Zbeng" and "#ZbengDebug" | ||
=== IRC_GetChatStrings === | === IRC_GetChatStrings === | ||
Used to get chat lines from an IRC server at games by Corbomite Games | Used to get chat lines from an IRC server at games by Corbomite Games | ||
Specification: external "dlltest.dll" cdecl IRC_GetChatStrings(string, long) | Specification: external "dlltest.dll" cdecl IRC_GetChatStrings(string, long) | ||
Known usage: IRC_GetChatStrings(<Buffer>, 65535) | Known usage: IRC_GetChatStrings(<Buffer>, 65535) | ||
=== IRC_quit === | === IRC_quit === | ||
Used to disconnect from debug IRC server at games by Corbomite Games | Used to disconnect from debug IRC server at games by Corbomite Games | ||
Specification: external "dlltest.dll" cdecl IRC_quit() | Specification: external "dlltest.dll" cdecl IRC_quit() | ||
Known usage: IRC_quit() | Known usage: IRC_quit() | ||
=== LoadLibraryA === | === LoadLibraryA === | ||
Used for checking library availability at games by Corbomite Games | Used for checking library availability at games by Corbomite Games | ||
Specification: external "kernel32.dll" stdcall long LoadLibraryA(string) | Specification: external "kernel32.dll" stdcall long LoadLibraryA(string) | ||
Known usage: LoadLibraryA("httpconnect.dll"), LoadLibraryA("dlltest.dll") | Known usage: LoadLibraryA("httpconnect.dll"), LoadLibraryA("dlltest.dll") | ||
Return values are only compared with zero and are never used in other APIs | Return values are only compared with zero and are never used in other APIs | ||
=== FreeLibrary === | === FreeLibrary === | ||
Declared at games by Corbomite Games | Declared at games by Corbomite Games | ||
Seems to be unused, probably was used for unloading IRC & HTTP libraries | Seems to be unused, probably was used for unloading IRC & HTTP libraries | ||
Specification: external "kernel32.dll" stdcall FreeLibrary(long) | Specification: external "kernel32.dll" stdcall FreeLibrary(long) | ||
=== GetEnvironmentVariableA === | === GetEnvironmentVariableA === | ||
Used for getting environment variables at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | Used for getting environment variables at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | ||
Specification: external "kernel32.dll" stdcall long GetEnvironmentVariableA(string, string, long) | Specification: external "kernel32.dll" stdcall long GetEnvironmentVariableA(string, string, long) | ||
Known usage: GetEnvironmentVariableA(<EnvName>, <buffer>, 65535) | Known usage: GetEnvironmentVariableA(<EnvName>, <buffer>, 65535) | ||
Known EnvName values used in debug code: "USERKEY", "ALTUSERNAME", "ENHFINGERPRINT", "EXTRAINFO", "FINGERPRINT", "KEYSTRING", "STOLENKEY", "TRIAL" | Known EnvName values used in debug code: "USERKEY", "ALTUSERNAME", "ENHFINGERPRINT", "EXTRAINFO", "FINGERPRINT", "KEYSTRING", "STOLENKEY", "TRIAL" | ||
Known EnvName values used in licensing code: "FULLGAME" | Known EnvName values used in licensing code: "FULLGAME" | ||
=== Register === | === Register === | ||
Used to register license key online at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | Used to register license key online at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | ||
Specification: external "httpconnect.dll" cdecl long Register(string, long, string, long) | Specification: external "httpconnect.dll" cdecl long Register(string, long, string, long) | ||
Known usage: Register(<productId>, 65535, <productKey>, 65535) | Known usage: Register(<productId>, 65535, <productKey>, 65535) | ||
Known product ID values are: "357868", "353058" and "353006" | Known product ID values are: "357868", "353058" and "353006" | ||
Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=REGISTER&productId=productId&key=productKey | Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=REGISTER&productId=productId&key=productKey | ||
Returns 1 on success | Returns 1 on success | ||
Returns 0 on firewall error | Returns 0 on firewall error | ||
Returns -1 on invalid product key | Returns -1 on invalid product key | ||
Returns -2 on invalid product ID | Returns -2 on invalid product ID | ||
Returns -3 on expired product key | Returns -3 on expired product key | ||
Returns -4 on invalid machine ID | Returns -4 on invalid machine ID | ||
Returns -5 on number of installations exceeded | Returns -5 on number of installations exceeded | ||
Returns -6 on socket error | Returns -6 on socket error | ||
Returns -7 on no internet connection | Returns -7 on no internet connection | ||
Returns -8 on connection reset | Returns -8 on connection reset | ||
Returns -11 on validation temporary unavaliable | Returns -11 on validation temporary unavaliable | ||
Returns -12 on validation error | Returns -12 on validation error | ||
For some reason always returns -7 for me in a test game | For some reason always returns -7 for me in a test game | ||
=== Validate === | === Validate === | ||
Used to validate something at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | Used to validate something at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | ||
Specification: external "httpconnect.dll" cdecl long Validate() | Specification: external "httpconnect.dll" cdecl long Validate() | ||
Known usage: Validate() | Known usage: Validate() | ||
Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=VALIDATE&productId=Ar&key=Ar | Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=VALIDATE&productId=Ar&key=Ar | ||
Used only when Debug mode is active or game is started with "INVALID" cmdline parameter | Used only when Debug mode is active or game is started with "INVALID" cmdline parameter | ||
For some reason always returns 1 for me in a test game | For some reason always returns 1 for me in a test game | ||
=== SendHTTPAsync === | === SendHTTPAsync === | ||
Used to send game progress events to server at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | Used to send game progress events to server at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | ||
Specification: external "httpconnect.dll" cdecl long SendHTTPAsync(string, long, string, long, string, long) | Specification: external "httpconnect.dll" cdecl long SendHTTPAsync(string, long, string, long, string, long) | ||
Known usage: SendHTTPAsync("backend.pizzamorgana.com", 65535, <FullURL>, 65535, <Buffer?!>, 65535) | Known usage: SendHTTPAsync("backend.pizzamorgana.com", 65535, <FullURL>, 65535, <Buffer?!>, 65535) | ||
FullURL is formed as "http://backend.pizzamorgana.com/event.php?Event=<EventName>&player=<PlayerName>&extraParams=<ExtraParams>&SN=<ProductKey>&Episode=1&GameTime=<CurrentTime>&UniqueID=<UniqueId>" | FullURL is formed as "http://backend.pizzamorgana.com/event.php?Event=<EventName>&player=<PlayerName>&extraParams=<ExtraParams>&SN=<ProductKey>&Episode=1&GameTime=<CurrentTime>&UniqueID=<UniqueId>" | ||
Known EventName values are: "GameStart", "ChangeGoal", "EndGame" and "QuitGame" | Known EventName values are: "GameStart", "ChangeGoal", "EndGame" and "QuitGame" | ||
Known ExtraParams values are: "ACT0", "ACT1", "ACT2", "ACT3", "ACT4", "Ep0FindFood", "Ep0FindCellMenu", "Ep0BroRoom", "Ep0FindKey", "Ep0FindCellMenuKey", "Ep0FindMenuKey", "Ep0FindCell", "Ep0FindMenu", "Ep0OrderPizza", "Ep0GetRidOfVamp", "Ep0GetVampAttention", "Ep0License" | Known ExtraParams values are: "ACT0", "ACT1", "ACT2", "ACT3", "ACT4", "Ep0FindFood", "Ep0FindCellMenu", "Ep0BroRoom", "Ep0FindKey", "Ep0FindCellMenuKey", "Ep0FindMenuKey", "Ep0FindCell", "Ep0FindMenu", "Ep0OrderPizza", "Ep0GetRidOfVamp", "Ep0GetVampAttention", "Ep0License" | ||
Return value is never used | Return value is never used | ||
=== SendRecvHTTP (6 params variant) === | === SendRecvHTTP (6 params variant) === | ||
Declared at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | Declared at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest | ||
Seems to be unused, probably SendRecvHTTP was initially used instead of SendHTTPAsync | Seems to be unused, probably SendRecvHTTP was initially used instead of SendHTTPAsync | ||
Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long, string, long) | Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long, string, long) | ||
Always returns -7 for me in a test game, probably returns the same network errors as Register() | Always returns -7 for me in a test game, probably returns the same network errors as Register() | ||
=== SendRecvHTTP (4 params variant) === | === SendRecvHTTP (4 params variant) === | ||
Used to call HTTP methods at Zbang! The Game | Used to call HTTP methods at Zbang! The Game | ||
Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long) | Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long) | ||
Known usage: SendRecvHTTP("scoresshort.php?player=<PlayerName>", 65535, <Buffer>, 65535) | Known usage: SendRecvHTTP("scoresshort.php?player=<PlayerName>", 65535, <Buffer>, 65535) | ||
Known usage: SendRecvHTTP("/update.php?player=<PlayerName>&difficulty=<Difficulty>&items=<CommaSeparatedItemList>", 65535, <Buffer>, 65535) | Known usage: SendRecvHTTP("/update.php?player=<PlayerName>&difficulty=<Difficulty>&items=<CommaSeparatedItemList>", 65535, <Buffer>, 65535) | ||
My Zbang demo does not have this dll, so there is no way to actually test it with a test game | My Zbang demo does not have this dll, so there is no way to actually test it with a test game | ||
Return value is never used in Zbang scripts | Return value is never used in Zbang scripts |
Revision as of 00:16, 17 February 2020
This page lists known external functions for most Wintermute games.
WME allows game scripts to call external functions from DLL libraries. This way game creator can either call Win32 API functions or use custom extension DLL libraries.
2D games
James Peris (Demo 2012)
getURLContent
Used to download news headlines at Demo 2012 of James Peris
HTTP GET result is stored in 3rd param of the call as a plain string
Specification: external "geturl.dll" cdecl getURLContent(string, string, string)
Known usage: getURLContent("http://www.lacosaweb.com", <DirURL>, <Buffer>)
Sets 3rd param to "Request Error." on error
Various games by HeroCraft
SetValueToReg
Used to switch game's windowed/fullscreen mode at games by HeroCraft
Specification: external "tools.dll" cdecl SetValueToReg(string, string, long)
Known usage: SetValueToReg("Software\HeroCraft\<GameID>\Video", "Windowed", 1)
changeWindowCaption
Used to change game's window caption at games by HeroCraft
Specification: external "img.dll" cdecl changeWindowCaption(long, string)
Known usage: changeWindowCaption(Game.Hwnd, <Title>)
maximizedWindow
Used to change game's window size at games by HeroCraft
Specification: external "img.dll" cdecl maximizedWindow(long, long, long)
Known usage: maximizedWindow(Game.Hwnd, 1024, 768)
Wilma Tetris
ShellExecuteA
Used to open URL in browser at Wilma Tetris
Specification: external "shell32.dll" stdcall long ShellExecuteA(long, string, string, string, string, long)
Known usage: ShellExecuteA(0, "open", <URL>, "", "", 3)
Returns value >32 on success
2.5D games
Those games are out of ScummVM scope and are not supported by ResidualVM yet. However, their external function calls are mocked or implemented.
Art of Murder: FBI Confidential
_InstallUtilAnsi@0
Used to check if DVD is inserted at Art of Murder: FBI Confidential
Specification: external "installutil.dll" stdcall long _InstallUtilAnsi@0()
Known usage: _InstallUtilAnsi@0()
Returns 1 on success, other value on fail (which leads to Game.QuitGame() in non-Debug mode)
Various games by Corbomite Games =
IRC_init
Used to connect to debug IRC server at games by Corbomite Games
Specification: external "dlltest.dll" cdecl long IRC_init(string)
Known usage: IRC_init(<PlayerName>)
Known actions:
1. Connect to irc.starchat.net
2. Send "NICK ZU_<PlayerName>/"
3. Send "USER Blah ZbengHost ZbengServer ZbengRealname"
4. Send "Join #Zbeng"
Returns 0 on success, other value on error
ChangeNick
Used to update nick at debug IRC server at games by Corbomite Games
Specification: external "dlltest.dll" cdecl long ChangeNick(string)
Known usage: ChangeNick(<PlayerName>)
Return value is never used
IRC_SendString
Used to send debug and chat lines to an IRC server at games by Corbomite Games
Specification: external "dlltest.dll" cdecl IRC_SendString(string, string)
Known usage: IRC_SendString(<Message>, <Channel>)
Known Channel values are: "#Zbeng" and "#ZbengDebug"
IRC_GetChatStrings
Used to get chat lines from an IRC server at games by Corbomite Games
Specification: external "dlltest.dll" cdecl IRC_GetChatStrings(string, long)
Known usage: IRC_GetChatStrings(<Buffer>, 65535)
IRC_quit
Used to disconnect from debug IRC server at games by Corbomite Games
Specification: external "dlltest.dll" cdecl IRC_quit()
Known usage: IRC_quit()
LoadLibraryA
Used for checking library availability at games by Corbomite Games
Specification: external "kernel32.dll" stdcall long LoadLibraryA(string)
Known usage: LoadLibraryA("httpconnect.dll"), LoadLibraryA("dlltest.dll")
Return values are only compared with zero and are never used in other APIs
FreeLibrary
Declared at games by Corbomite Games
Seems to be unused, probably was used for unloading IRC & HTTP libraries
Specification: external "kernel32.dll" stdcall FreeLibrary(long)
GetEnvironmentVariableA
Used for getting environment variables at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Specification: external "kernel32.dll" stdcall long GetEnvironmentVariableA(string, string, long)
Known usage: GetEnvironmentVariableA(<EnvName>, <buffer>, 65535)
Known EnvName values used in debug code: "USERKEY", "ALTUSERNAME", "ENHFINGERPRINT", "EXTRAINFO", "FINGERPRINT", "KEYSTRING", "STOLENKEY", "TRIAL"
Known EnvName values used in licensing code: "FULLGAME"
Register
Used to register license key online at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Specification: external "httpconnect.dll" cdecl long Register(string, long, string, long)
Known usage: Register(<productId>, 65535, <productKey>, 65535)
Known product ID values are: "357868", "353058" and "353006"
Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=REGISTER&productId=productId&key=productKey
Returns 1 on success
Returns 0 on firewall error
Returns -1 on invalid product key
Returns -2 on invalid product ID
Returns -3 on expired product key
Returns -4 on invalid machine ID
Returns -5 on number of installations exceeded
Returns -6 on socket error
Returns -7 on no internet connection
Returns -8 on connection reset
Returns -11 on validation temporary unavaliable
Returns -12 on validation error
For some reason always returns -7 for me in a test game
Validate
Used to validate something at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Specification: external "httpconnect.dll" cdecl long Validate()
Known usage: Validate()
Known action: HTTP GET http://keygen.corbomitegames.com/keygen/validateKey.php?action=VALIDATE&productId=Ar&key=Ar
Used only when Debug mode is active or game is started with "INVALID" cmdline parameter
For some reason always returns 1 for me in a test game
SendHTTPAsync
Used to send game progress events to server at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Specification: external "httpconnect.dll" cdecl long SendHTTPAsync(string, long, string, long, string, long)
Known usage: SendHTTPAsync("backend.pizzamorgana.com", 65535, <FullURL>, 65535, <Buffer?!>, 65535)
FullURL is formed as "http://backend.pizzamorgana.com/event.php?Event=<EventName>&player=<PlayerName>&extraParams=<ExtraParams>&SN=<ProductKey>&Episode=1&GameTime=<CurrentTime>&UniqueID=<UniqueId>"
Known EventName values are: "GameStart", "ChangeGoal", "EndGame" and "QuitGame"
Known ExtraParams values are: "ACT0", "ACT1", "ACT2", "ACT3", "ACT4", "Ep0FindFood", "Ep0FindCellMenu", "Ep0BroRoom", "Ep0FindKey", "Ep0FindCellMenuKey", "Ep0FindMenuKey", "Ep0FindCell", "Ep0FindMenu", "Ep0OrderPizza", "Ep0GetRidOfVamp", "Ep0GetVampAttention", "Ep0License"
Return value is never used
SendRecvHTTP (6 params variant)
Declared at Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest
Seems to be unused, probably SendRecvHTTP was initially used instead of SendHTTPAsync
Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long, string, long)
Always returns -7 for me in a test game, probably returns the same network errors as Register()
SendRecvHTTP (4 params variant)
Used to call HTTP methods at Zbang! The Game
Specification: external "httpconnect.dll" cdecl long SendRecvHTTP(string, long, string, long)
Known usage: SendRecvHTTP("scoresshort.php?player=<PlayerName>", 65535, <Buffer>, 65535)
Known usage: SendRecvHTTP("/update.php?player=<PlayerName>&difficulty=<Difficulty>&items=<CommaSeparatedItemList>", 65535, <Buffer>, 65535)
My Zbang demo does not have this dll, so there is no way to actually test it with a test game
Return value is never used in Zbang scripts