RolePlayingDesign: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 30:
 
RPManager provides a simple interface to the GameManager for using it:
* addRPAction <br> addRPActionIt simply queues an action for that player to be executed on the next turn.
* getRPObject <br> getRPObjectIt is aan interface to manage RPWorld to ease the adquisition of the RPObject when exiting the game.
* onInit Player
* onExit Player<br> onInit and onExitThey are callback functions that are used by GameManager to notify that a player has entered the game or that a player has exit the game.
* transferContent<br> transferContentIt is a callback function too that is called by RPRuleProcessor to stream content to players.
 
The main outline of RPManager could be:
Line 41:
{
Procced through every action in this turn
{
rpRuleProcessor executes action
}
 
Build Perception
Line 52 ⟶ 55:
RPScheduler is the class that handles actions to be queued for each player. All the complexity of Action management should be handled here.
 
RuleProcessorRPRuleProcessor is a wrapper class for hide actions code. Alland theinitialization actionsand code MUST be here, this class also acts as a Actionexit code. loader, as some actions are not part of Marauroa, but scripts.<br>
All the actions code MUST be here.<br>
 
By implementing RPRuleProcessor you personalize Marauroa to be the kind of game you want to code. But keep in mind that you are ''limited'' to a realtime like game.
 
=Actions and Objects=
The whole Marauroa system is managed by two main entities, RPAction and RPObject and several helper classes like Attributes, RPSlot and RPClass
==Actions==
To express the willing of a client to do something it must send the server a MessageC2SAction message.
 
An action is composed of several attributes, an attributed is similar to a variable that 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 Actions Attributes are action_id and type.
 
The action_id is used to identify the action when a resulting response comes in a perception
 
Optional Actions Attributes: (Read "Actions Explained" for more details.)
 
==Objects==
Line 113 ⟶ 105:
 
Once the object is stored inside the avatar or another object, the only way of accessing it is through the object that contains our stored object.
 
==Actions==
To express the willing of a client to do something it must send the server a MessageC2SAction message.
 
An action is composed of several attributes, an attributed is similar to a variable that 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 Actions Attributes are action_id and type.
 
The action_id is used to identify the action when a resulting response comes in a perception
 
Optional Actions Attributes: (Read "Actions Explained" for more details.)