SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 09/04/2015, 11:35 PM   #1
GWMPT
High-roller
 
Join Date: Nov 2012
Location: Portugal.
Posts: 1,020
Reputation: 287
Default SATTP - SA:MP Embedded Web server

SATTP - SA:MP Web Server
Hosting online content, in a game server


[INTRODUCTION]

Good evening.
I've released this plugin in the Portuguese section around a week ago.
And since I had enough people supporting this project, I'm here to release it for public usage without any kind of issues(so far).

Basically, this plugin offers the possibility to host online content using the SA:MP Server.
One of the objectives is to offer the possibility to host sounds and musics, and stream these in-game, directly to the player, without using third-party services, which can be, sometimes, unavailable.
And this plugin offers the possibility to host dynamic web pages
What do I want to mean with "Dynamic web pages"
Well... I've added the possibility to run PHP based scripts(websites, whatever you want to call it), by using PHP-CGI.
However, the PHP interpreter needs to be installed by you.
Anyways, keep reading... And I'll explain how should you install PHP to use with your SA:MP Web server(Or simply scroll down for download link and the instructions related to PHP installation & "activation").

[FUNCTIONALITY]

The functionality actually available(in the BETA stage) is above my objectives.
We have the possibility to host websites written in PHP;
Stream musics in-game;
Create UCP's which can have direct contact with the server(using API's, written in PHP as well);
And whatever you can do in the webpages.

More functionality will be added during time(hopefully), since I'm still "meeting" mongoose(The web server library I used in the project), and I'm not aware(yet) of it's "power".

[CONFIGURATION]

The following settings(optional) can be added in the server configuration file(server.cfg)
  • http_port xxxx -> Will determinate which port the web server will be listening for connections.

The default values of the settings above are the following
Setting
Default value
http_port
Will take the same port as the SA:MP Server


[DOWNLOAD]

You can find every release in the project github repository Link
The latest available version can be found here.
From the second release available in the repository, every bundle will have the cross-platform files.
So, inside the "plugins" directory, you will find sattp.so and sattp.dll, just to make things easier.

[ADITIONAL INFORMATION]

The plugin has been tested in the following operating systems:
  1. Windows 7 Ultimate SP1 x64(64 bits)
  2. CentOS 7

[SETTING UP PHP]
Well, setting up PHP ain't that hard.
I've configurated mongoose to automatically search for the PHP-CGI interpreter in a folder called "PHP"(you need to create it) on windows, or on /usr/bin/php-cgi on linux.
Linux servers with PHP installed will execute this plugin without any kind of issues.
However, just make sure php-cgi is installed.

On windows, you just need to download the PHP binaries from:
http://windows.php.net/download/
And download the "non thread safe" version.
Create an directory in your server folder with the name "PHP"
Extract the content of the downloaded zip file into the folder.

Turn on the SA:MP server, and the PHP will be available instantly.


[THANKS TO]
ZeeX - Since I'm using SAMPGDK in this project(it isn't required now, I'm aware of that, but it will be required in the future, hopefully)
Cesanta - For the embedded web server, mostly known as "mongoose" web server.

----
Please note that I've made this plugin just to add extra stuff to the SA:MP server, and offer more functionality when creating gamemodes.
I'm aware that most of the cases, this plugin isn't going to be helpful at all.

Thanks for reading.
GWMPT is offline   Reply With Quote
Old 09/04/2015, 11:56 PM   #2
Ahmad45123
Gangsta
 
Ahmad45123's Avatar
 
Join Date: Oct 2013
Location: Egypt
Posts: 838
Reputation: 184
Default Re: SATTP - SA:MP Embedded Web server

I can't get what does this do... Can you provide an example ?
__________________

ExtremeStudio

The Best SAMP IDE.
Ahmad45123 is offline   Reply With Quote
Old 10/04/2015, 12:26 AM   #3
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,147
Reputation: 169
Default Re: SATTP - SA:MP Embedded Web server

Quote:
Originally Posted by Ahmad45123 View Post
I can't get what does this do... Can you provide an example ?
These plugin is web server, just like apache (only its a plugin and depends on samp server...)
__________________
Путин here,
Путин there,
Путин просто everywhere.


Any PM's that include question about any kind of help will be ignored.
Use appropriate boards for that
DRIFT_HUNTER is offline   Reply With Quote
Old 10/04/2015, 12:36 AM   #4
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Russia
Posts: 3,352
Reputation: 822
Default Re: SATTP - SA:MP Embedded Web server

Or even in simpler language, you turn on the server with this plugin, and you can access your own website on the same ip&port as your samp server on.

web files are at the webmaster folder if I am not wrong.
__________________
Find me on GitHubSEF Community (Official NEF Successor) • SA:MP ReviewsFind me on Steam
Kaperstone is offline   Reply With Quote
Old 10/04/2015, 08:59 AM   #5
Mellnik
Gangsta
 
Mellnik's Avatar
 
Join Date: Dec 2011
Location: Paradise Falls, CAℕADA
Posts: 792
Reputation: 369
Default AW: SATTP - SA:MP Embedded Web server

Quote:
Originally Posted by GWMPT View Post
I'm aware that most of the cases, this plugin isn't going to be helpful at all.
I can only agree on that. Not hating but I can neither think of an usage for a production server.
Mellnik is offline   Reply With Quote
Old 10/04/2015, 09:08 AM   #6
GWMPT
High-roller
 
Join Date: Nov 2012
Location: Portugal.
Posts: 1,020
Reputation: 287
Default Re: AW: SATTP - SA:MP Embedded Web server

Quote:
Originally Posted by Mellnik View Post
I can only agree on that. Not hating but I can neither think of an usage for a production server.
Well, One of the usages you can give to this plugin is to have a remote administration panel.
However, since this plugin isn't running a embedded version of PHP, I'm not able to add functions.
So you would need to use the PHP RCON API(example) and do everything on your own.

Somehow, this plugin can be helpfull to stream musics and sounds ingame(if you're willing to), or have administration panels, to make the administration of your SA:MP server easier(this is, if you're willing to script)

However, since most of the servers are already with the gamemode done, and their administration system is already active, this plugin isn't going to help.


Quote:
Originally Posted by Ahmad45123 View Post
I can't get what does this do... Can you provide an example ?
Here is a screenshot of what it's supposed to do:
GWMPT is offline   Reply With Quote
Old 10/04/2015, 10:54 AM   #7
LazyB0y
Huge Clucker
 
LazyB0y's Avatar
 
Join Date: Feb 2014
Location: Pakistan
Posts: 281
Reputation: 15
Default Re: SATTP - SA:MP Embedded Web server

Nice work
__________________
LazyB0y is offline   Reply With Quote
Old 12/04/2015, 02:47 PM   #8
GM_KoDi
Gangsta
 
GM_KoDi's Avatar
 
Join Date: Oct 2012
Location: Planet Earth
Posts: 811
Reputation: 229
Default Re: SATTP - SA:MP Embedded Web server

Very nice, good job GWMPT
GM_KoDi is offline   Reply With Quote
Old 17/04/2015, 07:31 AM   #9
hamzajaved780
Big Clucker
 
hamzajaved780's Avatar
 
Join Date: Jan 2015
Location: Karachi
Posts: 174
Reputation: 14
Default Re: SATTP - SA:MP Embedded Web server

Good Job
__________________
hamzajaved780 is offline   Reply With Quote
Old 17/04/2015, 11:23 AM   #10
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,865
Reputation: 588
Default Re: SATTP - SA:MP Embedded Web server

NICE.

Now just let me run my control panel alongside my server so I can access it remotely.
*Leaves*
*Gets on iPad, goes to website*
Fuck, the server crashed! How am I supposed to start it back up?

In reality it's very easy to start it back up, I was just joking XD.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] SATTP - SA:MP Web Server GWMPT Lançamentos/Releases 21 09/04/2015 06:57 PM
[Projeto] SATTP - HTTP PLUGIN GWMPT Português/Portuguese 36 05/04/2015 09:09 PM
Embedded Colours! Chrillzen Scripting Help 3 07/11/2013 07:02 PM
Embedded colours Luis- Scripting Help 5 08/08/2012 05:13 PM
Embedded color healp Unknown123 Help Archive 3 23/04/2011 10:23 PM


All times are GMT. The time now is 02:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.