Unable to buy anything from any special port.

Where we find trouble with the latest release... and shoot it.

usalabs
Posts: 26
Joined: Tue May 19, 2020 13:29 UTC

Unable to buy anything from any special port.

Post by usalabs » Tue May 19, 2020 13:37 UTC

I'm setting up a game server and downloaded BlackNova Trader from the sourceforge, installed it and set it up on my server, and now I'm testing it to see how it plays, but I can't buy anything from any special ports, I get this message:-

Your last Sales Transaction has already been delivered, Please enter the Special Port and select your order.

I did, I entered the port at sector 0 and I don't see anything of any stuff I supposed to have bought.

Do I need to delete all the files and start again?

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: Unable to buy anything from any special port.

Post by TheMightyDude » Tue May 19, 2020 21:57 UTC

Can we have the following server information:
  • OS and version
  • Apache Version
  • MySQL Version
  • PHP Version
  • BNT Version
Also you cannot run it as localhost or 127.0.0.1 etc due to it sometimes causes COOKIE issues, there are some issues when running BNT on a web service like IIS running on a Windows OS.

But yours looks like it might be a PHP Session issue, try looking at the apache logs, and also creating a blank file named "dev" in the BNT folder, re-create the universe and try again.

BNT also uses PHP Sessions when doing stuff like buying stuff at the ports, scanning, attacking a ship or planet, this is to reduce abuse on the server.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

usalabs
Posts: 26
Joined: Tue May 19, 2020 13:29 UTC

Re: Unable to buy anything from any special port.

Post by usalabs » Wed May 20, 2020 08:42 UTC

OK, this is my server set up:-

Machine = Dell PowerEdge T710
CPU = 2xXeon E5530 CPU's = 8 Physical cores and 8 logical cores, totaling 16 cores.
RAM = 64GB
8x1TB HD's as raid 5
OS = Headless Ubuntu 18.04.4 LTS
Apache 2.4.43
MySQL 5.7.30-0ubuntu0.18.04.1
PHP v5.6 (BNT doesn't work on anything higher that 5.6), I do have multiple PHP versions installed and I wrote a bash script to easily switch versions if I need to.
BNT = v0.663 obtained from Soureforge https://sourceforge.net/projects/blacknova/

I'm not running it from localhost, it's running on my home server and I'm using a DYDNS host name from noip.

And I get an error 500 if I try to run BNT on any version of PHP higher then 5.6

The Apache error logs show nothing, and the Apache access.log only shows codes 200 for get and post from and to various php scripts, but no errors, and no errors in php.log either, very strange huh?

This is the error log when running under PHP 7.3:-

Code: Select all

[Wed May 20 01:37:44.404790 2020] [mpm_prefork:notice] [pid 5341] AH00169: caught SIGTERM, shutting down
[Wed May 20 01:37:44.556449 2020] [mpm_prefork:notice] [pid 9291] AH00163: Apache/2.4.43 (Ubuntu) configured -- resuming normal operations
[Wed May 20 01:37:44.556527 2020] [core:notice] [pid 9291] AH00094: Command line: '/usr/sbin/apache2'
[Wed May 20 01:38:01.759693 2020] [php7:error] [pid 9299] [client 65.103.212.18:54392] PHP Parse error:  syntax error, unexpected '[', expecting ',' or ';' in /var/www/bnt/includes/load_languages.php on line 42, referer: http://home-regions.no-ip.org/traders/port2.php
I assume to re-create the universe, I would drop and re-create the DB, then re-run index.php?

ADDENDUM
I have setup a temporary player, and I set the startup credits to 10M, login using the below details, then click on the port in sector 0, then try and buy an engine or a hull, you should see that red error along the top.

URL = http://home-regions.no-ip.org/traders

Login = nobody@nowhere.com
Passwd = fixmyerrors

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: Unable to buy anything from any special port.

Post by TheMightyDude » Wed May 20, 2020 11:09 UTC

Well BNT does work PHP 7.2.x but you have to change stuff in the code.

I will download that version and see what is happening.

I will get back once I find out what the issue is.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: Unable to buy anything from any special port.

Post by TheMightyDude » Wed May 20, 2020 13:09 UTC

Ok, I was right in it being a Session Issue.
It was failing to create the Sessions table in the database.

I have updated ADOdb Backend to the latest version v5.20.16 12-Jan-2020 which will work on PHP 7.2.x

Now although I have this working on PHP 7.2.x you will need to test it yourself due to I haven't the time to test everything.
But the universe creates and I was able to buy stuff from the special ports.

But due to it is old code and using the new ADOdb code, you might have issues running it on PHP 5.6, but you could just try it.
I am also saying there might be loads more of issues unknown.

Try this version: bnt-0.663b.zip make a backup of your existing files and then unzip this file and overwrite the current files and re-set the config settings etc.

Let me know if it works or not.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

usalabs
Posts: 26
Joined: Tue May 19, 2020 13:29 UTC

Re: Unable to buy anything from any special port.

Post by usalabs » Wed May 20, 2020 13:31 UTC

I'm afraid not, I get this at the top now:-

Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/bnt/backends/adodb/drivers/adodb-mysql.inc.php on line 480

And I still get that red line at the top underneath the error:-


Your last Sales Transaction has already been delivered, Please enter the Special Port and select your order.

Also the logout now takes about 5 minutes with the white circle on the tab rotating constantly for about 5 minutes.

ADDENDUM
I fixed it,,, when I copied the new files over it some how didn't overwrite db_config.php, it works now, I had to manually copy that file over.

But I still get that red error about the last transaction.

2 new notices:-

Notice: Trying to get property of non-object in /var/www/bnt/includes/gen_score.php on line 90

Notice: Trying to get property of non-object in /var/www/bnt/includes/gen_score.php on line 94

and that was when I logged out.

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: Unable to buy anything from any special port.

Post by TheMightyDude » Wed May 20, 2020 13:58 UTC

You cannot use persistent connections, I think that's been broken for ages, so set $db_persistent = 0;
You also have to use "mysqli" for the driver, so set $ADODB_SESSION_DRIVER = "mysqli";

Once changed, re-create the universe and try again it should work due to I tested on the following:
PHP 7.2.24
Apache/2.4.29
MySQL 5.7.30

Thumb imageAs you can see it is working here, so it should work for you.
So I don't know what you are changing that is breaking it.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: Unable to buy anything from any special port.

Post by TheMightyDude » Wed May 20, 2020 14:01 UTC

One sec, will look into the gen score issue.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

usalabs
Posts: 26
Joined: Tue May 19, 2020 13:29 UTC

Re: Unable to buy anything from any special port.

Post by usalabs » Wed May 20, 2020 14:12 UTC

OK, I changed to PHP 7.2 and when I tried to create the universe, it got the the point of dropping the databses, then this happens:

Code: Select all


Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170
Dropping Tables
Dropping all tables	Passed
Hover over the failed line to see the error.
Dropping stage complete.


Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/bnt/backends/adodb/adodb-perf.inc.php on line 170
I just ignored the errors and continued, and so far everything seems to work, I'm still going through the bits, I can now buy from a space port without and of those errors.

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: Unable to buy anything from any special port.

Post by TheMightyDude » Wed May 20, 2020 14:17 UTC

Ok, in includes/connectdb.php add the following line to line 61:

Code: Select all

        $db->Execute ("SET SESSION sql_mode = 'STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION';");
So it looks like the following lines:

Code: Select all

    if ( ($db instanceof ADOConnection) && (is_resource($db->_connectionID) || is_object($db->_connectionID)) )
    {
        // Set our character set to utf-8
        $db->Execute("SET NAMES 'utf8'");
        $db->Execute ("SET SESSION sql_mode = 'STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION';");
        // Yes we connected ok, so return true.
        return true;
    }
You shouldn't need to re-create the universe.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

Post Reply