Dawn of Light - Class documentation 2900
This is the Dawn of Light project
DOL.GS.Region Class Reference

This class represents a region in DAOC. A region is everything where you need a loadingscreen to go there. Eg. whole Albion is one Region, Midgard and Hibernia are just one region too. Darkness Falls is a region. Each dungeon, city is a region ... you get the clue. Each Region can hold an arbitary number of Zones! Camelot Hills is one Zone, Tir na Nog is one Zone (and one Region)... More...

Inheritance diagram for DOL.GS.Region:
DOL.GS.BaseInstance DOL.GS.Instance DOL.GS.Quests.TaskDungeonInstance

List of all members.

Classes

class  DistanceEnumerator
class  DoorDistanceEnumerator
 This enumerator returns the object and the distance towards the object. More...
class  EmptyEnumerator
 An empty enumerator returned when no objects are found close to a certain range. More...
class  ItemDistanceEnumerator
 This enumerator returns the object and the distance towards the object. More...
class  NPCDistanceEnumerator
 This enumerator returns the object and the distance towards the object. More...
class  ObjectEnumerator
 An enumerator over GameObjects. Used to enumerate over certain objects and do some testing before returning an object. More...
class  PlayerDistanceEnumerator
 This enumerator returns the object and the distance towards the object. More...

Public Member Functions

 Region (GameTimer.TimeManager time, RegionData data)
 Constructs a new empty Region.
virtual void OnCollapse ()
 What to do when the region collapses. This is called when instanced regions need to be closed.
virtual bool OnZonePoint (GamePlayer player, ZonePoint zonePoint)
 Handles players leaving this region via a zonepoint.
virtual void SendWeather (GamePlayer player)
 Get the weather manager for this region By default use WeatherMgr.
void StartRegionMgr ()
 Starts the RegionMgr.
void StopRegionMgr ()
 Stops the RegionMgr.
void PreAllocateRegionSpace (int count)
 Reallocates objects array with given size.
void LoadFromDatabase (Mob[] mobObjs, ref long mobCount, ref long merchantCount, ref long itemCount, ref long bindCount)
GameGravestone FindGraveStone (GamePlayer player)
 Searches for players gravestone in this region.
GameObject GetObject (ushort id)
 Gets the object with the specified ID.
Zone GetZone (int x, int y)
 Returns the zone that contains the specified x and y values.
int GetXOffInZone (int x, int y)
 Gets the X offset for the specified zone.
int GetYOffInZone (int x, int y)
 Gets the Y offset for the specified zone.
virtual IArea AddArea (IArea area)
 Adds an area to the region and updates area-zone cache.
virtual void RemoveArea (IArea area)
 Removes an are from the list of areas and updates area-zone chache.
virtual IList GetAreasOfSpot (IPoint3D point)
 Gets the areas for given location, less performant than getAreasOfZone so use other on if possible.
virtual IList GetAreasOfSpot (int x, int y, int z)
 Gets the areas for a certain spot, less performant than getAreasOfZone so use other on if possible.
virtual IList GetAreasOfZone (Zone zone, IPoint3D p)
virtual IList GetAreasOfZone (Zone zone, IPoint3D p, bool checkZ)
virtual IList GetAreasOfZone (Zone zone, int x, int y, int z)
virtual void Notify (DOLEvent e, object sender, EventArgs args)
virtual void Notify (DOLEvent e, object sender)
virtual void Notify (DOLEvent e)
virtual void Notify (DOLEvent e, EventArgs args)
IEnumerable GetItemsInRadius (int x, int y, int z, ushort radius, bool withDistance)
 Gets Items in a radius around a spot.
IEnumerable GetNPCsInRadius (int x, int y, int z, ushort radius, bool withDistance, bool ignoreZ)
 Gets NPCs in a radius around a spot.
IEnumerable GetPlayersInRadius (int x, int y, int z, ushort radius, bool withDistance, bool ignoreZ)
 Gets Players in a radius around a spot.
virtual IEnumerable GetDoorsInRadius (int x, int y, int z, ushort radius, bool withDistance)
 Gets Doors in a radius around a spot.
void Relocate ()

Static Public Member Functions

static bool IsAtlantis (int regionId)
 Check if the given region is Atlantis.

Public Attributes

readonly object ObjectsSyncLock = new object()
 Object to lock when changing objects in the array.

Static Public Attributes

static readonly int MINIMUMSIZE = 256
 This is the minimumsize for object array that is allocated when the first object is added to the region must be dividable by 32 (optimization)

Protected Member Functions

IEnumerable GetInRadius (Zone.eGameObjectType type, int x, int y, int z, ushort radius, bool withDistance, bool ignoreZ)
 Gets objects in a radius around a point.

Protected Attributes

GameObject[] m_objects
 This holds all objects inside this region. Their index = their id!
int m_objectsInRegion
 This holds a counter with the absolute count of all objects that are actually in this region.
uint[] m_objectsAllocatedSlots
 This array holds a bitarray Its used to know which slots in region object array are free and what allocated This is used to accelerate inserts a lot.
int m_nextObjectSlot
 This holds the index of a possible next object slot but needs further checks (basically its lastaddedobjectIndex+1)
readonly Hashtable m_graveStones
 This holds the gravestones in this region for fast access Player unique id(string) -> GameGraveStone.
readonly ArrayList m_Zones
 Holds all the Zones inside this Region.
readonly ArrayList m_Areas
 Holds all the Areas inside this Region.
ushort[][] m_ZoneAreas
 Cache for zone area mapping to quickly access all areas within a certain zone.
ushort[] m_ZoneAreasCount
 / Cache for number of items in m_ZoneAreas array.
int m_numPlrs = 0
 Contains the # of players in the region.
readonly GameTimer.TimeManager m_timeManager
 The region time manager.
bool m_isDisabled = false
bool m_loadObjects = true

Static Protected Attributes

static readonly int CLEANUPTIMER = 60000
 How often shall we remove unused objects.

Properties

ArrayList Areas [get]
RegionData RegionData [get, set]
virtual bool IsRvR [get]
virtual bool IsInstance [get]
 Is the Region a temporary instance.
virtual bool IsCustom [get]
 Is this region a standard DAoC region or a custom server region.
virtual bool IsDungeon [get]
 Gets whether this region is a dungeon or not.
virtual int NumPlayers [get]
 Gets the # of players in the region.
virtual string Name [get]
 The Region Name eg. Region000.
virtual string Description [get]
 The Regi on Description eg. Cursed Forest.
virtual ushort ID [get]
 The ID of the Region eg. 21.
string ServerIP [get]
 The Region Server IP ... for future use.
ushort ServerPort [get]
 The Region Server Port ... for future use.
ArrayList Zones [get]
 An ArrayList of all Zones within this Region.
GameObject[] Objects [get]
 Returns the object array of this region.
virtual int Expansion [get]
 Gets or Sets the region expansion (we use client expansion + 1)
virtual int WaterLevel [get]
 Gets or Sets the water level in this region.
virtual bool IsRegionDivingEnabled [get]
 Gets or Sets diving flag for region Note: This flag should normally be checked at the zone level.
virtual bool HousingEnabled [get]
 Does this region contain housing?
virtual bool UseHousingManager [get]
 Should this region use the housing manager? Standard regions always use the housing manager if housing is enabled, custom regions might not.
long LastRelocation [get]
 Gets last relocation time.
GameTimer.TimeManager TimeManager [get]
 Gets the region time manager.
long Time [get]
 Gets the current region time in milliseconds.
virtual bool IsDisabled [get]
 Is this region disabled.
virtual bool LoadObjects [get]
 Will this region load objects.
virtual ushort Skin [get]
 Added to allow instances; the 'appearance' of the region, the map the GameClient uses.
virtual bool UseTimeManager [get, set]
 Should this region respond to time manager send requests Normally yes, might be disabled for some instances.
virtual uint GameTime [get, set]
 Each region can return it's own game time By default let WorldMgr handle it.
virtual uint DayIncrement [get, set]
 Get the day increment for this region. By default let WorldMgr handle it.
bool IsCapitalCity [get]
 Check if this region is a capital city.
bool IsHousing [get]
 Check if this region is a housing zone.

Detailed Description

This class represents a region in DAOC. A region is everything where you need a loadingscreen to go there. Eg. whole Albion is one Region, Midgard and Hibernia are just one region too. Darkness Falls is a region. Each dungeon, city is a region ... you get the clue. Each Region can hold an arbitary number of Zones! Camelot Hills is one Zone, Tir na Nog is one Zone (and one Region)...


Constructor & Destructor Documentation

DOL.GS.Region.Region ( GameTimer.TimeManager  time,
RegionData  data 
)

Constructs a new empty Region.

Parameters:
timeThe time manager for this region
dataThe region data

Member Function Documentation

virtual IArea DOL.GS.Region.AddArea ( IArea  area) [virtual]

Adds an area to the region and updates area-zone cache.

Parameters:
area
Returns:
GameGravestone DOL.GS.Region.FindGraveStone ( GamePlayer  player)

Searches for players gravestone in this region.

Parameters:
player
Returns:
the found gravestone or null
virtual IList DOL.GS.Region.GetAreasOfSpot ( IPoint3D  point) [virtual]

Gets the areas for given location, less performant than getAreasOfZone so use other on if possible.

Parameters:
point
Returns:
virtual IList DOL.GS.Region.GetAreasOfSpot ( int  x,
int  y,
int  z 
) [virtual]

Gets the areas for a certain spot, less performant than getAreasOfZone so use other on if possible.

Parameters:
x
y
z
Returns:
virtual IList DOL.GS.Region.GetAreasOfZone ( Zone  zone,
IPoint3D  p,
bool  checkZ 
) [virtual]

Gets the areas for a certain spot

Parameters:
zone
p
checkZ
Returns:

Reimplemented in DOL.GS.Instance.

virtual IEnumerable DOL.GS.Region.GetDoorsInRadius ( int  x,
int  y,
int  z,
ushort  radius,
bool  withDistance 
) [virtual]

Gets Doors in a radius around a spot.

Parameters:
xorigin X
yorigin Y
zorigin Z
radiusradius around origin
withDistanceGet an ObjectDistance enumerator
Returns:
IEnumerable to be used with foreach
IEnumerable DOL.GS.Region.GetInRadius ( Zone.eGameObjectType  type,
int  x,
int  y,
int  z,
ushort  radius,
bool  withDistance,
bool  ignoreZ 
) [protected]

Gets objects in a radius around a point.

Parameters:
typeOBJECT_TYPE (0=item, 1=npc, 2=player)
xorigin X
yorigin Y
zorigin Z
radiusradius around origin
withDistanceGet an ObjectDistance enumerator
Returns:
IEnumerable to be used with foreach
IEnumerable DOL.GS.Region.GetItemsInRadius ( int  x,
int  y,
int  z,
ushort  radius,
bool  withDistance 
)

Gets Items in a radius around a spot.

Parameters:
xorigin X
yorigin Y
zorigin Z
radiusradius around origin
withDistanceGet an ObjectDistance enumerator
Returns:
IEnumerable to be used with foreach
IEnumerable DOL.GS.Region.GetNPCsInRadius ( int  x,
int  y,
int  z,
ushort  radius,
bool  withDistance,
bool  ignoreZ 
)

Gets NPCs in a radius around a spot.

Parameters:
xorigin X
yorigin Y
zorigin Z
radiusradius around origin
withDistanceGet an ObjectDistance enumerator
Returns:
IEnumerable to be used with foreach
GameObject DOL.GS.Region.GetObject ( ushort  id)

Gets the object with the specified ID.

Parameters:
idThe ID of the object to get
Returns:
The object with the specified ID, null if it didn't exist
IEnumerable DOL.GS.Region.GetPlayersInRadius ( int  x,
int  y,
int  z,
ushort  radius,
bool  withDistance,
bool  ignoreZ 
)

Gets Players in a radius around a spot.

Parameters:
xorigin X
yorigin Y
zorigin Z
radiusradius around origin
withDistanceGet an ObjectDistance enumerator
Returns:
IEnumerable to be used with foreach
int DOL.GS.Region.GetXOffInZone ( int  x,
int  y 
)

Gets the X offset for the specified zone.

Parameters:
xX value for the zone's offset you're retrieving
yY value for the zone's offset you're retrieving
Returns:
The X offset of the zone you specified or 0 if it couldn't be found
int DOL.GS.Region.GetYOffInZone ( int  x,
int  y 
)

Gets the Y offset for the specified zone.

Parameters:
xX value for the zone's offset you're retrieving
yY value for the zone's offset you're retrieving
Returns:
The Y offset of the zone you specified or 0 if it couldn't be found
Zone DOL.GS.Region.GetZone ( int  x,
int  y 
)

Returns the zone that contains the specified x and y values.

Parameters:
xX value for the zone you're retrieving
yY value for the zone you're retrieving
Returns:
The zone you're retrieving or null if it couldn't be found
static bool DOL.GS.Region.IsAtlantis ( int  regionId) [static]

Check if the given region is Atlantis.

Parameters:
regionId
Returns:
void DOL.GS.Region.LoadFromDatabase ( Mob[]  mobObjs,
ref long  mobCount,
ref long  merchantCount,
ref long  itemCount,
ref long  bindCount 
)

Loads the region from database

Parameters:
mobObjs
mobCount
merchantCount
itemCount
bindCount
virtual void DOL.GS.Region.OnCollapse ( ) [virtual]

What to do when the region collapses. This is called when instanced regions need to be closed.

Reimplemented in DOL.GS.Quests.TaskDungeonInstance, DOL.GS.BaseInstance, and DOL.GS.Instance.

virtual bool DOL.GS.Region.OnZonePoint ( GamePlayer  player,
ZonePoint  zonePoint 
) [virtual]

Handles players leaving this region via a zonepoint.

Parameters:
player
zonePoint
Returns:
false to halt processing of this request
void DOL.GS.Region.PreAllocateRegionSpace ( int  count)

Reallocates objects array with given size.

Parameters:
countThe size of new objects array, limited by MAXOBJECTS
virtual void DOL.GS.Region.RemoveArea ( IArea  area) [virtual]

Removes an are from the list of areas and updates area-zone chache.

Parameters:
area
virtual void DOL.GS.Region.SendWeather ( GamePlayer  player) [virtual]

Get the weather manager for this region By default use WeatherMgr.

void DOL.GS.Region.StartRegionMgr ( )

Starts the RegionMgr.

void DOL.GS.Region.StopRegionMgr ( )

Stops the RegionMgr.


Member Data Documentation

readonly int DOL.GS.Region.CLEANUPTIMER = 60000 [static, protected]

How often shall we remove unused objects.

readonly ArrayList DOL.GS.Region.m_Areas [protected]

Holds all the Areas inside this Region.

Areas can be registed to a reagion via AddArea and events will be thrown if players/npcs/objects enter leave area

readonly Hashtable DOL.GS.Region.m_graveStones [protected]

This holds the gravestones in this region for fast access Player unique id(string) -> GameGraveStone.

This holds the index of a possible next object slot but needs further checks (basically its lastaddedobjectIndex+1)

int DOL.GS.Region.m_numPlrs = 0 [protected]

Contains the # of players in the region.

This holds all objects inside this region. Their index = their id!

This array holds a bitarray Its used to know which slots in region object array are free and what allocated This is used to accelerate inserts a lot.

This holds a counter with the absolute count of all objects that are actually in this region.

The region time manager.

ushort [][] DOL.GS.Region.m_ZoneAreas [protected]

Cache for zone area mapping to quickly access all areas within a certain zone.

ushort [] DOL.GS.Region.m_ZoneAreasCount [protected]

/ Cache for number of items in m_ZoneAreas array.

readonly ArrayList DOL.GS.Region.m_Zones [protected]

Holds all the Zones inside this Region.

readonly int DOL.GS.Region.MINIMUMSIZE = 256 [static]

This is the minimumsize for object array that is allocated when the first object is added to the region must be dividable by 32 (optimization)

readonly object DOL.GS.Region.ObjectsSyncLock = new object()

Object to lock when changing objects in the array.


Property Documentation

virtual uint DOL.GS.Region.DayIncrement [get, set]

Get the day increment for this region. By default let WorldMgr handle it.

virtual string DOL.GS.Region.Description [get]

The Regi on Description eg. Cursed Forest.

Reimplemented in DOL.GS.BaseInstance.

virtual int DOL.GS.Region.Expansion [get]

Gets or Sets the region expansion (we use client expansion + 1)

virtual uint DOL.GS.Region.GameTime [get, set]

Each region can return it's own game time By default let WorldMgr handle it.

virtual bool DOL.GS.Region.HousingEnabled [get]

Does this region contain housing?

virtual ushort DOL.GS.Region.ID [get]

The ID of the Region eg. 21.

Reimplemented in DOL.GS.BaseInstance.

bool DOL.GS.Region.IsCapitalCity [get]

Check if this region is a capital city.

Returns:
True, if region is a capital city, else false
virtual bool DOL.GS.Region.IsCustom [get]

Is this region a standard DAoC region or a custom server region.

virtual bool DOL.GS.Region.IsDisabled [get]

Is this region disabled.

virtual bool DOL.GS.Region.IsDungeon [get]

Gets whether this region is a dungeon or not.

bool DOL.GS.Region.IsHousing [get]

Check if this region is a housing zone.

Returns:
True, if region is a housing zone, else false
virtual bool DOL.GS.Region.IsInstance [get]

Is the Region a temporary instance.

Reimplemented in DOL.GS.BaseInstance.

virtual bool DOL.GS.Region.IsRegionDivingEnabled [get]

Gets or Sets diving flag for region Note: This flag should normally be checked at the zone level.

long DOL.GS.Region.LastRelocation [get]

Gets last relocation time.

virtual bool DOL.GS.Region.LoadObjects [get]

Will this region load objects.

virtual string DOL.GS.Region.Name [get]

The Region Name eg. Region000.

Reimplemented in DOL.GS.BaseInstance.

virtual int DOL.GS.Region.NumPlayers [get]

Gets the # of players in the region.

GameObject [] DOL.GS.Region.Objects [get]

Returns the object array of this region.

string DOL.GS.Region.ServerIP [get]

The Region Server IP ... for future use.

ushort DOL.GS.Region.ServerPort [get]

The Region Server Port ... for future use.

virtual ushort DOL.GS.Region.Skin [get]

Added to allow instances; the 'appearance' of the region, the map the GameClient uses.

Reimplemented in DOL.GS.BaseInstance.

long DOL.GS.Region.Time [get]

Gets the current region time in milliseconds.

GameTimer.TimeManager DOL.GS.Region.TimeManager [get]

Gets the region time manager.

virtual bool DOL.GS.Region.UseHousingManager [get]

Should this region use the housing manager? Standard regions always use the housing manager if housing is enabled, custom regions might not.

virtual bool DOL.GS.Region.UseTimeManager [get, set]

Should this region respond to time manager send requests Normally yes, might be disabled for some instances.

virtual int DOL.GS.Region.WaterLevel [get]

Gets or Sets the water level in this region.

ArrayList DOL.GS.Region.Zones [get]

An ArrayList of all Zones within this Region.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events