EQEmulator : MiniLogin

HomePage :: Categories :: Index :: RecentChanges :: Login/Register :: Search
MiniLogin is a login server that allows localized play as well as connections from the internet. Minilogin utilizes the same code as the LoginServer but without the crypto, so passwords for accounts will be disabled. Instead of checking for passwords, Minilogin will connect to your database and check the IP under the requested account name in the database with the IP of the person trying to connect. If they match, it will grant access through. If they do not, they will be refused. Because of this, Minilogin is only best used for lan networks and not for public use. For public loginservers, use the official LoginServer.

How to make a secure Minilogin with public access
First of all, you will need access to an active web server with php enabled, together with your emulator and MySql database. What the php script will do is, go into the "account" table of your emulator database, place a new username (or alter the ip of an older account) and password. any changes done by this script will not affect any given accounts abilty to go back and use the public log in server. You will have a password stored on your database together with the players ip, so no one else (from another ip) can use it. If the players IP changes, he only needs to login/run this script and set in his new ip.
This is what i use for my "public" Minilogin server, and was developed by Aerewen;
index.php
<?php
/*******************************************
*	   Aerewen's Uber Fake Pub Server      *
*         Why? Because we can :oD          *
********************************************

I will be providing no support for this utility as it
was originally created for use on my server only, but I
wanted everyone else to be able to share their  servers
with friends in an easy-to-use manner. This tool will
prevent you from having to manually update the database
account table.

Put this page on your site after setting the variables below to
the information of the MySQL database with the  info in it.
*/
$DB_ADDY = "localhost"; //address:port for the MySQL server
$DB_USER = "eq"; //username to login to MySQL with
$DB_PASS = "eq"; //password to login to MySQL with
$DB_DB = "ax_classic"; //database name to use "ax_peq" for default installation

$server_name = "Angelox Classic Challenge"; //set the name of your server here
$admin_level = 0; //default level of admin to give to people who sign up
//This WILL NOT modify admin of people logging in to the server.

/*
Have your friends access this page on the webserver, enter a 
username/password to create an account, and click Login/Create.
This will create their account with the level of access specified
in $admin_level. It will then detect the IP address they accessed
the page from, and update the account table with that IP.

Before connecting to your database server, you should always have people
login from this page to update their IP if needed.
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $server_name; ?> AX_PEQ Server Authentication</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #CCCCCC;
}
body {
	background-color: #000000;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {font-size: 9px}
.formelements {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	line-height: normal;
	font-weight: normal;
	font-variant: normal;
	color: #FFFFFF;
	background-color: #333333;
	border: thin solid #666666;
}
a {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #CCCCCC;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #CCCCCC;
}
a:hover {
	text-decoration: underline;
	color: #CCCCCC;
}
a:active {
	text-decoration: none;
	color: #CCCCCC;
}
.style4 {font-size: 10px}
-->
</style>
</head>
<br>
<br>
<br>
<div style="text-align: center;"><span
 style="color: rgb(102, 0, 204);"><span
 style="color: rgb(0, 0, 0);"><big><big><span
 style="font-weight: bold; color: rgb(255, 255, 255);">Angelox
Classic Server</span><br
 style="font-weight: bold; color: rgb(255, 255, 255);">
	  <span style="font-weight: bold;"><span
 style="color: rgb(255, 255, 255);">Everquest: THE LEGACY</span><br>
<br>
<br>
<br>

<body>
<div align="center"><?php
if(!isset($_POST['Submit'])){
?>
  <form id="form1" name="form1" method="post" action="index.php">
	<table width="500" border="0" cellspacing="0" cellpadding="0">
	  <tr>
	    <td width="174" align="right" valign="top"><div align="right">Username:&nbsp;&nbsp;</div></td>
	    <td width="326" align="left" valign="top"><input name="username" type="text" class="formelements" id="username" size="40" maxlength="9" />
	    <br />
	    <span class="style1">*must be 9 characters or less</span> </td>
	  </tr>
	  <tr>
	    <td align="right" valign="top"><div align="right">Password:&nbsp;&nbsp;</div></td>
	    <td align="left" valign="top"><input name="password" type="password" class="formelements" id="password" size="40" maxlength="9" />
	      <br />
	      <span class="style1">*must be 9 characters or less</span></td>
	  </tr>
	  <tr>
	    <td colspan="2" align="center" valign="top"><input name="Submit" type="submit" class="formelements" value="Login/Create" />&nbsp;&nbsp;&nbsp;<input name="Reset" type="reset" class="formelements" value="Clear" /></td>
	  </tr>
	</table>
  </form>
<?php
} else {
	//set font color
	$link = mysql_connect($DB_ADDY,$DB_USER,$DB_PASS);
	mysql_select_db($DB_DB,$link);
	$sql = "SELECT * FROM `account` WHERE `name` = '". $_POST['username']. "'";
	$res = mysql_query($sql,$link);
	if(mysql_num_rows($res) != 0){
		//username was found
		$info = mysql_fetch_assoc($res);
		if($info['password'] == $_POST['password']){
			//password matches
			if($_SERVER['REMOTE_ADDR'] != $info['minilogin_ip']){
				//ip address has changed
				$sql = "UPDATE `account` SET `minilogin_ip` = '". $_SERVER['REMOTE_ADDR']. "' WHERE `name` = '". $_POST['username']. "' AND `password` = '". $_POST['password']. "'";
				$sql2 = "UPDATE `account` SET `minilogin_ip` = '0.0.0.0' WHERE `minilogin_ip` = '". $_SERVER['REMOTE_ADDR']. "'";
				if(($res = mysql_query($sql2,$link)) && mysql_query($sql,$link)){
					echo '<font color="#00FF00">';
					echo 'Your IP address was successfully updated. You may now start EverQuest Titanium Edition and log in to the server.';
					echo '</font>';
				} else {
					echo '<font color="#FF0000">';
					echo 'There was an error updating your IP address. Please try again later or contact an admin for assistance.';
					echo '</font>';
				}
			} else {
				//ip didnt change
				echo '<font color="#00FF00">';
				echo 'Your IP address has not changed. You may now start EverQuest Titanium Edition and log in to the server.';
				echo '</font>';
			}
		} else {
			//password was wrong
			echo '<font color="#FF0000">';
			echo 'The username: '. $_POST['username']. '<br />Already exists in our database, and the password<br />you entered for it was incorrect.<br />';
			echo 'If this is your account, please <a href="index.php">go back</a>, re-enter your password, and try again.<br />';
			echo 'If you were attempting to create a new account, please try a different user name.';
			echo '</font>';
		}
	} else {
		//username was not found create it now
		$newno = "SELECT `id` FROM `account` ORDER BY `id` DESC LIMIT 1";
		$res = mysql_query($newno,$link);
		$newno = mysql_fetch_assoc($res);
		$newno = ($newno['id'] + 1);
		$sql = "INSERT INTO `account` VALUES (". $newno. ",'". $_POST['username']. "','',0,'". $_POST['password']. "',". $admin_level. ",". $newno. ",0,0,'". $_SERVER['REMOTE_ADDR']. "',0,0)";
		$sql2 = "UPDATE `account` SET `minilogin_ip` = '0.0.0.0' WHERE `minilogin_ip` = '". $_SERVER['REMOTE_ADDR']. "'";
		if(($res = mysql_query($sql2,$link)) && mysql_query($sql,$link)){
			echo '<font color="#00FF00">';
			echo 'New account created successfully. You may now start EverQuest Titanium Edition and log in to the server using:<br />';
			echo 'Username: '. $_POST['username']. '<br />Password: '. $_POST['password']. '<br />*username and password are case sensitive!';
			echo '</font>';
		} else {
			echo '<font color="#FF0000">';
			echo 'There was an error while trying to create your account. Please try again later.';
			echo '</font>';
		}
	}
}
?><br /><br />
<html>
<head>
</head>
<body style="background-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"
 alink="#ee0000" link="#0000ee" vlink="#551a8b">
<br>
<small><small style="color: rgb(255, 255, 255);">Before
logging in to our server, please make sure you have downloaded the
eqhost.txt and copied it into your EverQuest directory. For a new copy
of eqhost.txt, right-click<a href="eqhost.txt">  <span
 style="text-decoration: underline; color: rgb(255, 255, 102);">This
Link</span></a>
and
choose "Save Target As".This file will replace the existing one in your
EverQuest directory, which defaults to: C:\Program Files\Sony\EverQuest\<br>
If you need any assistance, please contact an admin.<br>
All content is protected under the GPL. Scripts are &copy;2007
Icesnake Web Solutions, LLC</small></small>
</body>
</html>


You can use this script, edit content and customize to fit your server (the above script has been customized by me, so as to fit my server needs).
Very useful if you are trying to get your friends to play on your server or just want to feel like your efforts have meaning :) ,or not have to tread through the gigantic list of public servers to find you.
Page was generated in 0.1046 seconds