sbpp / sourcebans-pp

Admin, ban, and comms management system for the Source engine
https://sbpp.github.io/
Creative Commons Attribution Share Alike 4.0 International
335 stars 174 forks source link

Sourcebans Webpanel Broken No Matter What Version #750

Closed WakaFlocka432 closed 2 years ago

WakaFlocka432 commented 2 years ago

Hey guys after the new TF2 update it broke the Sourcebans Webpanel says error connecting to all servers. Even with the latest version. I learned that this is all caused due to PHP version 7.3 which no longer supports sourcebans only 7.4 Works but everyone using Nfoservers is stuck with 7.3 and cannot upgrade to 7.4 Nfoservers will not change anyones PHP version to 7.4 which means the only way to fix it is to modify the sourcebans webpanel sourcecode or something i don't know. There are tons of people that have Nfoservers so can you guys please fix it so it works with 7.3/Nfoservers otherwise all of us is stuck with a broken sourcebans forever. Yes i know it can be fixed if you switch from Nfoservers and use a different Company/Machine that supports 7.4 but everyone using Nfoservers will most likely not wanna go through all that Sh*t because were so used of it. Please let us know a solution Thank you very much

Mecha-Weasel commented 2 years ago

Regarding TF2 server queries being bjorked, I noticed thread on the AlliedMods SM forum about "SourceQuery" (part of the SourceBans++ system) needs to be updated ... https://forums.alliedmods.net/showthread.php?t=334351

Groruk commented 2 years ago

Ok, so long story short, the PHP version requirement is out of our control on this one. We use xPaw's SourceQuery library for communication between gameserver and the webpanel. The latest version of that library requires PHP 7.4 or higher (https://github.com/xPaw/PHP-Source-Query/blob/master/README.md?plain=1#L15), so in order to ensure that the library is fully working we needed to bump the version requirement for 1.7.0 to PHP 7.4.

===

If you cant update to PHP 7.4 I would suggest you apply the fix that @Mecha-Weasel posted manually (https://forums.alliedmods.net/showpost.php?p=2758134&postcount=5)

WakaFlocka432 commented 2 years ago

Regarding TF2 server queries being bjorked, I noticed thread on the AlliedMods SM forum about "SourceQuery" (part of the SourceBans++ system) needs to be updated ... https://forums.alliedmods.net/showthread.php?t=334351

https://github.com/xPaw/PHP-Source-Query/tree/master/SourceQuery

Where do these files need to go?

eNNercY1337 commented 2 years ago

Regarding TF2 server queries being bjorked, I noticed thread on the AlliedMods SM forum about "SourceQuery" (part of the SourceBans++ system) needs to be updated ... https://forums.alliedmods.net/showthread.php?t=334351

https://github.com/xPaw/PHP-Source-Query/tree/master/SourceQuery

Where do these files need to go?

it's all listed here: https://forums.alliedmods.net/showpost.php?p=2758134&postcount=5

if you cannot make these changes simply switch hosts or inform NFO about it maybe they'll change their mind. though 7.4 is the better choise considering that 7.3 is only actively updated until december as far as i know.

WakaFlocka432 commented 2 years ago

Regarding TF2 server queries being bjorked, I noticed thread on the AlliedMods SM forum about "SourceQuery" (part of the SourceBans++ system) needs to be updated ... https://forums.alliedmods.net/showthread.php?t=334351

https://github.com/xPaw/PHP-Source-Query/tree/master/SourceQuery Where do these files need to go?

it's all listed here: https://forums.alliedmods.net/showpost.php?p=2758134&postcount=5

if you cannot make these changes simply switch hosts or inform NFO about it maybe they'll change their mind. though 7.4 is the better choise considering that 7.3 is only actively updated until december as far as i know.

I read that post already he says to put the new files into this path which doesn't exist web/includes/SourceQuery

https://gyazo.com/12cd439576a2e9d605b99460e0e88eb6

there's no web folder

geominorai commented 2 years ago

Regarding TF2 server queries being bjorked, I noticed thread on the AlliedMods SM forum about "SourceQuery" (part of the SourceBans++ system) needs to be updated ... https://forums.alliedmods.net/showthread.php?t=334351

https://github.com/xPaw/PHP-Source-Query/tree/master/SourceQuery Where do these files need to go?

it's all listed here: https://forums.alliedmods.net/showpost.php?p=2758134&postcount=5 if you cannot make these changes simply switch hosts or inform NFO about it maybe they'll change their mind. though 7.4 is the better choise considering that 7.3 is only actively updated until december as far as i know.

I read that post already he says to put the new files into this path which doesn't exist web/includes/SourceQuery

https://gyazo.com/12cd439576a2e9d605b99460e0e88eb6

there's no web folder

Here is how I patched my copy running on NFO's web server (after nagging support to update PHP before the December EOL). Follow these steps at your own peril:

  1. Grab the latest commit of SBPP from this repository.
  2. Install the latest dependencies via shell using Composer with the --ignore-platform-reqs flag. This should grab the latest SourceQuery release despite not meeting the PHP 7.4 requirement.
  3. Navigate to the SourceQuery library in includes/vendor/xpaw/php-source-query-class/SourceQuery
  4. Edit out the typed properties in these files like so:

SourceQuery.php:

    class SourceQuery
    {
        // (omitted lines)

        /**
         * Points to socket class
         */
        private $Socket;

        /**
         * True if connection is open, false if not
         */
        private $Connected = false;

        /**
         * Contains challenge
         */
        private $Challenge = '';

BaseSocket.php:

    abstract class BaseSocket
    {
        /** @var resource */
        public $Socket;
        public $Engine;

        public $Address;
        public $Port;
        public $Timeout;

Buffer.php:

    class Buffer
    {
        /**
         * Buffer
         */
        private $Buffer = '';

        /**
         * Buffer length
         */
        private $Length = 0;

        /**
         * Current position in buffer
         */
        private $Position = 0;

SourceRcon.php:

    class SourceRcon
    {
        /**
         * Points to socket class
         */
        private $Socket;

        /** @var resource */
        private $RconSocket;
        private $RconRequestId = 0;

GoldSourceRcon.php:

    class GoldSourceRcon
    {
        /**
         * Points to socket class
         * 
         * @var BaseSocket
         */
        private $Socket;

        private $RconPassword = '';
        private $RconChallenge = '';

Good luck.

ProfessorFartsalot commented 2 years ago

Regarding TF2 server queries being bjorked, I noticed thread on the AlliedMods SM forum about "SourceQuery" (part of the SourceBans++ system) needs to be updated ... https://forums.alliedmods.net/showthread.php?t=334351

https://github.com/xPaw/PHP-Source-Query/tree/master/SourceQuery Where do these files need to go?

it's all listed here: https://forums.alliedmods.net/showpost.php?p=2758134&postcount=5 if you cannot make these changes simply switch hosts or inform NFO about it maybe they'll change their mind. though 7.4 is the better choise considering that 7.3 is only actively updated until december as far as i know.

I read that post already he says to put the new files into this path which doesn't exist web/includes/SourceQuery https://gyazo.com/12cd439576a2e9d605b99460e0e88eb6 there's no web folder

Here is how I patched my copy running on NFO's web server (after nagging support to update PHP before the December EOL). Follow these steps at your own peril:

1. Grab the latest commit of SBPP from this repository.

2. Install the latest dependencies via shell using Composer with the `--ignore-platform-reqs` flag.  This should grab the latest SourceQuery release despite not meeting the PHP 7.4 requirement.

3. Navigate to the SourceQuery library in `includes/vendor/xpaw/php-source-query-class/SourceQuery`

4. Edit out the typed properties in these files like so:

SourceQuery.php:

  class SourceQuery
  {
      // (omitted lines)

      /**
       * Points to socket class
       */
      private $Socket;

      /**
       * True if connection is open, false if not
       */
      private $Connected = false;

      /**
       * Contains challenge
       */
      private $Challenge = '';

BaseSocket.php:

  abstract class BaseSocket
  {
      /** @var resource */
      public $Socket;
      public $Engine;

      public $Address;
      public $Port;
      public $Timeout;

Buffer.php:

  class Buffer
  {
      /**
       * Buffer
       */
      private $Buffer = '';

      /**
       * Buffer length
       */
      private $Length = 0;

      /**
       * Current position in buffer
       */
      private $Position = 0;

SourceRcon.php:

  class SourceRcon
  {
      /**
       * Points to socket class
       */
      private $Socket;

      /** @var resource */
      private $RconSocket;
      private $RconRequestId = 0;

GoldSourceRcon.php:

  class GoldSourceRcon
  {
      /**
       * Points to socket class
       * 
       * @var BaseSocket
       */
      private $Socket;

      private $RconPassword = '';
      private $RconChallenge = '';

Good luck.

Didn't work for me nor @WakaFlocka432 , https://bans.firehostredux.com says SourceQuery on line 95 has white space in the response? I followed your steps exactly to the tee. What did I miss?

geominorai commented 2 years ago

Didn't work for me nor @WakaFlocka432 , https://bans.firehostredux.com says SourceQuery on line 95 has white space in the response? I followed your steps exactly to the tee. What did I miss?

The errors on your site I see from lines 80-95 in SourceQuery.php are the exact lines that have to be edited to be:

        /**
         * Points to socket class
         */
        private $Socket;

        /**
         * True if connection is open, false if not
         */
        private $Connected = false;

        /**
         * Contains challenge
         */
        private $Challenge = '';

        /**
         * Use old method for getting challenge number
         */
        private $UseOldGetChallengeMethod = false;

This error happens when PHP 7.3 did not understand typed properties defined like private BaseSocket $Socket;

Parse error: syntax error, unexpected 'BaseSocket' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

Make sure you are editing the right file. In your case, it is under the folder:

/usr/www/<your username>/bans/includes/vendor/xpaw/php-source-query-class/SourceQuery/

ProfessorFartsalot commented 2 years ago

Thanks - And yeah I tried setting that all like that and for some reason it didn't work for me. Copying your code fixed it though. Thanks again. All is well.