Jump to content
MakeWebGames

MY Engine


Danny696

Recommended Posts

Hey guys, long time no post, as I dont develop anymore, and am in the process of getting rid of this laptop, I saw my old engine that I developed, and decided to release it to you, now I am 99% sure that the php side of the engine will work out of the box. There is just one problem, about an hour ago I *may* have removed WampSever, and the SQL file along with it to go to the engine.

I personally dont have the time to go through the files and work out what is needed, but I'm confident if you know what you're doing and want to use this, it should take 10 minutes to work it all out and/or im sure errors will as well.

Just a quick note as well, there is a verify feature, whereas a user that is signed in but hasnt been active for 15 minutes will be required to enter their password again, so is much simpler than signing in again which can be a pain for the user.

Just a few things to note that was not noted anywhere in the code I believe;

(First two need to be added before system.php is added)

Only needed columns from the users table is pulled, any extra columns can be pulled from the database via this method;

define('EXTRAUSERS', ', `nameofcolumn`');

The title of each page is defined by this at the start of each page:

define('title', 'Page Name');

'system.php' is the system file required by each page.

All variables are pulled into the system via an ?object? method. To use a players username would be $user->username

The game settings (e.g. game name) is pulled via an array so is used like the following... e.g. $setting['name']

$db is the database accessor, for querys there are two methods,

$db->execute('query') - used throughout the engine

$db->query('query') - redirects to the above

And will both pull the results into an object to be used such as $var->val

To end each page with a footer, the page must end with

$template->endtemplate();

If I had the time I would go through and make an attempt to re-make the SQL file, and I am sorry about that.

Any questions just inbox me and if I can I will be happy to help.

P.S please dont moan about coding style or out of date methods, this was done a long time ago and was part way through re-coding it all.

Thanks Danny696

Long time love for you all :)

Engine.zip

Link to comment
Share on other sites

Btw: This isn't a ENGINE, looks more like a game. With a Engine you can create for example Text based browser games or 3D shooters.

This is already a game, with items like: Jail, bank, hospital.... lillte bit clueless what it al does.

But coding is clear enough to understand what your doing.

So far i have: (USERNAME = "admin", PASSWORD="test")

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;

SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

DROP SCHEMA IF EXISTS `engine` ;

CREATE SCHEMA IF NOT EXISTS `engine` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;

USE `engine` ;

-- -----------------------------------------------------

-- Table `engine`.`users`

-- -----------------------------------------------------

DROP TABLE IF EXISTS `engine`.`users` ;

CREATE TABLE IF NOT EXISTS `engine`.`users` (

`userid` INT NOT NULL AUTO_INCREMENT,

`username` VARCHAR(45) NOT NULL,

`password` VARCHAR(200) NOT NULL,

`salt` VARCHAR(45) NOT NULL,

`laston` TIMESTAMP NULL,

`last_login` TIMESTAMP NULL,

`last_ip` VARCHAR(20) NULL,

`level` VARCHAR(45) NULL,

`access` VARCHAR(45) NULL,

`money` VARCHAR(45) NULL,

`tokens` VARCHAR(45) NULL,

`messages` VARCHAR(45) NULL,

`logs` VARCHAR(45) NULL,

`bulletins` VARCHAR(45) NULL,

`work` VARCHAR(45) NULL,

`bank` VARCHAR(45) NULL,

`jail` TIMESTAMP NULL,

`hospital` TIMESTAMP NULL,

PRIMARY KEY (`userid`))

ENGINE = InnoDB;

 

-- -----------------------------------------------------

-- Table `engine`.`email`

-- -----------------------------------------------------

DROP TABLE IF EXISTS `engine`.`email` ;

CREATE TABLE IF NOT EXISTS `engine`.`email` (

`emailid` INT NOT NULL,

`userid` INT NOT NULL,

`email` VARCHAR(45) NULL,

PRIMARY KEY (`emailid`))

ENGINE = InnoDB;

 

-- -----------------------------------------------------

-- Table `engine`.`user_bars`

-- -----------------------------------------------------

DROP TABLE IF EXISTS `engine`.`user_bars` ;

CREATE TABLE IF NOT EXISTS `engine`.`user_bars` (

`user_barsid` INT NOT NULL,

`userid` INT NOT NULL,

`energy` INT NULL,

`maxenergy` INT NULL,

`audacity` INT NULL,

`maxaudacity` INT NULL,

`health` INT NULL,

`maxhealth` INT NULL,

`exp` INT NULL,

`maxexp` INT NULL,

PRIMARY KEY (`user_barsid`))

ENGINE = InnoDB;

 

-- -----------------------------------------------------

-- Table `engine`.`logs`

-- -----------------------------------------------------

DROP TABLE IF EXISTS `engine`.`logs` ;

CREATE TABLE IF NOT EXISTS `engine`.`logs` (

`logpk` INT NOT NULL AUTO_INCREMENT,

`number` INT NULL,

`text` VARCHAR(45) NULL,

`param1` INT NULL,

`param2` INT NULL,

`param3` INT NULL,

`parm4` INT NULL,

PRIMARY KEY (`logpk`))

ENGINE = InnoDB;

 

SET SQL_MODE=@OLD_SQL_MODE;

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

-- -----------------------------------------------------

-- Data for table `engine`.`users`

-- -----------------------------------------------------

START TRANSACTION;

USE `engine`;

INSERT INTO `engine`.`users` (`userid`, `username`, `password`, `salt`, `laston`, `last_login`, `last_ip`, `level`, `access`, `money`, `tokens`, `messages`, `logs`, `bulletins`, `work`, `bank`, `jail`, `hospital`) VALUES (-1, 'admin', '1c26a6623465391145025d5d79c717d82511a88cabe3239a38f5a4959731fc1a5b02a93b003f82899dfdee7d34588c0fc8627a2ebf021693b9110469654830ef', '1234', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

COMMIT;

 

-- -----------------------------------------------------

-- Data for table `engine`.`email`

-- -----------------------------------------------------

START TRANSACTION;

USE `engine`;

INSERT INTO `engine`.`email` (`emailid`, `userid`, `email`) VALUES (-1, -1, '[email protected]');

COMMIT;

 

-- -----------------------------------------------------

-- Data for table `engine`.`user_bars`

-- -----------------------------------------------------

START TRANSACTION;

USE `engine`;

INSERT INTO `engine`.`user_bars` (`user_barsid`, `userid`, `energy`, `maxenergy`, `audacity`, `maxaudacity`, `health`, `maxhealth`, `exp`, `maxexp`) VALUES (-1, -1, 5, 5, 5, 5, 5, 5, 5, 5);

COMMIT;

Link to comment
Share on other sites

Yep, works... Only not loging in chrome.

Can login with debugging in Zend studio (i think he will use a old internet exploder).

 

Welcome back Admin.

The last time we saw you was on 1 January, 1970, 1:00:00 am

Engine news. Last 5 logs

No news as of yet. Event

Unknown column 'log' in 'field list'

 

DB: http://rogerkeulen.nl/engine.mwb <-- MySQL workbench [http://dev.mysql.com/downloads/tools/workbench/].

 

Happy Hacking: Roger

Link to comment
Share on other sites

@Danny696: Restyled your password class a bit....

 

<?php
class password {
 public static function createSalt($length = 20) {
   $charactersUsed = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
   $salt = ''; for($i = 0; $i < $length; $i++) { $salt .= substr($charactersUsed, mt_rand(0, strlen($charactersUsed)-1), 1); }
   return $salt;
 }
 public static function createHash($username, $password, $salt) {
   $uniqueHash = hash('sha256','<<< please put something here unique here, like your hostname url >>>'.$password.$username.$salt);
   $hashStrong = ''; for($i = 0; $i < 10; $i++)  { $hashStrong.=hash('sha256',$hashStrong.$uniqueHash); }
   $hashResult = ''; for($i = 0; $i < 500; $i++) { $hashResult=hash('sha256',$hashStrong.$hashResult); }
   return $hashResult;
 }
}
?>

 

Thanx for sharing, dude !

 

Happy Hacking: Roger.

Edited by Lucifer.iix
Link to comment
Share on other sites

Hey guys, yeah was sad to go, i just didnt wake up and think 'What am i going to develop today' so didnt do it for a while then just left it, enjoyed it a lot while i did it though, nice to see people providing for the community with regards to the SQL.

Yeah it is more of a game but i tired to make it so a game could be opened with this but not so many features that all games would be the same or removal of pages mean that features dont work.

This did take a while to make and i thought you may be able to use it better than me and would be a waste to see it go. Was due to be re-coded as stated so good to see it isnt to bad and you can see what is going on.

That password was only used for an old server so its fine.

Link to comment
Share on other sites

Hey guys, yeah was sad to go, i just didnt wake up and think 'What am i going to develop today' so didnt do it for a while then just left it, enjoyed it a lot while i did it though, nice to see people providing for the community with regards to the SQL.

Yeah it is more of a game but i tired to make it so a game could be opened with this but not so many features that all games would be the same or removal of pages mean that features dont work.

This did take a while to make and i thought you may be able to use it better than me and would be a waste to see it go. Was due to be re-coded as stated so good to see it isnt to bad and you can see what is going on.

That password was only used for an old server so its fine.

Off topic but did you (a long time ago) own a game called graveyardmadness?

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
Can you give me install.php?

Funny story about the install.php, hope you can all have a good laugh at it...

Took about 2-3 days making an installer, looked really good and worked perfectly, at the end when it was all done, I wanted to delete the file so added the correct code, went to check it and ran the installer. It deleted it self, and I hadn't made a backup.....

Yeah it's not really an engine, but it is a very basic game, like you couldn't run this without some big addons towards it, so maybe it is more of an engine that it isn't...

Link to comment
Share on other sites

Funny story about the install.php, hope you can all have a good laugh at it...

Took about 2-3 days making an installer, looked really good and worked perfectly, at the end when it was all done, I wanted to delete the file so added the correct code, went to check it and ran the installer. It deleted it self, and I hadn't made a backup.....

Yeah it's not really an engine, but it is a very basic game, like you couldn't run this without some big addons towards it, so maybe it is more of an engine that it isn't...

..there's still hope. Press CTRL+V.

Did it work?

You're welcome.

Link to comment
Share on other sites

  • 3 months later...
But do you have sql file?

He already answered you before.

Try this:

 

Btw: This isn't a ENGINE, looks more like a game. With a Engine you can create for example Text based browser games or 3D shooters.

This is already a game, with items like: Jail, bank, hospital.... lillte bit clueless what it al does.

But coding is clear enough to understand what your doing.

So far i have:

 (USERNAME = "admin", PASSWORD="test")

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

DROP SCHEMA IF EXISTS `engine` ;
CREATE SCHEMA IF NOT EXISTS `engine` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `engine` ;

-- -----------------------------------------------------
-- Table `engine`.`users`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `engine`.`users` ;

CREATE TABLE IF NOT EXISTS `engine`.`users` (
 `userid` INT NOT NULL AUTO_INCREMENT,
 `username` VARCHAR(45) NOT NULL,
 `password` VARCHAR(200) NOT NULL,
 `salt` VARCHAR(45) NOT NULL,
 `laston` TIMESTAMP NULL,
 `last_login` TIMESTAMP NULL,
 `last_ip` VARCHAR(20) NULL,
 `level` VARCHAR(45) NULL,
 `access` VARCHAR(45) NULL,
 `money` VARCHAR(45) NULL,
 `tokens` VARCHAR(45) NULL,
 `messages` VARCHAR(45) NULL,
 `logs` VARCHAR(45) NULL,
 `bulletins` VARCHAR(45) NULL,
 `work` VARCHAR(45) NULL,
 `bank` VARCHAR(45) NULL,
 `jail` TIMESTAMP NULL,
 `hospital` TIMESTAMP NULL,
 PRIMARY KEY (`userid`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `engine`.`email`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `engine`.`email` ;

CREATE TABLE IF NOT EXISTS `engine`.`email` (
 `emailid` INT NOT NULL,
 `userid` INT NOT NULL,
 `email` VARCHAR(45) NULL,
 PRIMARY KEY (`emailid`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `engine`.`user_bars`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `engine`.`user_bars` ;

CREATE TABLE IF NOT EXISTS `engine`.`user_bars` (
 `user_barsid` INT NOT NULL,
 `userid` INT NOT NULL,
 `energy` INT NULL,
 `maxenergy` INT NULL,
 `audacity` INT NULL,
 `maxaudacity` INT NULL,
 `health` INT NULL,
 `maxhealth` INT NULL,
 `exp` INT NULL,
 `maxexp` INT NULL,
 PRIMARY KEY (`user_barsid`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `engine`.`logs`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `engine`.`logs` ;

CREATE TABLE IF NOT EXISTS `engine`.`logs` (
 `logpk` INT NOT NULL AUTO_INCREMENT,
 `number` INT NULL,
 `text` VARCHAR(45) NULL,
 `param1` INT NULL,
 `param2` INT NULL,
 `param3` INT NULL,
 `parm4` INT NULL,
 PRIMARY KEY (`logpk`))
ENGINE = InnoDB;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

-- -----------------------------------------------------
-- Data for table `engine`.`users`
-- -----------------------------------------------------
START TRANSACTION;
USE `engine`;
INSERT INTO `engine`.`users` (`userid`, `username`, `password`, `salt`, `laston`, `last_login`, `last_ip`, `level`, `access`, `money`, `tokens`, `messages`, `logs`, `bulletins`, `work`, `bank`, `jail`, `hospital`) VALUES (-1, 'admin', '1c26a6623465391145025d5d79c717d82511a88cabe3239a38f5a4959731fc1a5b02a93b003f82899dfdee7d34588c0fc8627a2ebf021693b9110469654830ef', '1234', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

COMMIT;


-- -----------------------------------------------------
-- Data for table `engine`.`email`
-- -----------------------------------------------------
START TRANSACTION;
USE `engine`;
INSERT INTO `engine`.`email` (`emailid`, `userid`, `email`) VALUES (-1, -1, '[email protected]');

COMMIT;


-- -----------------------------------------------------
-- Data for table `engine`.`user_bars`
-- -----------------------------------------------------
START TRANSACTION;
USE `engine`;
INSERT INTO `engine`.`user_bars` (`user_barsid`, `userid`, `energy`, `maxenergy`, `audacity`, `maxaudacity`, `health`, `maxhealth`, `exp`, `maxexp`) VALUES (-1, -1, 5, 5, 5, 5, 5, 5, 5, 5);

COMMIT;
Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...