ES/Manual del Servidor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:


===Linux===
===Linux===
[[Building MTASA Server on GNU Linux|Compilar el servidor en Linux]].
*Opción 1: [[Building MTASA Server on GNU Linux|Compilar el servidor en Linux]].
*Opción 2: [http://linux.mtasa.com/ Usar un paquete ya compilado].


===Windows===
===Windows===

Revision as of 13:59, 29 October 2011

Introducción

Es mucho más fácil de lo que parece tener un servidor funcionando en Internet o en LAN. Lee este artículo y estarás listo para hospedar tu propio servidor de MTA:SA en poco tiempo.

Instalando el servidor

El servidor dedicado está disponible en diferentes distribuciones, dependiendo de la plataforma del equipo. Si no seleccionaste "Dedicated Server" durante la instalación de MTA San Andreas, sigue estos pasos según tu sistema operativo:

Linux

Windows

  • Dirígete a la página de descargas y baja hacia la sección "Dedicated servers".
  • Haz click en el link de descarga Windows.
  • Abre el instalador una vez que se haya descargado.
  • Selecciona una carpeta donde quieras instalar el servidor.
  • Por último, haz click en Install.

Configuración

El servidor Multi Theft Auto se puede configurar a través de la consola, desde el juego o desde una aplicación web. Para hacer uso de estos dos últimos, es necesario añadir un administrador en el archivo de configuración (acl.xml).

General

Todas las opciones de configuración están en el archivo mods/deathmatch/mtaserver.conf y puede ser abierto con cualquier editor de texto.

Cada variable tiene su propia descripción por lo que te será muy fácil configurar tu servidor.

Redireccionamiento de puertos

Si tienes tu servidor en tu propio computador, y tienes acceso a internet mediante un Router, entonces necesitarás redireccionar 3 puertos.

Primero que todo, abre el archivo mods/deathmatch/mtaserver.conf y busca las siguientes líneas:

<serverport></serverport> 
<httpport></httpport>
<ase></ase>

Los puertos son necesarios para configurar bien tu servidor. Explicaremos más adelante cómo configurarlos, pero primero, si quieres que tu servidor aparezca en la lista de servidores, necesitaremos otro puerto adicional; el puerto ASE. Para habilitarlo, hay que usar esta línea:

<ase>1</ase> <!-- 0 = off, 1 = on -->

Ahora vamos a redireccionar los puertos del Router, (que no son necesarios si tienes todos los puertos abiertos, o si no tienes un router con firewall. Si es así, ignora esta parte).

Si no sabes cómo funciona el redireccionamiento de puertos en tu router, visita Port Forward, encuentra tu router y sigue las instrucciones en esa página.

En casi todos los routers puedes seleccionar el tipo de puerto: UDP o TCP. La siguiente lista explica qué tipo de puerto se necesita y para qué:


Puerto principal del servidor: UDP

Puerto HTTP: TCP

Puerto ASE: UDP (es necesario si quieres que tu servidor aparezca en la lista de servidores)


El puerto ASE debe ser de la siguiente manera:

Puerto ASE = Puerto principal del servidor + 123

De esta manera, si el puerto principal de tu servidor es 22003, entonces el puerto ASE deberá ser 22126 (22003+123 = 22126).

Buena suerte!

Añadiendo administradores

Es muy recomendable añadir por lo menos un administrador a tu servidor, para hacer uso de la aplicación web, donde se puede mantener y configurar tu servidor. Este administrador podrá también controlar el servidor desde el juego.

Para añadir un administrador al servidor, sigue los siguientes pasos:

  1. Abre el archivo 'mods/deathmatch/'acl.xml' con cualquier editor de texto
  2. Agrega la cuenta que creaste anteriormente al grupo Admin de la siguiente manera:
    <ACL>
      ...
      <group name="Admin">
        <acl name="Admin"/>
        ...
        <object name="user.NOMBRE" />
      </group>
      ...
    </ACL>
    

    Puedes agregar los usuarios a cualquier grupo. Cada grupo está relacionado con el ACL (Access Control List). Cada grupo de ACL tiene permisos específicos para realizar tareas. El grupo Everyone' apunta al ACL Default, que impide a los jugadores normales ejecutar comandos de administradores, como bannear, kickear o mutear.

  3. Si quieres, puedes agregar cuantos administradores y usuarios quieras, repitiendo estos pasos. También puedes revisar los otros grupos y ACL's. Se puede acceder al ACL también mediante el Motor de Scripting de Lua.
    Se recomienda revisar también la interfaz web, más abajo en este artículo.

Nota: También se puede editar, agregar y crear cuentas mientras el servidor está prendido. "addaccount <user> <password>" es un comando interno que permite agregar cuentas, pero para relacionar esta cuenta con algún grupo del ACL debes usar la interfaz web.

Usando la interfaz web

El servidor dedicado viene con unos resources que permiten tener una pequeña interfaz web para administrar el servidor. Se puede usar para agregar usuarios (cuentas), iniciar/detener resources y mucho más.

The web interface resources are enabled by default and are served through the built-in HTTP web server. To make sure the built-in HTTP web server runs on a port you like (22005 by default), follow these steps:

  1. Make sure your server is stopped
  2. Open the file mods/deathmatch/mtaserver.conf with any text editor
  3. Verify that the HTTP server is enabled:
    	<httpserver>1</httpserver>
    
  4. Change the HTTP server port to your liking:
    	<httpport>22005</httpport>
    
  5. Save and close the configuration file
  6. Start your server
  7. If you happened to have changed the start-up resources in your configuration file, make sure the following resources are started:
    1. resourcebrowser
    2. resourcemanager
    3. webadmin
    4. webmap
    These are automatically started in the default configuration file, in case you just installed your server.
  8. Open a web browser (Internet Explorer 6 or 7 are NOT supported: use Mozilla Firefox, Google Chrome, Apple Safari, Opera or others) and navigate to the HTTP server URL: http://server:port/. For example, If you are running a local server on HTTP port 22005, use http://127.0.0.1:22005/.
  9. Enter the username and password of the administrator you added in the previous section.


You should now be able to maintain your server from the web interface.

Configuring an external web server

The built-in web server is also used to serve files that are required by resources running on your server to any player that is connected to your server. For example, if you are running a game script with a scripted graphical user interface, or custom models, these need to be transferred to every connected player in order to function properly. This is done by either the built-in web server, or an external web server (that is usually a bit faster) but needs to be set up separately.

For performance or consistency reasons during the game, you could choose to make use of such an external web server if you have one set up. The external web server needs to be accessible for the public, so any client will be able to download the necessary client-side files in order to join and play on your server.

To enable downloading off an external web server, you should configure the httpdownload and httpdownloadurl tags in your server configuration:

<httpdownload>1</httpdownload>	
<httpdownloadurl>http://www.myserver.tld/directory/here</httpdownloadurl>

Since all the default resources provided with the dedicated server are zipped, and are normally automatically extracted by the built-in web server, you now have to provide a way for the clients to download the unextracted files to their computers. The unextracted files are always available in the <SERVER>/mods/deathmatch/resourcecache directory.

  1. Launch the dedicated server once and exit again. This will extract the zip files into the <SERVER>/mods/deathmatch/resourcecache directory.
  2. Go into the directory above and copy the resources to your external web server's public directory, this can be done in several ways:
    • If you don't care about your server-side files being publically available: create a symbolic link (Linux), a junction (Windows) or just plain copy the contents of the resourcecache directory to your public web server directory.
    • If you don't want your server files to be publically available through your web server: go into the resourcecache directory and manually copy the folders over to your public web server directory, removing any server-side files (they are not necessary for the client-side downloading) you do not want to be hosting on your web server.

      A quick way of securing your server-side files is currently not available. We will investigate into developing a tool that automatically copies only the necessary client-side files for all resources on your server.

Note 1: Please try to avoid any special characters (e.g. ~, !) in your download URLs.
Note 2: Please do not use a trailing slash in your download URL (e.g. hxxp://www.myserver.tld/directory rather than hxxp://www.myserver.tld/directory/)

Starting your server

Begin by making sure that you have finished all configuration of your server, starting your server is the last stage so everything must be ready!

To start your server double click on MTA Server.exe, make sure you allow it through any firewalls and forward ports where nessessary.

Installing/Updating resources on your server

Resources can come in two formats, either a ZIP format or just a normal folder with the script files inside it. The MTA:SA DM server supports both these methods.

  1. Move or copy the new resource to your <SERVER>\mods\deathmatch\resources folder.
  2. In the server window type in the command "refresh" (without the quotes), this will re-scan the resources folder and update the live resources where necessary.

Uninstalling resources

Resources can easily be removed from your server if you no longer want them.

  1. Delete the ZIP file or the folder of the resource you wish to uninstall
  2. In the server window type in the command "refresh" (without the quotes), this will re-scan the resources folder and update the live resources where necessary.

Administrating your server

You can start resources by typing the command "start resourcename" in the server console, or stop ones with "stop resourcename".

It's also possible to execute these and other admin commands from the ingame console (which you can bring up with the ` key or F8); for this to work, you first need to log in with the command "login username password". Additionally, you can press the p key to bring up the admin panel: this is a graphical interface which allows you to easily kick or ban misbehaving players, among others.

For further commands, type "help" in a console.

Starting a map/gamemode

See the commands section of the documentation for mapmanager for more information.

Useful Notes

  1. You may also update the resources while ingame as long as you have the correct access levels by typing "refresh" in the clients console or "/refresh" in the chat window. This may cause a second of lag if you have many resources.
  2. In the above instructions, <SERVER> is the path to your server's main directory. In most cases this is C:\Program Files\MTA San Andreas\server
  3. You can choose a different config file for the server to use by passing it in the command line after a --config argument, e.g. mtaserver.exe --config anotherconfig.cfg.
  4. Do not be alarmed by the warning regarding the parsing of the settings.xml file. This happens because your server installation is still clean and unused.

Need further help?

Why not pop over to our Forums or join us on IRC (irc.multitheftauto.com #mta - MIRC)

Traductores

  • Ryder!
  • Benxamix2/The Kid