derpy's script server - server manual


Server Setup

1. Getting started 2. Setting up a Linux server 3. Configuring your server 4. Setting up your scripts 5. Hosting your server

Official Scripts

account admin chat loadanim menu profanity

1. Getting started

Before setting up your server, you should already be familiar with the basics of derpy's script loader (DSL) and how DSL collections work. Once you are confident with using the loader itself, you should be ready to setup a server (which you can download here).

Once you have the server version, you must decide if you want to run the server using Windows or Linux. If using Windows, you should just be able to run derpy_script_server.exe. If using Linux, you should run ./derpy_script_server but may have to set a few things up first.

The directory (or folder) you run the executable in is where all your files will go. You should at least have the scripts folder by the executable before you run it. After you start the server for the first time, a config.txt file will be generated and you may configure it before starting again.

2. Setting up a Linux server

If you're running Ubuntu, read on for some help getting started. If you're using any other Linux distro, then you're on your own. Since the server is 32 bit, you will need to make sure you can actually run 32 bit code. This usually just means you'll need to install lib32z1 and libc6-i386.

The following code is a list of commands to help you get your Linux server setup using the command line. It downloads version 9 since that is the latest version as of this writing, but you may need to change it to download a later version if there is a newer one available.

# ubuntu setup (for other linux distros, you're on your own) # make a new directory for the server somewhere mkdir my-dss-server cd my-dss-server # download and extract the server release wget -q -O dss.zip https://www.mediafire.com/file_premium/vobshxqcc2kxxa8/derpy_script_server_9_s.zip/file unzip dss.zip # install 32 bit packages for your 64 bit system sudo apt-get install lib32z1 sudo apt-get install libc6-i386 # make the server file an executable chmod +x derpy_script_server # run the server so it generates a config ./derpy_script_server # configure the server nano config.txt # and finally run it for real ./derpy_script_server

3. Configuring your server

For the most part, config.txt documents itself and you should be able to figure out what to change. The only things that you should really need to change are server_name, server_info, and if you'd like you can uncomment server_icon and set it to a relative path for a 1:1 PNG that is no more than 100 KiB.

If you are only making this server for a few friends and you want to make sure nobody joins that isn't supposed to, you can setup a whitelist by setting whitelist_instead to true and uncommenting whitelist_ip and setting it to someone's IP. You can then add as many more IPs as you want by duplicating that line.

4. Setting up your scripts

By itself, a server will do nothing to players' games. It is only through scripts that anything happens, including any sort of game sync. Scripts used to come with the server (in an extras folder) but are now you will have to download or make any scripts you want. Once you get some scripts you can control them using the same basic commands you'd use on the client.

Official scripts (made or endorsed by derpy54320) are available on github. These scripts all have their own config.txt that you should check out and configure if you decide to use them. Some scripts can integrate with each other, but none are configured to do so by default.

While most official scripts are documented here, basync has its own page due to how complex it is. It provides a modular base for multiplayer.

If you are interested in making your own network scripts, you can check out this page to get started.

5. Hosting your server

It is usually a good idea to run the server locally on Windows so it is easier to develop it, then move it to a dedicated Linux server when it's ready to be played. There are many services that will let you rent a VPS if you do not have a server yet, Vultr being a fairly good choice. It is often more cost-effective to rent a Linux server than a Windows one, but either will work of course so you should get whatever is best for you.

Once your server is up, you should be able to connect to it by turning on allow_networking in your DSL config.txt and then using /connect in-game. If everything seems okay, you can share your server's IP with your friends to start playing! It is suggested you restart the server at least every few days to keep it running well.

If you have problems, make sure the port for your server is open (17017 by default) and that your firewall allows in-bound connections for the server. To test if your server is visible to the internet, consider using portchecker.co.


account

Summary

These scripts make players create an account to play on the server. This ensures that every player has some unique identifier (their username) that other scripts can use when saving data that should be tied to a certain player. Accounts can also have roles attached to them, which other scripts can check for.

Integrations

Commands (server)

Local Events (server)

Shared Functions (server)

Shared Functions (client)


admin

Summary

These scripts provide administrative and moderative commands. Players can be authenticated using an IP or an account role if applicable. Commands are only registered for players that are allowed to use them (but even then the server will verify them before doing anything).

Integrations

Commands (client)

Local Events (server)

Shared Functions (server)


Shared Functions (client)


chat

Summary

These scripts are for the chat. Press enter or / to start sending a message or run a command.

Integrations

Commands (server)

Local Events (server)

Shared Functions (server)

Shared Functions (client)


loadanim

Summary

The same loadanim.lua script that normally comes with DSL. Loads all animation groups so other scripts don't have to worry about it.


Summary

These scripts are for the server menu. It is totally client side and serves as a central menu system for other scripts to integrate with.

Local Events (client)

Shared Functions (client)

You should usually only create a menu during a callback registered during the menu:openMain event. Callbacks run on the same thread as the main menu, so they will properly keep it from being used until your callback returns. If you do make your own menu at a different time, return true during menu:openMain while it is running.

Menu Object (client)

The menu system works by adding a bunch of options with menu:option and drawing with menu:draw each frame. After the menu is drawn, it lets the user control it the next time it is updated (the next frame). When a selection is made, the menu will remember which option it was (based on position and text) and return true next time the option is added. This lets you handle your option however you like and also keeps the options past that point from being updated until the menu is drawn again, which helps you not have to worry about control flow as much (which means you can elseif options together for convenience).

These are methods for menu objects returned by net.menu.create and net.menu.extend.

These are fields in menu objects that can be changed (other fields should not be changed).

-- menu example: make a new menu that can be accessed from the main menu RegisterLocalEventHandler("menu:openMain",function(add) add("My Menu", "An example sub-menu in the main server menu.", M_MyMenu) end) function M_MyMenu() local menu = net.menu.create("My Menu") while menu:active() do if menu:option("Give Spud Gun") then PedSetWeapon(gPlayer, 305, 8, false) elseif menu:option("Give Bottle Rocket Launcher") then PedSetWeapon(gPlayer, 307, 8, false) end menu:draw() Wait(0) end end

profanity

Summary

These scripts check for profanity. They do not do anything by themselves, and only provide other scripts with a way to check for profanity.

Shared Functions (server & client)