Package marauroa.common.game
Mainly we are talking about:
- Attributes
- RPObject
- RPSlot
- RPAction
- RPEvent
- RPClass
- Definitions
- IRPZone
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
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 )
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
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)
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
-
ClassDescriptionThis 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 zoneThe 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 RPObjectThis class represent a slot in an objectinterface for RP-classes that own slots
-
Enum ClassDescriptionThis enum determine to which entity the definition belogs: either attributes, event or slotDefine the possible types of an attribute or eventThis enum provides detatil level of the serializationThis enum represent the possible values returned by the create account process.
-
ExceptionDescriptioninvalid rpobject (required attribute is missing).thrown in case an expected rpobject is not foundThrown in case the object already has a slot with this namethrown in case the slot is fullThis exception is thrown when an attribute is not found