Difference between revisions of "Arma 3: Named Pipe"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "== Description == Arma 3 has a fully working implementation of named pipe which allows developers to pass several predefined commands to Arma process. The pipe is created onl...")
 
m (Text replacement - "<tt>([^ ]*=[^ ]*)<\/tt>" to "{{hl|c= $1}}")
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Description ==
+
{{TOC|side}}
 +
{{arma3}} has a fully working implementation of {{Wikipedia|Named pipe|named pipe}} which allows developers to pass several predefined commands to Arma process. The pipe is created only if the command line contains '''{{hl|c= -command=}}''' param which defines the name for the pipe. Works for client and hosting client.
  
Arma 3 has a fully working implementation of named pipe which allows developers to pass several predefined commands to Arma process. The pipe is created only if the command line contains '''<tt>-command=</tt>''' param which defines the name for the pipe. Works for client and hosting client.
 
  
 
== Command Line ==
 
== Command Line ==
  
<tt><b>-command=</b><i>name</i></tt>, where ''name'' is the unique pipe name and can include any character other than a backslash, including numbers and special characters. The entire pipe name string can be up to 256 characters long. Pipe names are not case sensitive The name of the pipe created will be <tt><b>\\.\pipe\name</b></tt> (See also: [https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea CreateNamedPipe])
+
{{hl|c= '''-command{{=}}'''''name''}}, where ''name'' is the unique pipe name and can include any character other than a backslash, including numbers and special characters. The entire pipe name string can be up to 256 characters long. Pipe names are not case sensitive The name of the pipe created will be {{hl|<b>\\.\pipe\name</b>}} (See also: [https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea CreateNamedPipe])
 +
 
  
 
== Available Commands ==
 
== Available Commands ==
  
* <tt><b>shutdown</b></tt> - closes the game
+
* {{hl|<b>shutdown</b>}} - closes the game
* <tt><b>message</b> <i>some message</i></tt> - sends message to the [[systemChat]]
+
* {{hl|<b>message</b> <i>some message</i>}} - sends message to the [[systemChat]]
* <tt><b>reply</b> <i>whatever</i></tt> - echoes back whatever is send to it
+
* {{hl|<b>reply</b> <i>whatever</i>}} - echoes back whatever is sent to it
* <tt><b>session</b></tt> - returns JSON string in format:
+
* {{hl|<b>session</b>}} - returns JSON string in format:
:* <tt>session {"playerId":"uidoftheclient"}</tt> - If not in session
+
:* {{hl|session {"playerId":"uidoftheclient"}}} - If not in session
:* <tt>session {"playerId":"uidoftheclient","hosting":trueifthehost,"island":"curmapname","mission":"curmissionname"}</tt> - If in session
+
:* {{hl|session {"playerId":"uidoftheclient","hosting":trueifthehost,"island":"curmapname","mission":"curmissionname"}}} - If in session
:* <tt>session {"playerId":"uidoftheclient","hosting":trueifthehost,"island":"curmapname","mission":"curmissionname","host":"curservername","hostIP":"curserverip:port"}</tt> - If is user client
+
:* {{hl|session {"playerId":"uidoftheclient","hosting":trueifthehost,"island":"curmapname","mission":"curmissionname","host":"curservername","hostIP":"curserverip:port"}}} - If is user client
* <tt><b>connect</b> <i>JSONexpr</i></tt> - Forces the client to connect to a server described as JSON expression: <tt>{"ip":"serveripaddress", "port":serverport, "password":"optionalpassword"}</tt>. If client is in MP session, nothing happens.
+
* {{hl|<b>connect</b> <i>JSONexpr</i>}} - Forces the client to connect to a server described as JSON expression: {{hl|{"ip":"serveripaddress", "port":serverport, "password":"optionalpassword"}}}. If client is in MP session, nothing happens.
 +
 
  
 
== Misc ==
 
== Misc ==
  
Created pipe has the following params:<br>
+
Pipe created with the following params:<br>
 
openmode: PIPE_ACCESS_DUPLEX, FILE_FLAG_FIRST_PIPE_INSTANCE<br>
 
openmode: PIPE_ACCESS_DUPLEX, FILE_FLAG_FIRST_PIPE_INSTANCE<br>
 
pipemode: PIPE_TYPE_MESSAGE, PIPE_READMODE_MESSAGE, PIPE_NOWAIT<br>
 
pipemode: PIPE_TYPE_MESSAGE, PIPE_READMODE_MESSAGE, PIPE_NOWAIT<br>
Line 27: Line 29:
 
outbuffer: 4096<br>
 
outbuffer: 4096<br>
 
timeout: 100<br>
 
timeout: 100<br>
 +
 +
== See Also ==
 +
 +
* [[Arma 3: Startup Parameters]]
 +
 +
 +
{{GameCategory|arma3|Editing}}

Latest revision as of 00:23, 16 November 2021

Arma 3 has a fully working implementation of named pipe which allows developers to pass several predefined commands to Arma process. The pipe is created only if the command line contains -command= param which defines the name for the pipe. Works for client and hosting client.


Command Line

-command=name, where name is the unique pipe name and can include any character other than a backslash, including numbers and special characters. The entire pipe name string can be up to 256 characters long. Pipe names are not case sensitive The name of the pipe created will be \\.\pipe\name (See also: CreateNamedPipe)


Available Commands

  • shutdown - closes the game
  • message some message - sends message to the systemChat
  • reply whatever - echoes back whatever is sent to it
  • session - returns JSON string in format:
  • session {"playerId":"uidoftheclient"} - If not in session
  • session {"playerId":"uidoftheclient","hosting":trueifthehost,"island":"curmapname","mission":"curmissionname"} - If in session
  • session {"playerId":"uidoftheclient","hosting":trueifthehost,"island":"curmapname","mission":"curmissionname","host":"curservername","hostIP":"curserverip:port"} - If is user client
  • connect JSONexpr - Forces the client to connect to a server described as JSON expression: {"ip":"serveripaddress", "port":serverport, "password":"optionalpassword"}. If client is in MP session, nothing happens.


Misc

Pipe created with the following params:
openmode: PIPE_ACCESS_DUPLEX, FILE_FLAG_FIRST_PIPE_INSTANCE
pipemode: PIPE_TYPE_MESSAGE, PIPE_READMODE_MESSAGE, PIPE_NOWAIT
maxinstances: 1
inbuffer: 4096
outbuffer: 4096
timeout: 100

See Also