NeHo

CoD4 Status - screenshot view web

Recommended Posts

CoD4 status is a php/mysql based website script for COD4x-MOD servers

What does it do?

It gives you a list of players currently on the server, server administrator list, banned player list and the screenshots taken with $getss command.

Admins with 100 power can add new servers, admins, server rules, remove players from the banlist after they are unbanned on the server.

Admins with lower power than 100 can remove the screenshots, add players to the banlist after they banned somebody on the server (some kind of cheater report)

In order to use this script you will need php, mysql database and I recommend to use cronjob so the server player list can be refreshed every x minutes.

Use it and modify it freely for non-commercial use, just include my name, as I spent a lot of time developing this tool.

How to install and use it?

Follow next instructions to install and activate CoD4 Status and screenshot view website script

Extract the file and find mysql folder, inside that folder you will find the required mysql database. Create a new database on your webserver and upload the mysql file.

After you downloaded the CoD4 Status and screenshot view website script upload it to your webserver, the mysql folder is not needed anymore so you can delete it.

After upload extract the files and navigate to Connections -> ststsconfig.php

Change next lines with your connection datas

$hostname_ststsconfig = "localhost";
$database_ststsconfig = "DATABASE_NAME";
$username_ststsconfig = "DATABASE_USER";
$password_ststsconfig = "DATABASE_PASSWORD";

Navigate to your domain (www.mywebsite.com)

In the right upper corner click on Login

Login information

username: admin
password: adminpassword

After login navigate to Server Settings -> Server Admins

  • add yourself as an admin with 100 power (enter the correct Admin UID)*
  • after adding yourself as an admin don’t forget to delete the default user admin
  • Log out in the right upper corner and login again with your username and password

(Admin UID can be found on your gameserver, enter the next command and read the Admin UID $AdminListAdmins)

Now we are ready to add our server(s)

Navigate to Server Settings -> My Servers

On the right side add your cod4 server

Enter

  • Server IP
  • Server Port
  • Steam Group (For server Admins - will be available in future)

We are now finished with servers, player lists let's handle now the screenshot part, so we can view them, create cheater reports

in order to use this feature we need to install a COD4x plugin on our game server(s) screenshotsender

we will also need the latest binary file from github, and the latest xbase_00.iwd from here https://cod4x.me/ 

Now that we have all files on our game server we need one more part

Add this lines at the end of your server.cfg file

* change the identkey to something else

set nehoscreenshot_identkey 12345678
set nehoscreenshot_url "http://mywebsite.com/screenshots/submit.php"
loadplugin nehoscreenshotuploader

Copy the identkey from your server.cfg to cod4 status page, you can enter it under Settings -> My settings

I would also recommend to use cronjob for player list refresh, on linux you can do it in next way

Connect to your server, open up your console and type in next

$ crontab -e

Add a new line to the bottom of the opened file

*/5 * * * * wget --spider http://mywebsite.com/cronjob/refresh.php

close and save the file, thats it, now our player list will be refreshed every 5 mins

If you use cronjob go again to  Settings -> My settings

and change the part "I am using cron job:" to yes, save it

If everything was fine, from now on if you take a screenshot on your game server the screenshot will be also sent to your web server and you will see it (enter the server where the player plays and go to “New Screenshots” tab)

cod4status.zip

  • Like 1

Share this post


Link to post
Share on other sites

Good job!

Although, ouch, you're still using the old mysql functions("mysql_select_db()" and such). As you can see here, these functions are already deprecated since PHP 5.5, and are as of PHP 7.0 completely removed. This thus makes your webpage unusable on webservers running PHP 7.0 or higher. I would recommend you change these to use mysqli or PDO (preferred) instead.

Share this post


Link to post
Share on other sites

Well this is an old script, i have just implemented the plugin part, i moved to node and I use it with mongodb. I hope that it will work for most of the users all my old websites are made with this functions and they still work. You are right mysqli i faster and better and new projects should be made in that way!

Share this post


Link to post
Share on other sites

hey,

So I complied the plugin found on the GitHub page. Added the server into the panel went into game did $getss st0rm I see the screen shot on the server but i do not see it in cod4stats panel.

I checked the output.txt and only see this.

array (

'status' => 'okay',

)

Share this post


Link to post
Share on other sites

You should not have the output.txt file inside your screenshots folder, have you used the webserverupload folder from github? You need only the plugin from the github, the wenserverupload was made by fraggy, he helped me to set it up, thats just an example. Also pls check the chmod from screenshots folder, it should be 755, also the banned folder on your website server

Share this post


Link to post
Share on other sites

Yes, I uncommented the links in the submit script. Just to see if thier was any errors . Checked both the folder permission were set correctly. Just starting to wonder that my server runs on windows that might be causing the issue.

Share this post


Link to post
Share on other sites

Was tested on Windows. But you have to recompile the server as well. Did you do that? Current official release contains bug not make it working.

Share this post


Link to post
Share on other sites

Was tested on Windows. But you have to recompile the server as well. Did you do that? Current official release contains bug not make it working.

Yeah I just compiled the new code and worked fine. Thanks for the tip.

Share this post


Link to post
Share on other sites

Since you placed the script inside  status directory the links are broken, you will have to change them manually or you can create a sub-domain and put the script in root directory. if you want to keep it as is you have to change header.php inside folder include 

I will update and share the new script soon, this part is already solved, but you need to wait, because I have other obligations and the script is not finished yet

include->header.php

(example)













Share this post


Link to post
Share on other sites

Since you placed the script inside  status directory the links are broken, you will have to change them manually or you can create a sub-domain and put the script in root directory. if you want to keep it as is you have to change header.php inside folder include 

I will update and share the new script soon, this part is already solved, but you need to wait, because I have other obligations and the script is not finished yet


when I try to add a server I get the error

Column 'server_location' cannot be null

I used phpadmin to change the database to allow Server_location to be null

then I get this error

Column 'server_current_map_alias' cannot be null

once again I edited the database to allow server_current_map_alias to be null

and it saved the server ip and port

I put 0 for Steam Group (For server Admins - COD4x mod required)

problem is the server status does not update (the server is on a windows system)

what do I have to do to have the server update?

Also as for the screenshot plugin  I have no idea how to compile it (I will people would think of us window users)

so I will do without it.

Just need to know what to do to get the server updating in your program.

Share this post


Link to post
Share on other sites

You did something wrong, follow the steps as I wrote, and try to install the script again.

The server updates every time when you run the refresh.php

cronjob->refresh.php

Share this post


Link to post
Share on other sites

You did something wrong, follow the steps as I wrote, and try to install the script again.

The server updates every time when you run the refresh.php

cronjob->refresh.php

I found the problem  the refresh.php for non cronjon was named no-cronjob-refresh.php

once I renamed it to refresh.php it started working

You should update your instruction for us windows users.

Share this post


Link to post
Share on other sites

No screenshots sent to the web server. The console logs have a record of:

Screenshot for client amerdia saved to screenshots/amerdia0000.jpg

OnScreenshotArrived screenshots/amerdia0000.jpg...

^2Processed 1428 bytes for client amerdia

^1Error: Failed to open file screenshots/amerdia0000.jpg for reading

chmod 755 on the screenshot folder. On jpg files chmod 644 . how to change the permissions on new files, I do not know. Prompt that can be corrected?

Share this post


Link to post
Share on other sites

What do you use for file uploads to your web server?

  Plugin nehoscreenshotuploader.sо . The web server is on the game server. Customize to your instructions in this topic.

Share this post


Link to post
Share on other sites

Well this plugin takes the files which just got written. Same user. Can't fail on permissions.

Share this post


Link to post
Share on other sites

The plugin is running as the same user as the server. I tried to run from the user Root plugin with chmod 755 error too.

^1Error: Failed to open file screenshots/test0000.jpg for reading

Advise that not so?

ps. please share a working plugin plugin screenshotsender

Share this post


Link to post
Share on other sites

I think I found the cause of the error in the build of 1483 .. plugin gets an error . The server with the build of 1458 disappeared in error logs, screenshots but still not on the web server. ((

Share this post


Link to post
Share on other sites

After you take a screenshot on the server, can you see the screenshot on the game server? I mean on the gameserver inside screenshots folder

Share this post


Link to post
Share on other sites

After you take a screenshot on the server, can you see the screenshot on the game server? I mean on the gameserver inside screenshots folder

In the screenshots folder has players screenshots.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.