Compact Login System is a UE4 plugin that provides the ability to login a web server with json. The plugin also provides the php code running in a web server using the sqlite database.
Compact Login System is a simple plugin to setup a login system with web server. The plugin also provides the php code running in web server, including authorization code generation, compact user database(sqlite database). After you set up your own server and put the php code into web root folder, you will be able to use this comapct login system. As the comapct login system just contains limited user registration information, you may need to extend this part according to your own requirement in practice.
Following blew steps, you will use this tool quickly.
First, you should setup your own web server.
For local test server, you can use WampServer or PhpStudy, which is quite easy to use.
Put the php code into your web root folder.
The php code is in the Content folder of Compact Login System plugin.
You should create an actor, derived from class ACompactLoginSystemMgr, and drag the actor into your level.
The example is given in folder Blueprints of the demo project.
You should set the ServerAddress to your own address in the blueprint BP_Login_UI and BP_Register_UI.
Notice that you can customize your json content that would be sent to web server, and parse value from responsed json by key name.
By the way, if you change the key names in the blueprints, you should modify the key names in php code as well.
Finally, you can test your demo as follow.
For registration, if you haven’t setup a mail server yet, you can click “Get test authorization code” to get a test authorization code.
The demo has been tested in a linux server, the steps to setup a linux server are given below.
Modify privilege:
Modify the content in lighttpd.conf as follow.
var.log_root = "/home/lighttpd/log"
var.server_root = "/home/lighttpd"
var.state_dir = "/home/lighttpd"
var.home_dir = "/home/lighttpd"
var.conf_dir = "/etc/lighttpd"
debug.log-request-handling = "enable"
var.cache_dir = "/home/lighttpd/cache"
server.use-ipv6 = "disable"
server.username = "lighttpd"
server.groupname = "lighttpd"
server.document-root = server_root + "/wwwroot"
#server.tag = "lighttpd"
#server.pid-file = state_dir + "/lighttpd.pid"
server.errorlog = log_root + "/error.log"
#include "conf.d/access_log.conf"
#include "conf.d/debug.conf"
#server.network-backend = "linux-sendfile"
#$HTTP["url"] =~ "\.pdf$" {
# server.range-requests = "disable"
#}
server.upload-dirs = ( "/home/lighttpd/tmp" )
extension=pdo.so
extension=pdo_sqlite.so
extension=pdo_mysql.so
extension=sqlite.so
Delete ‘#’ in the below line:
#include fastcgi.conf
fastcgi.server = ( ".php" =>
( "php-local" =>
(
"socket" => "/tmp/php-fastcgi-1.socket",
"bin-path" => "/usr/bin/php-cgi",
"max-procs" => 1,
"broken-scriptfilename" => "enable",
),
"php-tcp" =>
(
"host" => "127.0.0.1",
"port" => 9999,
"check-local" => "disable",
"broken-scriptfilename" => "enable",
),
"php-num-procs" =>
(
"socket" => "/tmp/php-fastcgi-2.socket",
"bin-path" => "/usr/bin/php-cgi",
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "16",
"PHP_FCGI_MAX_REQUESTS" => "10000",
),
"max-procs" => 5,
"broken-scriptfilename" => "enable",
),
),
)
Start server with command:
Close server with command:
Create index.html with following content:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Page</title>
</head>
<body>
<p>Hellow world</p>
<hr>
<p>Test</p>
</body>
</html>
Enter your server address in the Chrome to visit your page.
You can setup your own mail server or use the existing production, such as Mailgun.
Here, we use mailgun server to send email and you can register in the Mailgun Page
Setup your mailx in linux with command:
Add following content in mail.rc:
vi /etc/mail.rc
set from=from@gmail.com
set smtp=smtp.mailgun.org
set smtp-auth-user=postmaster@your_domain_name
set smtp-auth-password=*****
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/root/.certs
Test using following command:
Enter DB:
sqlite3 dbname
Show table content:
.header on
.mode column
select * from “tablename”;
In the event you are unable to find the information you seek, feel free to contact easycomplex.tech@gmail.com.
[2] UE4 Marketplace