Skip to content

Instantly share code, notes, and snippets.

@alexbakker
Forked from nta/index.md
Last active May 30, 2017 23:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexbakker/3f631e7738fb5f2eb80a to your computer and use it in GitHub Desktop.
Save alexbakker/3f631e7738fb5f2eb80a to your computer and use it in GitHub Desktop.
title
Admin Guide

CitizenMP:IV Administrator's Guide

This document will describe the basic process involved in setting up a server for the CitizenMP:IV multiplayer platform. This guide will not go into script/resource development; such details are better left to dedicated guides.

It is assumed that the reader is knowledgable of the platform they are intending on setting up a server on, and has access to a development environment as currently no precompiled binaries are available from official sources.

Installation

The server can either be installed from binaries, or the source code can be obtained and manually compiled. On Windows platforms, the .NET Framework 4.5 is the main supported installation method; on other platforms (and Windows NT 5.x), Mono 3.x should work just as well. Future versions of the CitizenMP server platform may or may not include standalone (i.e. independent of the .NET Framework/system Mono installation) builds for non-Windows platforms.

From binaries

Binaries are not currently available. :(

From source (Windows)

Visual Studio 2013 and a Git client are required.

  1. Using a Git client, clone the repository:

    git clone http://tohjo.ez.lv/citidev/citizenmp-server.git
    git submodule update --init --recursive
    
  2. Open the primary solution file (CitizenMP.Server.sln) in Visual Studio.

  3. Make sure restoring of NuGet packages is enabled. This option can be found in Tools -> Options -> NuGet Package Manager -> General -> Allow NuGet to download missing packages.

  4. Build the project (F6 or Build -> Build Solution).

  5. Depending on the configuration selected (Release or Debug), you can find binaries (and the dependencies) in bin/Debug/ or bin/Release/. The data/ folder of the repository should be used as working directory for the server, which can for instance be done like the following:

    C:\build\citizenmp-server\CitizenMP.Server> cd data
    C:\build\citizenmp-server\CitizenMP.Server\data> ..\bin\Debug\CitizenMP.Server.exe
    [...]
    

The server should now be running.

From source (Ubuntu 14.04)

Ubuntu 14.04 is selected here as it includes modular prebuilt Mono 3.x packages -- other distributions may be able to compile Mono from source to do the same; we're not showing any of such details here.

  1. Install the Mono platform dependencies.

    # apt-get update
    # apt-get install libmono-microsoft-build-tasks-v4.0-4.0-cil mono-devel
    # mozroots --import --sync # to import TLS certificates for NuGet package import
    
  2. Fetch the CitizenMP repository using Git (assuming it is installed).

    $ git clone http://tohjo.ez.lv/citidev/citizenmp-server.git
    $ cd citizenmp-server
    $ git submodule update --init --recursive
    $ export CITIZEN_SRC=$(pwd)
    
  3. Restore NuGet packages and build the solution.

    $ export EnableNuGetPackageRestore=true
    $ mono .nuget/NuGet.exe restore -source "https://www.nuget.org/api/v2;http://nuget.citizen.re/nuget"
    $ xbuild
    
  4. Install the dependencies for the native Lua module.

    # apt-get install cmake build-essential autoconf automake
    
  5. Fetch the NLua Citizen fork repository and build it.

    $ git clone http://tohjo.ez.lv/citidev/nlua.git
    $ cd nlua
    $ git submodule update --init --recursive
    $ cd Core/KeraLua/external/lua/
    $ cmake .
    $ make -j4
    $ cp -a lib/liblua52.so $CITIZEN_SRC/CitizenMP.Server/bin/Debug/
    $ cd ../.. 		# into Core/KeraLua
    $ ./autogen.sh
    $ make 			# this will error out; not a problem
    $ cp -a src/bin/Release/KeraLua.dll $CITIZEN_SRC/CitizenMP.Server/bin/Debug
    
  6. Run the CitizenMP server!

    $ cd $CITIZEN_SRC/CitizenMP.Server/data
    $ mono ../bin/Debug/CitizenMP.Server.exe
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment