[Help] Open Tibia Server

wick3dr0se

Member
Joined
Sep 24, 2020
Messages
43
Solutions
1
Reaction score
10
I'm interested in creating a 8.6 RL map Tibia server. I have some questions before I decide to get started. I've done little research; Mainly because of the lack of updated tutorials and I figured this would be the best resource for up-to-date information! I've done some forum searching here and it yielded poor results for my situation. Excuse me for being unintelligent please.. I have developer experience as I'm posting this from Arch Linux and have created multiple websites for business means. Mainly my coding experience consist of languages such as HTML, CSS, Typescript, Vue and very little scripting. I find databases/hosting to be cumbersome and annoying just due to the broad horizon of options. I throw my sites on Github and have them running for free. I just pay for the domain. I'm curious how this works for Tibia servers. I know people download variations of The Forgotten Server. Does this handle hosting or can I build my server on Github. And what programs would you recommend to use for developing a very minimal Tibia 8.6 server in 2020?
 
OP
wick3dr0se

wick3dr0se

Member
Joined
Sep 24, 2020
Messages
43
Solutions
1
Reaction score
10
I've installed nginx/mariadb/php-fpm/adminer. Then followed your suggestion and used neikro's downport of the forgottenserver for 1.3 and managed to upload the schema.sql from the server to the database. I attempted to use ZnoteAAC for a website and account creation as suggested during the OTS guide on OTLand. I failed to set it up properly and it lead me to a blank page. All other test with nginx are working properly such as test.php and adminer.php. I now have accountmanager enabled in my config.lua and want to make my accounts from the login screen in the tibia client; so that a website is not needed. Is this still possible. I actually prefer this method and don't need the website. I've found information very hard to come across and Debian's tutorials to be very outdated or unrelated to my use case. Using OTClient from edubart when trying to login to my server with it running from terminal I receive a login error that 'Only clients with protocol 10.98 allowed!' I have set client version in my config. I believe I could have simple over-looked mistakes with the lack of quality information.

Here are some of my configs:
~/forgottenserver/config.lua
-- Version
clientVersionMin = 8.57
clientVersionMax = 8.7

-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeRuneCharges = true
removePotionCharges = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 24 * 60 * 60
whiteSkullTime = 15 * 60
stairJumpExhaustion = 2000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75
criticalHitChance = 7
stairJumpExhaustion = 2000
animationTextOnHeal = "yes"
showHealingDamage = true
showHealingDamageForMonsters = false
gainExperienceColor = 215
squareColor = 0
allowFightback = true

-- Account Manager
accountManager = "yes"
newPlayerChoceVoc = "no"
newPlayerSpawnPosX = 95
newPlayerSpawnPosY = 117
newPlayerSpawnPosZ = 7
newPlayerTownID = 1
newPlayerLevel = 0
newPlayerMagicLevel = 0

-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 100
motd = "Welcome to The Forgotten Server!"
onePlayerOnlinePerAccount = true
allowClones = false
serverName = "RetroRook"
statusTimeout = 5000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
PasswordType = "sha1"

-- Guilds
ingameGuildManagement = true
levelToFormGuild = 50
premiumDaysToFormGuild = 0
guildNameMinLength = 4
guildNameMaxLength = 20

-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = -1

-- Houses
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality
housePriceEachSQM = 1000
houseRentPeriod = "never"
houseOwnedByAccount = true

-- Item Usage
timeBetweenActions = 100
timeBetweenExActions = 5000

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
mapName = "forgotten"
mapAuthor = "Komic"

-- Market
marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100

-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "wick3dr0se"
mysqlPass = "root"
mysqlDatabase = "forgottenserver"
mysqlPort = 3306
mysqlSock = ""

-- Misc.
-- NOTE: classicAttackSpeed set to true makes players constantly attack at regular
-- intervals regardless of other actions such as item (potion) use. This setting
-- may cause high CPU usage with many players and potentially affect performance!
-- forceMonsterTypesOnLoad server loads all monster types on startup for debugging purposes, you can change to false if all of your monster files don't throw errors to save up memory.
allowChangeOutfit = true
allowChangeColors = true
allowChangeAddons = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = false
classicAttackSpeed = false
showScriptsLogInConsole = true
showOnlineStatusInCharlist = false
yellMinimumLevel = 2
yellAlwaysAllowPremium = false
forceMonsterTypesOnLoad = true

-- Server Save
-- NOTE: serverSaveNotifyDuration in minutes
serverSaveNotifyMessage = true
serverSaveNotifyDuration = 5
serverSaveCleanMap = true
serverSaveClose = false
serverSaveShutdown = false

-- Rates
-- NOTE: rateExp is not used if you have enabled stages in data/XML/stages.xml
rateExp = 2
rateSkill = 10
rateLoot = 3
rateMagic = 6
rateSpawn = 2

-- Monsters
deSpawnRange = 2
deSpawnRadius = 50

-- Stamina
staminaSystem = false

-- Scripts
warnUnsafeScripts = true
convertUnsafeScripts = true

-- Startup
-- NOTE: defaultPriority only works on Windows and sets process
-- priority, valid values are: "normal", "above-normal", "high"
defaultPriority = "high"
startupDatabaseOptimization = false

-- Status server information
ownerName = "wick3dr0se"
ownerEmail = ""
url = "OTLand (https://otland.net/)"
location = "Sweden"


/usr/share/nginx/html/RetroRook/config.php
<?php
if (!defined('ZNOTE_OS')) {
$isWindows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
define('ZNOTE_OS', ($isWindows) ? 'WINDOWS' : 'LINUX');
}

// If you want to use items.php (not 100% yet, I guess)
// Tested with TFS master items.xml (1.x)
$config['items'] = false;

// Available options: TFS_02, TFS_03, OTHIRE, TFS_10
// OTHire = OTHIRE
// TFS 0.2 = TFS_02
// TFS 0.3 = TFS_03 (If you are using 0.3.6, set $config['salt'] to false)!
// TFS 0.4 = TFS_03
// TFS 1.x = TFS_10 (Current under development version)
$config['ServerEngine'] = 'TFS_13';
// As far as I know, OTX is based on TFS_03, so make sure TFS version is configured TFS_03
$config['CustomVersion'] = false;

$config['site_title'] = 'RetroRook';
$config['site_title_context'] = 'Because open communities are good communities. :3';
$config['site_url'] = "";

// Path to server folder without "\" (or "/") at the end, ex: C:\Users\Username\Documents\GitHub\forgottenserver
$config['server_path'] = '~/forgottenserver';

// ------------------------ \\
// MYSQL CONNECTION DETAILS \\
// ------------------------ \\

// phpmyadmin username for OT server: (DONT USE "root" if you are hosting to public).
$config['sqlUser'] = 'wick3dr0se';

// phpmyadmin password for OT server:
$config['sqlPassword'] = 'root';

// The database name to connect to. (This is usually same as username).
$config['sqlDatabase'] = 'forgottenserver';

// Hostname is usually localhost or 127.0.0.1.
$config['sqlHost'] = '127.0.0.1';

// QR code authenticator Only works with TFS 1.2+
$config['twoFactorAuthenticator'] = false;
// You can use the mobile phone app "authy" with this.

/* CLOCK FUNCTION
- getClock() = returns current time in numbers.
- getClock(time(), true) = returns current time in formatted date
- getClock(false, true) = same as above
- getClock(false, true, false) = get current time, don't adjust timezone
- echo getClock($profile_data['lastlogin'], true); = from characterprofile,
explains when user was last logged in. */
function getClock($time = false, $format = false, $adjust = true) {
if ($time === false) $time = time();
// Date string representation
$date = "d F Y (H:i)"; // 15 July 2013 (13:50)
if ($adjust) $adjust = (1 * 3600); // Adjust to fit your timezone.
else $adjust = 0;
if ($format) return date($date, $time+$adjust);
else return $time+$adjust;
}

// ------------------- \\
// CUSTOM SERVER STUFF \\
// ------------------- \\


/etc/nginx/nginx.conf
user http;
worker_processes auto;
worker_cpu_affinity auto;

events {
multi_accept on;
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

sendfile on;
tcp_nopush on;
charset utf-8;
#keepalive_timeout 0;
keepalive_timeout 65;
types_hash_max_size 4096;
client_max_body_size 16M;

#gzip on;

server {
listen 80;
#listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name localhost;
index index.php;
root /usr/share/nginx/html;


location / {
index index.php index.html index.htm;
}

error_page 404 /index.php;

location ~ \.php {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_param DOCUMENT_ROOT /usr/share/nginx/html;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$base/:/usr/lib/php/:/tmp/";

include fastcgi_params;

try_files $fastcgi_script_name =404;

}
}


# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;

# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;

# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}
 
OP
wick3dr0se

wick3dr0se

Member
Joined
Sep 24, 2020
Messages
43
Solutions
1
Reaction score
10
Check client version in OTCLIENT's init.lua

I can't find anything about client or version in the file. I'm not experienced with Lua. I tried to search it but couldn't find anything about setting the client version for OTClient
 
OP
wick3dr0se

wick3dr0se

Member
Joined
Sep 24, 2020
Messages
43
Solutions
1
Reaction score
10
Check client version in OTCLIENT's init.lua

I was cloning the master branch and not the 8.6 downport from github. I downloaded the zip instead. Next I just have to figure out the most efficient way of creating accounts!
 
Last edited:
Top