Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 3 of 8 FirstFirst 1234567 ... LastLast
Results 21 to 30 of 71
  1. #21
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    I was refering to the suggestions made by other users on how to write the system .

    Ill just write a bit about OOP for the benifit of anyone reading this thread:

    Classes should really define a single "thing" with that object having methods, typically verbs, that relate to that single thing.

    Lets take a rather simple example. We're making a simple war game and we have different units. One unit might be a tank and the other might be a fighter jet. There would be two different classes for both the tank and the fighter jet e.g

    PHP Code:
    class tank {
    /* Functions.. blah... blah */
    }

    class 
    jet {
    /* Functions.... */

    Now, the tank can fire its cannon or fire its machine guns, so we might have:

    PHP Code:
    class tank {
    public function 
    fireCannon($target) {
    /*code*/
    }

    public function 
    fireGuns($target) {
    /*code*/
    }

    Similar setup for the jet, it can fire its missiles or guns.

    We would not do something like:

    PHP Code:
    $army->fire("tank""guns"1); 
    Where the army object controls the entire game and just stores the data internally and each unit is identified by a ID (1 in this case). Although we might use an army object that stores the other unit objects and creates them (This is called a factory pattern).

    Quote Originally Posted by Mentor View Post
    It is OOP? though somewhat more abstracted than your examples.
    PHP Code:
    <?php
    include('../Magic/magic.php');

    $userSys = new UserSystem();

    //get user 2 (me) (all hardcoded for example)
    $userObject $userSys->getUserInfo(2);//2 being my id

    echo 'Accounts name is'.$userObject->getAttribute('name');
    echo 
    'Accounts dob is'.$userObject->getAttribute('dob');
    echo 
    'Accounts avatar is'.$userObject->getAttribute('avatar');

    //equally if u were logged in you could get your user object via
    $me$userSys->getCurrentUser();//will be guest if not logged in
    $myarray$me->getAttributeArray();//return attributes as array

    //some things are accessed via direct accessors though.
    $permObj $me->getPermissions()

    //or if we wanted to we can get common options as an array via
    $common $userSys->getCurrentUserCommon();

    ?>
    The only code outside objects at all inside magic itself is the autoloader and config import (plus an installer redirect)

  2. #22
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Version: 2009.05.24 v0.5.6

    Changelog
    # Password algorthum updated to be more secure
    # getUserInfo method replaced with getUserById($id) and getUserByName($name)
    # getCurrentUserCommon method removed (used volitile feilds)
    # getCurrentUserInfo renamed to getAttribute
    # SaveUserDetails renamed to updateCurrentUser
    # updateUser Method added
    # CreateUser renamed to makeNewUser
    # v0.4 Mysql Database driver completed (no installer)
    # More code comments added by general bug fix's
    # Config altered. Install check now on path's rather than independant value.

    Known issues:
    #Session wondering: Session data from two differnt installs on the same server will transfer.
    #Mysqls lack of zero id cause guest to need forgeing. (will need to redo how guest user is handled.)

    Major features to add before first release.
    #Permissions System
    #Safemode option
    (in safemode dangerous and possibly unwanted actions are prevented. This can be turned off by advanced users who know what they are doing and want to be able to handle issues within there own code.)
    #Installer to generate config and create database's
    #Demo site skin that doesnt burn peoples eyes

  3. #23

    Default

    Well good luck with this, on first release I'm going to hug your code and use it as a learning tool.

  4. #24
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Version: 2009.05.25 v0.5.9

    Changelog

    # SessionID now determined by hash (no more conflict's)
    # Safemode implemented
    # 4 more exceptions handled
    # Additional commenting and bug fix's
    # Config file reorderd and contains additonal keys
    # mysql db now supports create and edit users (full functionality)
    # Ability to lock profile feilds from general purpouse updates.

    Known issues:


    Major features still outstanding

    # Installer to generate config and create database's
    # Demo site skin that doesnt burn peoples eyes
    # Permissions System



    It wont be long before im going to need a few skilled testers to have a few goes at implementing basic user systems useing Magic to check it works? Anyone interested as the alpha isnt far off now.

    Equally if anyones interested in getting involved in the project, any help would be great. Providing a nice looking skin (just html layout) for use in the projects demos would be great. Plus ideas for a logo

  5. #25

    Default

    I offer what pathetic services and skills I have, designing not included. I suppose I'm aright with ideas and I'm experienced with PHP & HTML, so I could give testing a go?

  6. #26
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by Jam-ez View Post
    I offer what pathetic services and skills I have, designing not included. I suppose I'm aright with ideas and I'm experienced with PHP & HTML, so I could give testing a go?
    lol no
    Hi, names James. I am a web developer.

  7. #27

    Default

    Quote Originally Posted by Protege View Post
    lol no
    Don't 'lol no' me, or, y'know people in this thread will dislike you for your pointless contributions - as they do in every other thread.

    Anyway, I wouldn't mind alpha testing but you're free to choose whoever.

  8. #28
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    dislike me diddoms. i think mentor can cope with coding by himself without a accidental backdoor contribution by you. stick to the testing, good boy.
    Hi, names James. I am a web developer.

  9. #29

    Default

    It wont be long before im going to need a few skilled testers to have a few goes at implementing basic user systems useing Magic to check it works? Anyone interested as the alpha isnt far off now.
    I'm pretty sure that doesn't mean editing Magic and making back doors in it. Oh, and I never mentioned I wanted to code Magic in anyway, I am pretty sure Mentor can do it by himself, by the way.

  10. #30
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    soz ur rite just feelin down and pathetic atm just read a bit and didnt finish forgive me
    Hi, names James. I am a web developer.

Page 3 of 8 FirstFirst 1234567 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •