Your browser must have JavaScript enabled in order to view this page.
 >  >
 
Welcome Guest#7100 Login/register    Go to Bottom
Go to Top

Class: DpUser

SOURCE LOCATION:  /dpuniverse/std/DpUser.php

Class Overview

A user object, the object representing a real user

Currently the only differerence with a NPC (which shares the same DpLiving class) is the passing of the user's last HTTP request's server, request and cookie variables, and the tell method (NPCs don't have a browser). See the DpLiving class for most functionality.

Creates the following DutchPIPE properties:

  • boolean isUser - Set to TRUE
  • boolean isRegistered - TRUE if this is a registered user, FALSE otherwise
  • boolean isAdmin - TRUE if this user is an administrator, FALSE otherwise
  • boolean noCookies - TRUE if the user's browser didn't accept our cookie
  • boolean isKnownBot - TRUE if this is a known search engine bot, FALSE otherwise
  • boolean isAjaxCapable - TRUE if the user's browser is AJAX-capable, FALSE otherwise
  • string age - Descriptive age of the user
  • string inactive - Descriptive inactive time of the user, empty string for active
  • boolean isInactive - TRUE if the user in inactive, FALSE otherwise
  • integer avatarNr - Avatar image number, 0 for custom avatar
  • string avatarCustom - File name of custom avatar, if any
  • status browseAvatarCustom - TRUE if the user is browsing on his computer for an image to upload (which causes scripts to halt), unset otherwise
  • mixed status - FALSE for no special status, otherwise a descriptive string, 'away'
  • string inputMode - Input field mode, "say" or "cmd"
  • string inputEnabled - Is input field visibile? Either "on" or "off"
  • string inputPersistent - Input field options

DpProperties
   |
   --DpObject
      |
      --DpLiving
         |
         --DpUser
LOCATED IN:  /dpuniverse/std/DpUser.php [line 76]
AUTHOR(S):   Lennert Stock <ls@dutchpipe.org>
LINK:  http://dutchpipe.org/manual/package/DutchPIPE
VERSION:  Release: 0.2.1
LICENSE:  DutchPIPE License
COPYRIGHT:  2006, 2007 Lennert Stock
PROPERTIES:
METHODS:

Inherits

Inherited Methods

INHERITED FROM:  DpLiving
boolean   DpLiving::actionCheer()   Makes this living object cheer wildly
boolean   DpLiving::actionDance()   Makes this living object take another living object for a dance
boolean   DpLiving::actionDrop()   Drops an object in the user's environment
boolean   DpLiving::actionEmote()   Makes this living object communicate a custom message to its environment
boolean   DpLiving::actionExamine()   Makes this living object examine an object
boolean   DpLiving::actionGive()   Makes this living object give an object to another living object
boolean   DpLiving::actionGrin()   Makes this living object grin evilly
boolean   DpLiving::actionHighFive()   Makes this living object slap a high-five with another living object
boolean   DpLiving::actionHug()   Makes this living object hug another living object
boolean   DpLiving::actionInventory()   Shows this living object a list of objects it is carrying
boolean   DpLiving::actionKiss()   Makes this living object give another living object a passionate kiss
boolean   DpLiving::actionLaugh()   Makes this living object fall down on the floor laughing
boolean   DpLiving::actionNod()   Makes this living object nod solemnly
boolean   DpLiving::actionPat()   Makes this living object pat another living object on the head
boolean   DpLiving::actionSay()   Makes this living object say something
boolean   DpLiving::actionShout()   Makes this living object shout something to everyone on the site
boolean   DpLiving::actionShrug()   Makes this living object shrug
boolean   DpLiving::actionSmile()   Makes this living object smile happily
boolean   DpLiving::actionTake()   Makes this living object take an object
boolean   DpLiving::actionTell()   Makes this living object tell something to another user object
void   DpLiving::createDpLiving()   Sets this living object up at the time it is created
void   DpLiving::eventDpLiving()   Reports an event
void   DpLiving::eventDpObject()   Reports an event
string   DpLiving::getActionOperantMenu()   Completes the give action performed by clicking on an object
void   DpLiving::getEmotionsMenu()  
void   DpLiving::getMenuGiveAuth()  
void   DpLiving::getMenuGiveLabel()  
void   DpLiving::getMenuTellAuth()  
string   DpLiving::getSessionAge()   Gets the livings's age since it was created as an object in a string
void   DpLiving::getTellOperant()  
void   DpLiving::getVolumeCarry()  
void   DpLiving::getWeightCarry()  
boolean   DpLiving::performAction()   Tries to perform the action given by the living object
void   DpLiving::resetDpLiving()   Resets this living object
void   DpLiving::timeoutHeartBeat()   Calls itself every "heartbeat"

INHERITED FROM:  DpObject
void   DpObject::addAction()   Adds an action to the object
void   DpObject::addId()   Adds one or more ids for this object
void   DpObject::addItem()   Adds an examinable 'item' to this object
void   DpObject::addMapAreaAction()   Adds an action to a map area so it becomes clickable there
void   DpObject::addValidClientCall()   Makes the given method callable from the DutchPIPE client
void   DpObject::createDpObject()   Sets this object up at the time it is created
void   DpObject::event()   Reports an event
void   DpObject::eventDpObject()   Reports an event
array   DpObject::getActionData()   Gets data of one, multiple or all actions
void   DpObject::getActionsMenu()   Tells the current user the HTML with the action menu for this object
string   DpObject::getAppearance()   Gets the HTML "appearance" of this object
string   DpObject::getAppearanceInventory()   Gets the HTML "appearance" of all objects in this object's inventory
string   DpObject::getAppearanceTitle()   Gets the graphical appearance in HTML for this object
string   DpObject::getBody()   Gets the HTML content of this object
int|float   DpObject::getCredits()   Gets the amount of credits in the inventory of this object
mixed   DpObject::getEnvironment()   Gets the object reference to the environment of this object
int|float   DpObject::getHeapAmount()   Gets the amount of a given heap object
array   DpObject::getIds()   Gets the array of ids for this object, or an empty array for no ids
array   DpObject::getInventory()   Gets an array with object references to all objects in our inventory
array   DpObject::getItem()   Gets an array with data about an item
mixed   DpObject::getItemDescription()   Gets the description of a given item
array   DpObject::getItems()   Gets an array with all item data added to this object
mixed   DpObject::getMapArea()   Gets data of one, multiple or all imagemap areas
array   DpObject::getMapAreaActions()   Gets all map area actions for all areas or for a given area
string   DpObject::getMapAreaHtml()   Gets HTML for all imagemaps or the given imagemap for inclusion in page
string   DpObject::getNavigationTrailHtml()   Gets a HTML navigation trail for this object
array   DpObject::getTargettedActions()   Gets actions which can be performed on this object, for action menu
string   DpObject::getTitle()   Gets the object's title with optional prefixes such as 'a' and 'the'
mixed   DpObject::getTitleImgHeight()   Gets the height in pixels of the title image
mixed   DpObject::getTitleImgWidth()   Gets the width in pixels of the title image
void   DpObject::handleCleanUp()   Called by the universe object, checks if this object can be removed.
boolean   DpObject::isDraggable()   Can we be dragged on the screen by the given user?
boolean   DpObject::isId()   Checks if the given id is a valid id for this object
boolean   DpObject::isPresent()   Checks if an object is present in this object's inventory
boolean   DpObject::isValidClientCall()   May the given method be called in this object from the DutchPIPE client?
void   DpObject::makePresent()   Makes sure an object is present in this object's inventory
int   DpObject::moveDpObject()   Moves this object into the inventory of another object
boolean   DpObject::performActionSubject()   Tries if a user action can be performed on this object
void   DpObject::removeAction()   Removes the given action.
void   DpObject::removeDpObject()   Removes this object from the universe
void   DpObject::removeId()   Removes one or more ids for this object
void   DpObject::removeMapAreaAction()   Removes a map area action
void   DpObject::removeValidClientCall()   Removes the given method from callable methods from the DutchPIPE client
void   DpObject::reportMove()   Reports graphical movement of this object to other objects
void   DpObject::resetDpObject()   Resets this object
void   DpObject::setBody()   Sets the HTML content of this object
boolean   DpObject::setCredits()   Sets the amount of credits in the inventory of this object
boolean   DpObject::setHeapAmount()   Sets a heap object of a given amount in this object
void   DpObject::setIds()   Sets an array of names used to refer to this object
void   DpObject::setMapArea()   Creates a new imagemap area which can be used by actions
void   DpObject::setTimeout()   Calls the given method after the given number of seconds
void   DpObject::setTitle()   Sets the title for this object, "beer", used for object labels, etc.
void   DpObject::tell()   Tells data (message, window, location, ...) to this object
void   DpObject::__destruct()   Called by PHP when this object is destroyed, handles events

INHERITED FROM:  DpProperties
void   DpProperties::coinherit()   "Coinherit" a class located at the given pathname
mixed   DpProperties::getDpProperty()   Directly retrieve the value of an existing DutchPIPE property
boolean   DpProperties::isDpProperty()   Determines if a property is defined in this object
void   DpProperties::removeDpProperties()   Removes properties and coinherits
void   DpProperties::setDpProperty()   Directly set the value of an existing DutchPIPE property
void   DpProperties::__call()   Handles set and get methods for properties using PHP member overloading
mixed   DpProperties::__get()   Gets the value of a DutchPIPE property using PHP member overloading
boolean   DpProperties::__isset()   Determines if a property is defined in this object using PHP member overloading
void   DpProperties::__set()   Sets the value of a DutchPIPE property using PHP member overloading
void   DpProperties::__unset()   Unsets the given DutchPIPE property using PHP member overloading

Property Summary

array   $mActionHistory   History of input field actions, can be accesed by up and down arrow keys
array   $mAlertEvents   Events this user will be alerted of, such as people entering the site
array   $_COOKIE   Variables provided via HTTP cookies
array   $_FILES   Variables provided via HTTP post file uploads
array   $_GET   Variables provided via URL query string
array   $_POST   Variables provided via HTTP POST
array   $_SERVER   Variables set by the web server of related to dpclient.php's environment
array   $_SESSION   Variables which are currently registered to a script's session

Methods Summary

boolean   actionAvatar()   Shows this user a window with avatar settings
boolean   actionDestroy()   Destroys an object
boolean   actionEmote()   Makes this user communicate a custom message to its environment
boolean   actionForce()   Makes this administrator force another user to perform an action
boolean   actionGoto()   Go to a given location
boolean   actionHelp()   Shows this user a window with help information
boolean   actionLinks()   Shows this living a list of links in its environment or in another object
boolean   actionLoginOut()   Go to the login page, logout if logon on.
boolean   actionMode()   Sets the input field mode
boolean   actionMove()   Makes this administrator move an object to another environment
string   actionMoveOperant()   Completes the move action performed by clicking on an object
boolean   actionMyhome()   Moves to or sets personal home location
boolean   actionOblist()   Shows a list of all objects in this DutchPIPE universe in a window
boolean   actionReset()   Resets the environment.
boolean   actionSettings()   Shows this user a window with settings
boolean   actionShout()   Makes this user shout something to everyone on the site
boolean   actionSource()   Shows this user source code of environment or of another object
boolean   actionSvars()   Shows this administrator various PHP/server information about a user
boolean   actionTell()   Makes this user object tell something to another user object
boolean   actionWho()   Shows this user a list of users on the site
void   createDpLiving()   Initializes the user
void   eventDpLiving()   Reports an event
string   getAge()   Gets the user's age in a string
string   getInactive()   Gets inactive time of the user in a string
void   getModeChecked()  
string   getStatus()   Gets a descriptive user status string
status   isInactive()   Is this user inactive?
boolean   performAction()   Tries to perform the action given by the user object
void   setAvatar()   Switches to another avatar when clicking on one using actionAvatar()
void   setBrowseAvatarCustom()   Sets this user as busy browing for a file
void   setSettings()   Applies settings from the settings menu obtained with actionSettings()
void   setVars()   Sets various PHP global variables passed on from the DutchPIPE server
void   tell()   Sends something to dpclient-js.php running on the user's browser
void   timeoutHeartBeat()   Calls itself every "heartbeat"
void   uploadAvatarCustom()   Attempts to upload a file to be used as our avatar image

Properties

array   $mActionHistory = array()  [line 149]

History of input field actions, can be accesed by up and down arrow keys
ACCESS:  public
array   $mAlertEvents = array()  [line 142]

Events this user will be alerted of, such as people entering the site
ACCESS:  public
array   $_COOKIE   [line 100]

Variables provided via HTTP cookies
ACCESS:  public
array   $_FILES   [line 121]

Variables provided via HTTP post file uploads
ACCESS:  public
array   $_GET   [line 107]

Variables provided via URL query string
ACCESS:  public
array   $_POST   [line 114]

Variables provided via HTTP POST
ACCESS:  public
array   $_SERVER   [line 86]

Variables set by the web server of related to dpclient.php's environment

This environment is the execution environment of the current dpclient.php script.

ACCESS:  public
array   $_SESSION   [line 93]

Variables which are currently registered to a script's session
ACCESS:  public
Methods

actionAvatar  [line 684]
boolean actionAvatar( string $verb , string $noun   )

Shows this user a window with avatar settings

PARAMETERS: string   $verb  the action, "avatar"
string   $noun  empty string
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
SEE:  DpUser::setAvatar(), DpUser::setBrowseAvatarCustom(), DpUser::uploadAvatarCustom(), removeAvatarCustom
SINCE:  DutchPIPE 0.4.1
actionDestroy  [line 1275]
boolean actionDestroy( string $verb , string $noun   )

Destroys an object

PARAMETERS: string   $verb  the action, "destroy"
string   $noun  the object to destroy, for example "rose"
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
SINCE:  DutchPIPE 0.4.0
actionEmote  [line 1732]
boolean actionEmote( string $verb , string $noun   )

Makes this user communicate a custom message to its environment

PARAMETERS: string   $verb  the action, "emote"
string   $noun  string to "emote"
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
REDEFINITION OF:   DpLiving::actionEmote(): Makes this living object communicate a custom message to its environment
actionForce  [line 1353]
boolean actionForce( string $verb , string $noun   )

Makes this administrator force another user to perform an action

PARAMETERS: string   $verb  the action, "force"
string   $noun  who and what to force
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionGoto  [line 1335]
boolean actionGoto( string $verb , string $noun   )

Go to a given location

PARAMETERS: string   $verb  the action, "goto"
string   $noun  the location, for example "/page/about.php"
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionHelp  [line 550]
boolean actionHelp( string $verb , string $noun   )

Shows this user a window with help information

PARAMETERS: string   $verb  the action, "help"
string   $noun  empty string
RETURNS:  boolean  TRUE
actionLinks  [line 598]
boolean actionLinks( string $verb , string $noun   )

Shows this living a list of links in its environment or in another object

PARAMETERS: string   $verb  the action, "links"
string   $noun  what to take, could be empty
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionLoginOut  [line 1543]
boolean actionLoginOut( )

Go to the login page, logout if logon on.

RETURNS:  boolean  TRUE
actionMode  [line 1618]
boolean actionMode( string $verb , string $noun   )

Sets the input field mode

Without an argument, switches between the two modes "cmd" and "say". Otherwise switches to the given mode (if it is valid). The input field stays visible between page changes with mode "pin".


PARAMETERS: string   $verb  the action, "mode"
string   $noun  empty or a mode
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionMove  [line 1425]
boolean actionMove( string $verb , string $noun   )

Makes this administrator move an object to another environment

PARAMETERS: string   $verb  the action, "move"
string   $noun  what and where to move
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionMoveOperant  [line 1410]
string actionMoveOperant( string $verb , &$menuobj   )

Completes the move action performed by clicking on an object

PARAMETERS: string   $verb  the action, "move"
   &$menuobj 
RETURNS:  string  a string such as "beer "
SEE:  DpUser::actionMove()
actionMyhome  [line 1558]
boolean actionMyhome( string $verb , string $noun   )

Moves to or sets personal home location

PARAMETERS: string   $verb  the action, "myhome"
string   $noun  empty to go home, "set" to set home
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionOblist  [line 1312]
boolean actionOblist( string $verb , string $noun   )

Shows a list of all objects in this DutchPIPE universe in a window

PARAMETERS: string   $verb  the action, "oblist"
string   $noun  empty string
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
SEE:  DpUniverse::gteObjectList()
SINCE:  DutchPIPE 0.4.0
actionReset  [line 1531]
boolean actionReset( )

Resets the environment.

RETURNS:  boolean  TRUE
actionSettings  [line 1130]
boolean actionSettings( string $verb , string $noun   )

Shows this user a window with settings

PARAMETERS: string   $verb  the action, "settings"
string   $noun  empty string
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
SEE:  DpUser::setSettings()
actionShout  [line 1704]
boolean actionShout( string $verb , string $noun   )

Makes this user shout something to everyone on the site

PARAMETERS: string   $verb  the action, "shout"
string   $noun  what to shout, could be empty
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
REDEFINITION OF:   DpLiving::actionShout(): Makes this living object shout something to everyone on the site
actionSource  [line 567]
boolean actionSource( string $verb , string $noun   )

Shows this user source code of environment or of another object

PARAMETERS: string   $verb  the action, "source"
string   $noun  what to show source of, could be empty
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionSvars  [line 1238]
boolean actionSvars( string $verb , string $noun   )

Shows this administrator various PHP/server information about a user

PARAMETERS: string   $verb  the action, "svars"
string   $noun  who to show info of, could be empty
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
actionTell  [line 1676]
boolean actionTell( string $verb , string $noun   )

Makes this user object tell something to another user object

PARAMETERS: string   $verb  the action, "tell"
string   $noun  who and what to tell, could be empty
RETURNS:  boolean  TRUE for action completed, FALSE otherwise
REDEFINITION OF:   DpLiving::actionTell(): Makes this living object tell something to another user object
actionWho  [line 641]
boolean actionWho( string $verb , string $noun   )

Shows this user a list of users on the site

PARAMETERS: string   $verb  the action, "who"
string   $noun  empty string
RETURNS:  boolean  TRUE
createDpLiving  [line 154]
void createDpLiving( )

Initializes the user

REDEFINITION OF:   DpLiving::createDpLiving(): Sets this living object up at the time it is created
eventDpLiving  [line 467]
void eventDpLiving( object $name , mixed $args   )

Reports an event

Called when certain events occur, given with $name.


PARAMETERS: object   $name  Name of event
mixed   $args  One or more arguments, depends on event
SINCE:  DutchPIPE 0.2.0
REDEFINITION OF:   DpLiving::eventDpLiving(): Reports an event
getAge  [line 223]
string getAge( )

Gets the user's age in a string

Returns the user's age in a format like "1 day, 6 hours and 14 minutes".


RETURNS:  string  user's age
ACCESS:  protected
SEE:  DpUser::getInactive(), DpUser::isInactive(), DpUser::getStatus(), DpLiving::getSessionAge()
getInactive  [line 251]
string getInactive( )

Gets inactive time of the user in a string

Returns how long the user is inactive in a format like "2 hours and 14 minutes".


RETURNS:  string  user's inactivity
SEE:  DpUser::getAge(), DpUser::isInactive(), DpUser::getStatus(), DpLiving::getSessionAge()
getModeChecked  [line 1660]
void getModeChecked( )

getStatus  [line 290]
string getStatus( )

Gets a descriptive user status string

If the user has a special status like inactive, returns a string like "away", to use in user titles and such. If there is no special status, returns an empty string.


RETURNS:  string  status description
SEE:  DpUser::getAge(), DpUser::getInactive(), DpUser::isInactive(), DpLiving::getSessionAge()
isInactive  [line 272]
status isInactive( )

Is this user inactive?

Inactive is defined as a user who hasn't shown activity in the last 5 minutes.


RETURNS:  status  TRUE if the user is inactive, FALSE if active
SEE:  DpUser::getAge(), DpUser::getInactive(), DpUser::getStatus(), DpLiving::getSessionAge()
performAction  [line 518]
boolean performAction( string $action   )

Tries to perform the action given by the user object

Handles input area input mode and history. Uses DpLiving::performAction() for the real stuff. See DpLiving::performAction() for more information.


PARAMETERS: string   $action  the action given by the user object
RETURNS:  boolean  TRUE for success, FALSE for unsuccessful action
ACCESS:  public
SEE:  DpLiving::performAction()
REDEFINITION OF:   DpLiving::performAction(): Tries to perform the action given by the living object
setAvatar  [line 847]
void setAvatar( )

Switches to another avatar when clicking on one using actionAvatar()

Sets the avatarNr property to the given stock avatar number, or to 0 in case a custom avatar is used. Updates database for registered users. Sends messages.


SEE:  DpUser::actionAvatar(), DpUser::uploadAvatarCustom(), removeAvatarCustom
SINCE:  DutchPIPE 0.4.1
setBrowseAvatarCustom  [line 906]
void setBrowseAvatarCustom( [boolean $browseAvatarCustom = TRUE]   )

Sets this user as busy browing for a file

Sets the browseAvatarCustom property to TRUE, or unsets it otherwise. Called from the JavaScript client when the user clicks on "Browse..." to look for a file to upload. This causes browsers to halt execution of scripts while the file dialog is visible. DpCurrentRequest uses this property to users are not thrown out while browsing for a file.


PARAMETERS: boolean   $browseAvatarCustom  TRUE to start browsing, FALSE to end
SEE:  DpUser::actionAvatar(), DpUser::uploadAvatarCustom()
SINCE:  DutchPIPE 0.4.1
setSettings  [line 1175]
void setSettings( )

Applies settings from the settings menu obtained with actionSettings()

Called from the Javascript that goes with the menu that pops up after the settings action has been performed. Applies avatar and dispay mode settings, based on the DpUser::_GET variable in this user.


setVars  [line 344]
void setVars( array &$rServerVars , array &$rSessionVars , array &$rCookieVars , array &$rGetVars , array &$rPostVars , array &$rFilesVars   )

Sets various PHP global variables passed on from the DutchPIPE server

Called each time a user's browser does a normal page or AJAX request. Several variables are passed which represent their corresponding PHP global arrays: $_SERVER, $_COOKIE, etc.


PARAMETERS: array   &$rServerVars  User server variables
array   &$rSessionVars  User session variables
array   &$rCookieVars  User cookie variables
array   &$rGetVars  User get variables
array   &$rPostVars  User post variables
array   &$rFilesVars  User files variables
tell  [line 372]
void tell( string $data , [object &$binded_env = NULL]   )

Sends something to dpclient-js.php running on the user's browser

Sends the given data to the user's browser. It's up the user's DutchPIPE Javascript client, dpclient-js.php by default, what to do with the received content. dpclient-js.php can be send data like '<message>hello world</message>' and '<window>hello world</window>', to show something in the message area and pop up a window respectively.

Can be binded to an environment. This is useful for locations producing messages: the user could be moving to another location before the client catches the new message with AJAX, in which case the user should not get the message.


PARAMETERS: string   $data  message string
object   &$binded_env  optional binded environment
REDEFINITION OF:   DpObject::tell(): Tells data (message, window, location, ...) to this object
timeoutHeartBeat  [line 304]
void timeoutHeartBeat( )

Calls itself every "heartbeat"

Redefine this method to make timed stuff happen.


REDEFINITION OF:   DpLiving::timeoutHeartBeat(): Calls itself every "heartbeat"
uploadAvatarCustom  [line 932]
void uploadAvatarCustom( )

Attempts to upload a file to be used as our avatar image

SEE:  DpUser::actionAvatar(), DpUser::setBrowseAvatarCustom(), removeAvatarCustom
SINCE:  DutchPIPE 0.4.1

Documentation generated on Mon, 03 Sep 2007 22:21:19 +0200 by phpDocumentor 1.3.0RC6

Click me!
Guest#7100
 
 
 
  Go to Top
 
 
Input Field OptionsClose Input Field Go to Top
 
Legal Notices | Copyright © 2006, 2007 Lennert Stock. All rights reserved. Last update: Mon Sep 03 2007, 21:50 CET.