diff --git a/app/app.php b/DevAAC/DevAAC.php similarity index 98% rename from app/app.php rename to DevAAC/DevAAC.php index 979d1c7..ad47bfd 100644 --- a/app/app.php +++ b/DevAAC/DevAAC.php @@ -6,10 +6,10 @@ */ // Autoload our dependencies with Composer $loader = require '../vendor/autoload.php'; -$loader->setPsr4('App\\', APP_ROOT); +$loader->setPsr4('DevAAC\\', APP_ROOT); -use App\models\Player; -use App\models\Account; +use DevAAC\Models\Player; +use DevAAC\Models\Account; // Create Slim app $app = new \Slim\Slim(array( diff --git a/app/models/Account.php b/DevAAC/models/Account.php similarity index 88% rename from app/models/Account.php rename to DevAAC/models/Account.php index 45680f6..1df4432 100644 --- a/app/models/Account.php +++ b/DevAAC/models/Account.php @@ -4,7 +4,7 @@ * Date: 2/14/14 * Time: 1:33 AM */ -namespace App\models; +namespace DevAAC\Models; // https://github.com/illuminate/database/blob/master/Eloquent/Model.php // https://github.com/otland/forgottenserver/blob/master/schema.sql @@ -18,7 +18,7 @@ class Account extends \Illuminate\Database\Eloquent\Model { public function players() { - return $this->hasMany('App\models\Player'); + return $this->hasMany('DevAAC\Models\Player'); } public function setPasswordAttribute($pass) diff --git a/app/models/Player.php b/DevAAC/models/Player.php similarity index 97% rename from app/models/Player.php rename to DevAAC/models/Player.php index 556653a..826a26c 100644 --- a/app/models/Player.php +++ b/DevAAC/models/Player.php @@ -4,7 +4,7 @@ * Date: 2/14/14 * Time: 1:33 AM */ -namespace App\models; +namespace DevAAC\Models; /** * @SWG\Model() @@ -21,7 +21,7 @@ class Player extends \Illuminate\Database\Eloquent\Model { public function account() { - return $this->belongsTo('App\models\Account'); + return $this->belongsTo('DevAAC\Models\Account'); } public function setLevelAttribute($level) diff --git a/LICENSE b/LICENSE index fdd938f..66429d0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Daniel Speichert +Copyright (c) 2014 Daniel Speichert & Wojciech Guziak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index 1815d85..dc5e379 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -DUAAC +DevAAC ===== - -DU AAC for TFS 1.0 +DevAAC for TFS 1.0 by developers.pl This software is designed to: * be easy to understand and modify @@ -9,6 +8,7 @@ This software is designed to: * require zero configuration for simple and secure use * emphasize simplicity and security * follow [good practices of REST API](http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api) +* follow [PSR-2 coding guidelines](http://www.php-fig.org/psr/psr-2/) Requirements ===== @@ -25,3 +25,10 @@ Installation * Clone this repo * composer.phar install +Authors +===== +* Don Daniello +* mrwogu +* Znote + +Check [LICENSE](LICENSE). diff --git a/plugins/simple.php b/plugins/simple.php index bace99c..2c4349a 100644 --- a/plugins/simple.php +++ b/plugins/simple.php @@ -4,8 +4,8 @@ * Date: 2/15/14 * Time: 9:14 PM */ -use App\models\Account; -use App\models\Player; +use DevAAC\Models\Account; +use DevAAC\Models\Player; $app->map('/', function() use($app) { $view = $app->view(); @@ -92,13 +92,13 @@ goto render; // IF ACCOUNT DOES NOT EXIST, CREATE IT NOW - $account = App\models\Account::create( array('name' => $req->post('account-name'), + $account = DevAAC\Models\Account::create( array('name' => $req->post('account-name'), 'password' => $req->post('password'), 'email' => $req->post('email'), 'creation' => time()) ); createcharacter: - $player = new App\models\Player(); + $player = new DevAAC\Models\Player(); $player->account()->associate($account); $player->name = $name; $player->vocation = $req->post('vocation'); diff --git a/public_html/.htaccess b/public_html/.htaccess index cfe5910..401e8e4 100644 --- a/public_html/.htaccess +++ b/public_html/.htaccess @@ -1,4 +1,3 @@ RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^/duaac duaac.php [QSA,L] -RewriteRule ^ index.html [L] +RewriteRule ^/duaac index.php [QSA,L] diff --git a/public_html/angular/controllers.js b/public_html/controllers.js similarity index 100% rename from public_html/angular/controllers.js rename to public_html/controllers.js diff --git a/public_html/ember/app.js b/public_html/ember/app.js deleted file mode 100644 index bb382ea..0000000 --- a/public_html/ember/app.js +++ /dev/null @@ -1,113 +0,0 @@ -$(function(){ - App = Ember.Application.create(); - - App.Router.reopen({ - rootURL: '/', - location: 'history' - }); - - App.ApplicationAdapter = DS.RESTAdapter.extend({ - namespace: 'duaac' - }); - - App.Player = DS.Model.extend({ - name: DS.attr(), - sex: DS.attr(), - vocation: DS.attr(), - level: DS.attr(), - town_id: DS.attr(), - lastlogin: DS.attr(), - lastlogout: DS.attr(), - onlinetime: DS.attr() - }); - - // This bound to top-most application template - App.ApplicationController = Ember.Controller.extend({ - isAuth: false, - "footer-year": moment().format('YYYY'), - - login: function() { - //var btn = $('#loading-login-btn'); - $('#loading-login-btn').button('loading'); - - var request = $.post("/duaac/login", this.getProperties("name", "password")); - request.then(this.loginsuccess.bind(this), this.loginfailure.bind(this)); - }, - - loginsuccess: function(response) { - alert("Success server response: " + response.status); - $('#loading-login-btn').button('reset'); - this.set("isAuth", true); - }, - - loginfailure: function(response) { - alert("Failure server response: " + response.status); - $('#loading-login-btn').button('reset'); - this.set("isAuth", false); - } - }); - - App.Router.map(function() { - this.resource("account", function(){ - this.route("register", { path: "/register" }); - }); - }); - - - App.ApplicationRoute = Ember.Route.extend({ - setupController: function(controller) { - // Set the IndexController's `title` - controller.set('topCharacters', this.store.find('player')); - } - }); - - App.IndexRoute = Ember.Route.extend({ - setupController: function(controller) { - // Set the IndexController's `title` - controller.set('title', "My App"); - } - }); - - // player view - App.Router.map(function() { - this.resource("players", function(){ - this.route("view", { path: "/:id" }); - }); - }); - App.PlayersViewRoute = Ember.Route.extend({ - model: function(params) { - return this.store.find('player', params.id); - } - }); - - - // pages - App.Router.map(function() { - this.route("rules", { path: "/rules" }); - this.route("about", { path: "/about" }); - }); - - App.AboutRoute = Ember.Route.extend({ - setupController: function(controller) { - // Set the IndexController's `title` - controller.set('title', "My App"); - } - }); - - - // no purpose yet - App.PlayerController = Ember.ObjectController.extend({ - - }); - - // catch all - App.Router.map(function() { - this.route('catchAll', { path: '*:' }); - }); - - App.CatchAllRoute = Ember.Route.extend({ - redirect: function() { - this.transitionTo('index'); - } - }); -}); \ No newline at end of file diff --git a/public_html/ember/index.html b/public_html/ember/index.html deleted file mode 100644 index ea6fc36..0000000 --- a/public_html/ember/index.html +++ /dev/null @@ -1,246 +0,0 @@ - - -
- - - - - -