Package marauroa.common.game


package marauroa.common.game
This package stores all the important data structures of Marauroa.

Mainly we are talking about:

  • Attributes
  • RPObject
  • RPSlot
  • RPAction
  • RPEvent
  • RPClass
  • Definitions
  • IRPZone
The whole Marauroa system is managed by two main entities, RPAction and RPObject. There are also several helper classes like Attributes, RPSlot, RPEvent and RPClass

Atributtes
Attributes is a collection of pairs of values in the form name-value.
We can store almost any basic type in a Attribute object:

  • strings
  • integer
  • floats
  • boolean
We can't store structures in the attribute, but you can convert groups of data to a string and store it as a string. Marauroa provides helper methods for this.

Objects
All information in the Marauroa server is contained in RPObjects. An object is composed of several attributes (an attribute is similar to a variable in that it has a name and contains a value) and Slots. A Slot is a container or array of containers belonging to an object, and are used to host (store) other objects inside them. Mandatory Object Attributes are id, type and zoneid id is an unique identification for the object inside a zone.
zoneid is the identification for the zone, unique inside world, where the object resides
type is the type of the object aka class, so that you can share attributes definitions for all the instances of the class.

An id is only unique inside the zone which contains that object.

The engine provided two special types of attributes when you set no RPClass for a Attributes object:

  • Attributes that begin with ! are completely hidden from all other users except the owner of the object.
  • Attributes that begin with # are completely hidden for all users.

Classes of Objects Explained
Classes of Objects are the basic way of structuring Marauroa data structures. The type of an attribute of a given object must be equal to a RPClass name of the type class you wish to use.
The class defines the type of the attribute, its visibility and assigns it an internal code that is used to speed up searchs and save bandwidth. You can base a class on another, this feature is known as inheritance (a new class is create from a class that already exists and takes all the original classes methods and data and extends it).

The data types available are:

  • Strings
  • Short strings ( up to 255 bytes )
  • Integers ( 4 bytes )
  • Shorts ( 2 bytes )
  • Byte ( 1 byte )
  • Flag ( it is a binary attribute )
Attributes can be private which means only the player client can see them when they change, or invisible if clients can't see them at all. Also an attribute can be volatile which means that it is not stored to database.

Slots
Objects can reside inside other objects much like you have the keys inside your pocket. The goal of Slots is to provide a richer game play while reducing the number of object in the zone.
To have objects inside, we need our hoster object to have slots to place them in.

For example an avatar can have:

  • left hand
  • right hand
  • backpack
  • left pocket
  • right pocket
And we can store objects in each of these slots.

Once an object has been stored inside an objects slot, the only way of accessing the stored object is through the object that contains our stored object. As attributes, slots, that has not been defined in a RPClass, have two special types:

  • Slots names that start with ! are only sent to owner player. (Hence only seen by the owner)
  • Slots names that start with # are not sent to players. (Invisible to all)
Actions
To express the willingness of a client to do something it must send the server a MessageC2SAction message. An action is composed of several attributes. (an attribute is similar to a variable in that it has a name and contains a value). There are optional and mandatory attributes. If a mandatory attribute is not found, the message is skipped by the RPServerManager.

Mandatory Action Attributes are action_id and type. The action_id is used to identify the action when a resulting response comes in a perception

Author:
miguel
  • Interface Summary
    Interface
    Description
    Interface for managing the objects in a RPZone.
  • Class Summary
    Class
    Description
    This class represent the result of creating an account.
    This class hosts a list of Attributes stored as pairs String=String.
    This class represent the result of creating an account.
    This class stores the definition of an attributes, event or rpslot.
    An unique ID for this zone
    The Perception class provides a encapsultated way of managing perceptions.
    This class represent an Action.
    An RPClass is a entity that define the attributes, events and slots of an Object.
    This class implements an event.
    An RPLink represent an object relation that is not as strong as RPSlot, and although it could be modelled with a slot it would be better to manage it with an RPLink.
    This class implements an Object.
    This class stores the basic identification for a RPObject
    This class represent a slot in an object
    interface for RP-classes that own slots
  • Enum Class Summary
    Enum Class
    Description
    This enum determine to which entity the definition belogs: either attributes, event or slot
    Define the possible types of an attribute or event
    This enum provides detatil level of the serialization
    This enum represent the possible values returned by the create account process.
  • Exception Summary
    Exception
    Description
    invalid rpobject (required attribute is missing).
    thrown in case an expected rpobject is not found
    Thrown in case the object already has a slot with this name
    thrown in case the slot is full
    This exception is thrown when an attribute is not found