Named Pipe – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search

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</b> (See also: CreateNamedPipe)


Available Commands

  • shutdown</b> - closes the game
  • message</b> some message</i> - sends message to the systemChat
  • reply</b> whatever</i> - echoes back whatever is sent to it
  • session</b> - 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</b> JSONexpr</i> - 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