[REQUEST] Archlord database explanation

03/02/2014 13:17 mlukac89#1
I will make CMS for Archlord so everyone who will need website for hes private server he just need to install it, so users will be able to register, login, change password, email .... admin panel where admin can controll users, posts, events, etc...

But before all that i need to know is all servers ep1 and ep2 use same database and what type is ?
03/02/2014 13:19 al3css#2
same oracle 9i db...
03/02/2014 13:23 mlukac89#3
can i setup it in phpmyadmin on localhost then, because i use mysql on localhost ?
03/02/2014 13:28 al3css#4
nope...instal oracle 9i or oracle 11g or 10g and you need to use the archlord serverfiles/to make a test serverfiles in order to work with it
03/03/2014 01:05 patkica#5
If would want to make myself a webpage using xampp I would use mysql database for ID and PW and other stuff like CC and crap for webpage only. Then i would install instantclient 12.1 for oracle. With PHP you are then able to connect to remote computer that host archlord server.

During register process your PHP script can access archlord oracle database on remote computer to create new/edit account. This way you give your users indirect access to gameserver database. Imo this almost eliminates violation of games database as you can check data from mysql before you access and change oracle database and you seperate forums, chantra store and other stuff to another computer decreasing database lag to high populated servers.

This is how i would do it. If you need webpage on same computer as gameserver is then you dont need instantclient 12.1 you only need to connect to oracle and know how to use oracle database queries...
03/03/2014 10:02 mlukac89#6
Why complicate thing when it can be simple

i think something like this
its counting how many accounts is registered and can be visible only to admin

Code:
 
$query = $users->db->prepare("SELECT COUNT(*) FROM AMT_ACCOUNT");
$query->execute();
return $query->fetchColumn();
counts how many guilds is registered

Code:
$query = $guilds->db->prepare("SELECT COUNT(*) FROM GUILDMASTER");
$query->execute();
return $query->fetchColumn();
and for user login

Code:
$query = $users->db->prepare("SELECT COUNT(*) FROM AMT_ACCOUNT WHERE ACCOUNTID=? AND PASSWORD=?");
$query->bindValue(1, $username);
$query->bindValue(2, $password);
$query->execute();
$data = $query->fetch();
return $data['ACCOUNTID'];
So you can acess database directly with PDO its secure, and dont need other stuff, you get it now :P ?

So i need stuff like this AMT_ACCOUNT and what fields are in, and other stuff i can insert, update or delete data from
03/03/2014 11:12 patkica#7
Ye thats all fine I supposed if you run webpage on same computer as gameserver is. I would not recomend that but hey tis your project :p

If you dont intend to have webserver on same computer then to avoid installing oracle you can only install client.I was thinking something like this...
Making database class than connect to database and keep connection open for quick access.
Code:
include("constants.php");
class MyDB
{
   /* Class constructor */
   function MyDB(){
      /* Make connection to database */
	/*  oracle database connection defined in contants.php  
	define("OCI_SERVER", "192.168.1.12");
	define("OCI_USER", "alef");
	define("OCI_PASS", "password");
	define("OCI_SERVICE", "account");
        define("SRV_WORLD", "MYworld1");  
	*/
	$this->connection2 = oci_connect(OCI_USER,OCI_PASS,OCI_SERVER ."/". OCI_SERVICE);
	if (!$this->connection2) {
		$e = oci_error();
	        trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
	}
    }

	function oci_addNewUser($username, $password, $email){
		$time = date("d/m/y");
		$qstring = array();
		$qstring[0] = "INSERT INTO AMT_ACCOUNT (ACCOUNTID,PASSWORD) VALUES ('$username','$password')";
		$qstring[1] = "INSERT INTO AMT_MASTER VALUES ('$username' ,'$email' ,'18' ,to_timestamp('$time','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('$time','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('$time','DD/MM/RR HH24:MI:SSXFF') ,null ,null ,null ,null ,null ,'N' ,'N' ,'0', null, null, null, null, null, null, null, null)";
		$qstring[2] = "INSERT INTO ACCOUNTWORLD (ACCOUNTID, WORLD, BANKMONEY, BANKSIZE) VALUES ('$username', '".SRV_WORLD."', '0', '0')";
		
		for ($i=0; $i<3; $i++){
				$q = oci_parse($this->connection2, $qstring[$i]);
				oci_execute($q);
		}
	}
};
$database = new MyDB;
Then you can register new players with
$database->oci_addNewUser($arg1, $arg2, $arg3);