• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

From Windows 10 to OTS development machine for dummies - part 2

Hello @Gesior.pl, I am having the following error, any idea?

STEP 1​

Check server configuration

Parse error: syntax error, unexpected token "{", expecting ";" in C:\xampp\htdocs\classes\configlua.php(57) : eval()'d code on line 1
Which acc. maker? TFS-1.3 or TFS-1.2?
It's looks like problem with parsing 'experience stages' from config.lua, but it's 1.3 feature and I fixed it in newest version of acc. maker. Fix is here:
You can copy newest configlua.php ( https://raw.githubusercontent.com/gesior/Gesior2012/master/classes/configlua.php) class to any Gesior2012. It does not change anything, only fix problem with tables in config.lua.
 
Thanks @Gesior.pl for the quick reply, that fixed the issue.
I think that everything is set up, I have a really stupid question, but which client should I use to log in my server? I used the TFS from the tutorial
 
10.99 or 10.98
Thanks @Gesior.pl for the quick reply, that fixed the issue.
I think that everything is set up, I have a really stupid question, but which client should I use to log in my server? I used the TFS from the tutorial
Code:
static constexpr auto CLIENT_VERSION_MIN = 1097;
static constexpr auto CLIENT_VERSION_MAX = 1098;
static constexpr auto CLIENT_VERSION_STR = "10.98";
 
Thanks @Gesior.pl I tried using tibialoader with 10.99, but when I put my acc/pass, promt says "Only clients with protocol 10.98 allowed"
Any suggestion? Is it possible that the port is wrong? I assume the IP should be my local IP
 
Thanks @Gesior.pl I tried using tibialoader with 10.99, but when I put my acc/pass, promt says "Only clients with protocol 10.98 allowed"
Any suggestion? Is it possible that the port is wrong? I assume the IP should be my local IP
Code:
static constexpr auto CLIENT_VERSION_MIN = 1097;
static constexpr auto CLIENT_VERSION_MAX = 1098;
static constexpr auto CLIENT_VERSION_STR = "10.98";
It says: 10.97 or 10.98
 
Thanks @Gesior.pl for the great tutorial. I have everything working for the most part, except for the website. Two issues I get:
1. These two warnings show up on each page
Code:
[B]Warning[/B]: Undefined variable $newsTicker in [B]D:\Tibia\xampp\htdocs\layouts\tibiacom\layout.php[/B] on line [B]387

Warning[/B]: Undefined variable $featuredArticle in [B]D:\Tibia\xampp\htdocs\layouts\tibiacom\layout.php[/B] on line [B]389[/B]
2. When I try to create an account the reCaptcha image is missing and it says
Code:
Image Verification is missing, please contact the administrator

I tried using branch 1.2, 1.3 and master but no luck on either of them.
For TFS I used the master branch.
Any ideas what might be wrong?
 
Thanks @Gesior.pl for the great tutorial. I have everything working for the most part, except for the website. Two issues I get:
1. These two warnings show up on each page
Code:
[B]Warning[/B]: Undefined variable $newsTicker in [B]D:\Tibia\xampp\htdocs\layouts\tibiacom\layout.php[/B] on line [B]387

Warning[/B]: Undefined variable $featuredArticle in [B]D:\Tibia\xampp\htdocs\layouts\tibiacom\layout.php[/B] on line [B]389[/B]
2. When I try to create an account the reCaptcha image is missing and it says
Code:
Image Verification is missing, please contact the administrator

I tried using branch 1.2, 1.3 and master but no luck on either of them.
For TFS I used the master branch.
Any ideas what might be wrong?
Somehow 'undefined variable' changed from 'notice' to 'warning' over time.
Replace in index.php ( gesior/Gesior2012 (https://github.com/gesior/Gesior2012/blob/master/index.php#L3) ):
Code:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
with:
Code:
error_reporting(0);
 
Thanks that did the trick.

And for the reCaptcha I ended up just changing line 16 to false to just not use it for anyone wondering.
Code:
$config['site']['verify_code'] = false;
 
Which acc. maker? TFS-1.3 or TFS-1.2?
It's looks like problem with parsing 'experience stages' from config.lua, but it's 1.3 feature and I fixed it in newest version of acc. maker. Fix is here:
You can copy newest configlua.php ( https://raw.githubusercontent.com/gesior/Gesior2012/master/classes/configlua.php) class to any Gesior2012. It does not change anything, only fix problem with tables in config.lua.


Hello,
I changed the files (copied from your release to IntelliJ) you released but i'm getting this error:

"Uncaught Error: Class "ConfigPHP" not found in C:\xampp\htdocs\classes\website.php:36 Stack trace: #0 C:\xampp\htdocs\classes\website.php(44): Website::loadWebsiteConfig() #1 C:\xampp\htdocs\install.php(102): Website::getWebsiteConfig() #2 {main} thrown in C:\xampp\htdocs\classes\website.php on line 36"

I did not change "branch" TFS-1.2 to TFS-1.3 in the htdocs in gitbash. I dont really know how to. (I'm new to this).
You also mentioned php extensions, how to i add these? Would appricate a small "how-to" if you got the time.
 
Hello,
I changed the files (copied from your release to IntelliJ) you released but i'm getting this error:

"Uncaught Error: Class "ConfigPHP" not found in C:\xampp\htdocs\classes\website.php:36 Stack trace: #0 C:\xampp\htdocs\classes\website.php(44): Website::loadWebsiteConfig() #1 C:\xampp\htdocs\install.php(102): Website::getWebsiteConfig() #2 {main} thrown in C:\xampp\htdocs\classes\website.php on line 36"

I did not change "branch" TFS-1.2 to TFS-1.3 in the htdocs in gitbash. I dont really know how to. (I'm new to this).
You also mentioned php extensions, how to i add these? Would appricate a small "how-to" if you got the time.
I will check if this tutorial still works on weekend and update it.
If you are using newest TFS from github, you must use 'TFS-1.3' or 'master' branch:
Code:
git checkout TFS-1.3
 
If someone want to use Docker instead of XAMPP, here is what should be in docker-compose.yml

YAML:
version: '3.1'

services:
  db:
    container_name: OtsDatabase
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 12345
      MYSQL_DATABASE: **YOUR DB NAME**
    ports:
      - 3307:3306

  phpmyadmin:
    container_name: phpMyAdmin
    image: phpmyadmin
    restart: always
    ports:
      - 8080:80
    environment:
      - PMA_ARBITRARY=1
 
@Gesior.pl
I'm getting this error on step 4:

Add samples to DB:

Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'premdays' in 'field list' in D:\xampp\htdocs\classes\database.php:192 Stack trace: #0 D:\xampp\htdocs\classes\database.php(192): PDO->query('SELECT id, `n...') #1 D:\xampp\htdocs\classes\account.php(33): Database->query('SELECT id, `n...') #2 D:\xampp\htdocs\classes\account.php(21): Account->load(1, 'name') #3 D:\xampp\htdocs\install.php(346): Account->__construct(1, 'name') #4 {main} thrown in D:\xampp\htdocs\classes\database.php on line 192

I've followed the guide step-by-step, don't know where it went wrong :/
 
@Gesior.pl
I'm getting this error on step 4:

Add samples to DB:

Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'premdays' in 'field list' in D:\xampp\htdocs\classes\database.php:192 Stack trace: #0 D:\xampp\htdocs\classes\database.php(192): PDO->query('SELECT id, `n...') #1 D:\xampp\htdocs\classes\account.php(33): Database->query('SELECT id, `n...') #2 D:\xampp\htdocs\classes\account.php(21): Account->load(1, 'name') #3 D:\xampp\htdocs\install.php(346): Account->__construct(1, 'name') #4 {main} thrown in D:\xampp\htdocs\classes\database.php on line 192

I've followed the guide step-by-step, don't know where it went wrong :/
It looks like you downloaded newest version of TFS, not 1.2. Newest TFS changed to 'something between 1.2 and 1.4', often called '1.3'.
Acc. maker version for it is 'TFS-1.3'. In step 7 replace:
Code:
git checkout TFS-1.2
to:
Code:
git checkout TFS-1.3

EDITED FIRST POST to make it compatible with newest TFS.
 
Last edited:
I managed to compile the TFS following your guide and get till the point where the server is "running". but can never log in cuz "conection failed".
And when i tried to make the website part i use the command "checkout tfs 1.4 (even 1.3)" and i get this error:
$ git checkout TFS-1.3
fatal: unsafe repository ('D:/Xamp/htdocs' is owned by someone else)
To add an exception for this directory, call:

git config --global --add safe.directory D:/Xamp/htdocs
after that everything fails for me. In the php install, i get this error:
Fatal error: Uncaught InvalidArgumentException: #C-2 LUA config file doesn't exist. Path: <b>/home/ots/config.lua</b> in D:\Xamp\htdocs\classes\configlua.php:25 Stack trace: #0 D:\Xamp\htdocs\classes\configlua.php(13): ConfigLUA->loadFromFile('/home/ots/confi...') #1 D:\Xamp\htdocs\install.php(102): ConfigLUA->__construct('/home/ots/confi...') #2 {main} thrown in D:\Xamp\htdocs\classes\configlua.php on line 25
 
Last edited:
Fantastic tutorial! Thank you. I however, need help with the below. I'm getting this error on 127.0.0.1 on Step 5. Any assistance would be appreciated.

Deprecated: Return type of Vocations::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 106

Deprecated
: Return type of Vocations::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 116

Deprecated
: Return type of Vocations::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 121

Deprecated
: Return type of Vocations::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 126

Deprecated
: Return type of Vocations::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 111

Deprecated
: Return type of Vocations::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 131
 
Fantastic tutorial! Thank you. I however, need help with the below. I'm getting this error on 127.0.0.1 on Step 5. Any assistance would be appreciated.

Deprecated: Return type of Vocations::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 106

Deprecated
: Return type of Vocations::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 116

Deprecated
: Return type of Vocations::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 121

Deprecated
: Return type of Vocations::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 126

Deprecated
: Return type of Vocations::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 111

Deprecated
: Return type of Vocations::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\classes\vocations.php on line 131
Edit index.php:
and replace:
PHP:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
with:
PHP:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_DEPRECATED);
 
Edit index.php:
and replace:
PHP:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
with:
PHP:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_DEPRECATED);
Thank you, this worked.

The http://127.0.0.1/login.php that i got from your github brings up this error:

Fatal error: Uncaught InvalidArgumentException: Cannot load page <b>ws_login</b>, file does not exist. in C:\xampp\htdocs\system\load.compat.php:20 Stack trace: #0 C:\xampp\htdocs\index.php(33): include_once() #1 C:\xampp\htdocs\login.php(5): include('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\system\load.compat.php on line 20

I also cannot login to my server. I have modified the client.exe to:

loginWebService=http://127.0.0.1/
clientWebService=http://127.0.0.1/

with enough spaces on the lines but it says:

Log in failed! Tibia might be down for maintenance, please try again later.

I have tried repeating your tutorial and have updated my TFS version to 1.4. The server itself loads up fine i just cant log in or get login.php to work
 
Last edited:
Parse error: syntax error, unexpected ':', expecting ';' or '{' in C:\WebServ\httpd\classes\website.php on line 179
error
public static function isIpInRanges($ip, $ranges): bool
 
Hello I'm having trouble making the account because the Image Verification is missing. Any ideas?
1675728472094.png

Thanks in advance.
 
Back
Top