1\section{Multiplayer}
2\subsection{General}
3HTTP is used to query the master server and game server, both dedicated and listen.  IPv4 and IPv6 are both supported, and the servers run at TCP/27910.
4
5\subsection{Client}
6You can play `UFO: Alien Invasion' with your friends via LAN or Internet connection. One player controls a human team while another player takes command of the aliens for a bloody head-to-head battle. UFO:AI also supports cooperative team play with multiple players on both sides. Just enter the multiplayer menu. Local servers in your LAN should be automatically shown -- if not, you can use the connect to IP feature from the menu. Internet servers should be shown after querying the masterserver. Clients and the server should all run the same version of the game.
7
8\subsection{Server}
9
10\subsubsection{General}
11You can add your own maps by copying their \emph{bsp} files into \gamepath{base/maps/} or copying the \emph{pk3} files to \gamepath{base/}. These maps can be added to the mapcycle and, like any other map, can be started via the \consolecommand{map} command. If you want them to appear in the multiplayer menu for listen servers, you have to add a \gamepath{yourmapname.ufo} into the \gamepath{base/ufos/} folder and add a map entry. If that directory does not yet exist, you can create it.
12Examples can be found in the \gamepath{base/0ufos.pk3}\footnote{pk3 files are just zip files} file in \gamepath{maps.ufo}.
13
14\subsubsection{Listen Server}
15You can start a server for you and your friends from within the game menu. Just enter the ``Multiplayer'' menu, load your team as you would if you were a client, and enter the \emph{Create} menu. You can then select the map and game type. There are also other settings that can have an influence on gameplay -- see their tooltips for more information.
16
17\subsubsection{Dedicated Server}
18The dedicated server is console only. Useful commands are \consolecommand{gametypelist}, \consolecommand{maplist} and \consolecommand{map}. You can set the gametype by modifying the \cvar{gametype} cvar.
19
20\subsection{Remote Console}
21You can use the \consolecommand{rcon} method to change the map -- all the server administrator has to do is to set the cvar \cvar{rcon\_password}. The client has to set this cvar to the same value and use the \consolecommand{rcon} as prefix for the normal console commands.
22
23\subsection{Mapcycle}
24Using this, the map is automatically changed when one team wins the game. If no mapcycle is set, then your multiplayer games will always use the same map. The mapcycle is defined in a file called \gamepath{mapcycle.txt} which is in your \gamepath{base/} folder or in \gamepath{~./ufoai/\texttt{version}/base}. This file is in the form ``map gametype'' and each entry is separated by a newline.
25
26There are commands to modify the mapcycle from within the game:
27\begin{description}
28\item[mapcycleadd] Add new maps to the mapcycle
29\item[mapcycleclear] Delete the current mapcycle
30\item[mapcyclenext] Start the next map from the cycle
31\item[mapcyclelist] Print the current mapcycle
32\end{description}
33