hi there this tutorial is about making a photon HWID whitelist, it will work as BackEnd, and this method won’t leak any registered user into any client that trying to connect it’s not like a stupid hwid whitelist with txt file, this one we will using Php, MySQL, and C#, the Php and MySQL will be on our server, and the front-end of course the C# code, there not really much C# coding we will need since this one will be connected with our photon appid and not a client side thing, so AppId stealer can’t really do anything with our appid, first of all you will need a website hosting that is using cPanel, and you need to create one Database and one user for the database.
php script to connect to database
new mysqli(yourserver-address, dbusername, dbpassword, dbname);
don’t forget to change yourserver-address to your own server, it usually localhost if you host the database and your website at the same server, also change the dbusername to your own username to connect to the database if you have a full hosting it usually root is the default username and pass, and the dbname is your database name.
now you only have to bind your database, for example you have a database called whitelist, and inside the database there’s HWID table, so you will need to bind your HWID table
for example bind_param("s", $_GET['HWID']
the type is “s” because corresponding variable has type string, if it’s an integer it will be i just like that, the $_GET[‘HWID’] we will fetch the HWID that the user send to the server authentication
now we need to tell photon if the HWID Exists in our database table or not is just by using num_rows method but before we write it we need to refrence the mysql that we write at the first for
example like this
$connection = new mysqli(yourserver-address, dbusername, dbpassword, dbname);
so when we check if the HWID Exists on our whitelist table or not we will need to do something like this $result = $connection->get_result(); and then
if ($result->num_rows !== 1) { $JsonArr = array("ResultCode"=>2, "Message" => "HWID NOT FOUND"); echo json_encode($JsonArr); }
Photon will always look at ResultCode, if it’s 2 then it’s failed to authenticate, and if it’s 1 it successfully authenticated
if ($result->num_rows === 1) { $JsonArr = array("ResultCode"=>1, "Message" => "Authenticate"); echo json_encode($JsonArr); }
if the result code is 2 then photon will refuse to connect and if it’s 1 photon will accept the connection
Just like that, also i didn’t write all of the source code because you will also need to learn it by yourself, don’t just copy and paste the code, it’s bad
thanks for reading my post, if you have any questions just drop a reply or pm me on this site, one more thing, you will also need to write your authentication php script link address to your photon app id, go to your photonengine dashboard and click manage, and scroll down and add custom authentication then put your authentication php script there, also in the front end you will also need to create your Photon AuthValue, maybe you can find it in photon docs, or if it’s confusing, you can ask me too, i’ll be happy to help you.