This plugin is used to allow using Websockets in Squirrel.
-
Download the latest release of the plugin from the release tab
-
Copy the
interstellar_websockets.dll
file into%Titanfall2_InstallationFolder%/R2Northstar/plugins
-
Copy the
Interstellar.WebsocketUtil
folder mod into%Titanfall2_InstallationFolder%/R2Northstar/mods
It is not necessary to install the mod but, for ease of use we recommend to also use it, due to some limitations in the plugin v2 API.
When using wine this plugin will only work when with version 7.13 and above.
Look at the util file at Interstellar.WebsocketUtil\mod\scripts\vscripts\_WebsocketsUtil.gnut
.
There you can find the functions to interact with the websocket.
- PL_ is for methods defined in the plugin
- NS_ is for methods defined in the mod
Note that an open websocket won't be closed on Squirrel VM destruction
-
PL_ConnectToWebsocket
- Used to connect to socket.
socket_name
: the name the socket is referred by.url
: url of the websocket.header
: a singel string from a tabel created with theHeaderConverter
util function.connection_time_out
: how long the socket should wait in sec on initial connection before timing out.keep_alive
: boolean if the connection should be kept alive if there is one already with the same socket_namereturning
: successfully connected true/false.
-
PL_DisconnectFromWebsocket
:- Used to disconnect from the socket
-
PL_WriteToWebsocket
- Used to send a message to the webserver
socket_name
: name of the connected websocket.message
: message for the server.
-
PL_ReadFromWebsocket
- Get all messages from connection since last
PL_ReadFromWebsocket
call. socket_name
: name of the connected websocket.returning
: string array containing all messages in chronological order.
- Get all messages from connection since last
-
PL_GetOpenWebsockets
- Get all open websocket connection names.
returning
: string array containing open websocket connection names.