• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

pandaac: The Resurrection

Thank you Chris!

Do you by any chanse happen to have a House page for the Pandaac?
Doesn't have to be a auction page, could just be a simple page that displays all houses and the owners.

Also, how is it going with your updated version of the complete AAC?

No, there is no house page that is officially created for pandaac right now.
 
In your app/routes.php, add the following.
Code:
Route::post('account/character/create', 'AccountController@processCharacterCreation');

Then create a new file called AccountController.php in app/controllers with this in it:
Code:
<?php

class AccountController extends Controller {

    /**
    * Creating a new character on an account.
    *
    * @route  POST /account/character/create
    * @return \Redirect
    */
    public function processCharacterCreation()
    {
        $rules = Config::get('distro::validation.player.create');


        // If no vocation has been selected, or no options were provided to the user,
        // we want to default it to 0 (no vocation). 

        if ( ! Input::has('vocation') or ! Config::get('pandaac::app.vocations'))
        {
            Input::merge(['vocation' => 0]);

            $rules = array_except($rules, 'vocation');
        }


        // If no town has been selected, or no options were provided to the user,
        // we want to default it to 1 (usually rookgaard). 

        if ( ! Input::has('town') or ! Config::get('pandaac::app.towns'))
        {
            Input::merge(['town' => 1]);

            $rules = array_except($rules, 'town');
        }


        // Let us validate the user input by the rules defined by the active
        // distrobution package. These rules are commonly declared within the
        // validation.php config file of said package. You can alter them by 
        // publishing the config files through Artisan.

        $validator = Validator::make(Input::all(), $rules);

        if ($validator->fails())
        {
            return Redirect::back()->withErrors($validator)->withInput();
        }

       
        // Once the validation passes through the aforementioned rules, we will then
        // verify that the current account contains less than 20 characters. If that is
        // not the case however, the user will be shown yet another error message.

        if (Auth::user()->players->count() >= 1)
        {
            $messages = $validator->errors()->add('name', 'You may not have more than 1 character on your account.');

            return Redirect::back()->withErrors($messages)->withInput();
        }

       
        // We trigger an event so that developers can freely modify the following bit
        // of code through a listener rather than touching the original file. If no
        // listener is found, we fallback to the callback provided below.
        // 
        // Event::listen('account.character.creation', function($character)
        // {
        //     ...
        // });

        $character = new Player;

        Event::fallback('account.character.creation', function($character)
        {

            $character->account_id    = Auth::id();
            $character->name        = name(Input::get('name'));
            $character->sex            = (int) Input::get('gender');
            $character->vocation    = (int) Input::get('vocation');
            $character->town_id        = (int) Input::get('town');
            $character->conditions     = '';
            $character->rank_id     = 0;

            $character->looktype    = $character->sex ? 128 : 136;
            $character->lookhead    = 78;
            $character->lookbody    = 69;
            $character->looklegs    = 58;
            $character->lookfeet    = 76;


            // We fetch the new character level set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($level = value_args(Config::get('pandaac::app.character.level'), $character))
            {
                $character->level = $level;
            }


            // We fetch the new character magic level set within the configuration and
            // we pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($maglevel = value_args(Config::get('pandaac::app.character.maglevel'), $character))
            {
                $character->maglevel = $maglevel;
            }


            // We fetch the new character health set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($health = value_args(Config::get('pandaac::app.character.health'), $character))
            {
                $character->health    = $health;
                $character->healthmax = $health;
            }


            // We fetch the new character mana set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($mana = value_args(Config::get('pandaac::app.character.mana'), $character))
            {
                $character->mana    = $mana;
                $character->manamax = $mana;
            }


            // We fetch the new character capacity set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($capacity = value_args(Config::get('pandaac::app.character.capacity'), $character))
            {
                $character->cap = $capacity;
            }


            $character->save();

        }, $character);


        // We trigger an event so that developers can freely modify the following bit
        // of code through a listener rather than touching the original file.
        // 
        // Event::listen('account.character.created', function($character)
        // {
        //     ...
        // });

        Event::fire('account.character.created', $character);


        return Redirect::route('account')
            ->withMessage(Lang::get('pandaac::account.character.create.message.created', ['name' => e($character->name)]));
    }

}
These are the magic lines (change 2 to whatever number you want):
Code:
if (Auth::user()->players->count() >= 2)
Code:
$messages = $validator->errors()->add('name', 'You may not have more than 2 characters on your account.');
 
In your app/routes.php, add the following.
Code:
Route::post('account/character/create', 'AccountController@processCharacterCreation');

Then create a new file called AccountController.php in app/controllers with this in it:
Code:
<?php

class AccountController extends Controller {

    /**
    * Creating a new character on an account.
    *
    * @route  POST /account/character/create
    * @return \Redirect
    */
    public function processCharacterCreation()
    {
        $rules = Config::get('distro::validation.player.create');


        // If no vocation has been selected, or no options were provided to the user,
        // we want to default it to 0 (no vocation).

        if ( ! Input::has('vocation') or ! Config::get('pandaac::app.vocations'))
        {
            Input::merge(['vocation' => 0]);

            $rules = array_except($rules, 'vocation');
        }


        // If no town has been selected, or no options were provided to the user,
        // we want to default it to 1 (usually rookgaard).

        if ( ! Input::has('town') or ! Config::get('pandaac::app.towns'))
        {
            Input::merge(['town' => 1]);

            $rules = array_except($rules, 'town');
        }


        // Let us validate the user input by the rules defined by the active
        // distrobution package. These rules are commonly declared within the
        // validation.php config file of said package. You can alter them by
        // publishing the config files through Artisan.

        $validator = Validator::make(Input::all(), $rules);

        if ($validator->fails())
        {
            return Redirect::back()->withErrors($validator)->withInput();
        }

      
        // Once the validation passes through the aforementioned rules, we will then
        // verify that the current account contains less than 20 characters. If that is
        // not the case however, the user will be shown yet another error message.

        if (Auth::user()->players->count() >= 1)
        {
            $messages = $validator->errors()->add('name', 'You may not have more than 1 character on your account.');

            return Redirect::back()->withErrors($messages)->withInput();
        }

      
        // We trigger an event so that developers can freely modify the following bit
        // of code through a listener rather than touching the original file. If no
        // listener is found, we fallback to the callback provided below.
        //
        // Event::listen('account.character.creation', function($character)
        // {
        //     ...
        // });

        $character = new Player;

        Event::fallback('account.character.creation', function($character)
        {

            $character->account_id    = Auth::id();
            $character->name        = name(Input::get('name'));
            $character->sex            = (int) Input::get('gender');
            $character->vocation    = (int) Input::get('vocation');
            $character->town_id        = (int) Input::get('town');
            $character->conditions     = '';
            $character->rank_id     = 0;

            $character->looktype    = $character->sex ? 128 : 136;
            $character->lookhead    = 78;
            $character->lookbody    = 69;
            $character->looklegs    = 58;
            $character->lookfeet    = 76;


            // We fetch the new character level set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($level = value_args(Config::get('pandaac::app.character.level'), $character))
            {
                $character->level = $level;
            }


            // We fetch the new character magic level set within the configuration and
            // we pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($maglevel = value_args(Config::get('pandaac::app.character.maglevel'), $character))
            {
                $character->maglevel = $maglevel;
            }


            // We fetch the new character health set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($health = value_args(Config::get('pandaac::app.character.health'), $character))
            {
                $character->health    = $health;
                $character->healthmax = $health;
            }


            // We fetch the new character mana set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($mana = value_args(Config::get('pandaac::app.character.mana'), $character))
            {
                $character->mana    = $mana;
                $character->manamax = $mana;
            }


            // We fetch the new character capacity set within the configuration and we
            // pass it through the value_args function to pass through any arguments
            // if the value is an instance of a closure.

            if ($capacity = value_args(Config::get('pandaac::app.character.capacity'), $character))
            {
                $character->cap = $capacity;
            }


            $character->save();

        }, $character);


        // We trigger an event so that developers can freely modify the following bit
        // of code through a listener rather than touching the original file.
        //
        // Event::listen('account.character.created', function($character)
        // {
        //     ...
        // });

        Event::fire('account.character.created', $character);


        return Redirect::route('account')
            ->withMessage(Lang::get('pandaac::account.character.create.message.created', ['name' => e($character->name)]));
    }

}
These are the magic lines (change 2 to whatever number you want):
Code:
if (Auth::user()->players->count() >= 2)
Code:
$messages = $validator->errors()->add('name', 'You may not have more than 2 characters on your account.');

How about captcha Will you make IT work properly so people can't spam create accounts?
 
I'm currently hard at work with the new version of pandaac. I will however, ask @Cornex to look into it when he's got a spare minute or two.
 
How about captcha Will you make IT work properly so people can't spam create accounts?

Captcha was removed since it not worked as it should. I planed to just remove the old one and replace it with a better one that work properly.
However, I will add captcha when I find the time.
 
Hello. I know what im gonna say is kinda weird, but i was looking for an AAC made in laravel too. I'm using laravel framework at work, and i would like to develop things for this project if you guys agree. You cant contact me on PM, i can give skype or something so we talk some more about my experience in web developing.

I'm currently working as web developer for a spanish delivery company: winding.me
 
Absolutely buddy, I'll send you a PM with my Skype.
 
I'm afraid not. I've been addicted to ARK lately & been busy with real life work.
 
Hehe, why thank you. It's far from complete, but we're slowly getting there.
 
The plan is to mimic Tibia.com as much as possible ;-)

@Eldora I've now added both reCAPTCHA and character cooldowns. It may take a few minutes before all of it is registered through packagist, but once it does, you need to run a composer update to get the latest files, and then migrate the new database column.

You do so through one of the following commands (depends on which schema you're using):
php artisan migrate --package=pandaac/tfs10
php artisan migrate --pandaac=pandaac/avesta

You may then find instructions on how to configure the captcha here,
https://github.com/pandaac/pandaac/tree/master#recaptcha
 
Back
Top