MudEngine:

- Set the Game.PlayerCollection property to Protected. You can no longer modify this list unless the class inherits from Game. Only 1 script is allowed to inherit from Game.
 - Created Game.GetPlayerCollection() method for retrieving a read-only reference to the playerCollection so scripts can access player data it might needs.
 - Updated various classes and scripts due to no longer being able to access the PlayerCollection property.
This commit is contained in:
Scionwest_cp 2010-08-20 14:55:06 -07:00
parent 386d90df19
commit c7d227745c
11 changed files with 69 additions and 38 deletions

View file

@ -29,18 +29,18 @@ namespace MudEngine.Commands
if (player.ActiveGame.IsMultiplayer)
{
//Let other players know that the user walked in.
for (Int32 i = 0; i != player.ActiveGame.PlayerCollection.Length; i++)
for (Int32 i = 0; i != player.ActiveGame.GetPlayerCollection().Length; i++)
{
if (player.ActiveGame.PlayerCollection[i].Name == player.Name)
if (player.ActiveGame.GetPlayerCollection()[i].Name == player.Name)
continue;
String room = player.ActiveGame.PlayerCollection[i].CurrentRoom.Name;
String realm = player.ActiveGame.PlayerCollection[i].CurrentRoom.Realm;
String zone = player.ActiveGame.PlayerCollection[i].CurrentRoom.Zone;
String room = player.ActiveGame.GetPlayerCollection()[i].CurrentRoom.Name;
String realm = player.ActiveGame.GetPlayerCollection()[i].CurrentRoom.Realm;
String zone = player.ActiveGame.GetPlayerCollection()[i].CurrentRoom.Zone;
if ((room == player.CurrentRoom.Name) && (realm == player.CurrentRoom.Realm) && (zone == player.CurrentRoom.Zone))
{
player.ActiveGame.PlayerCollection[i].Send(player.Name + " has left.");
player.ActiveGame.GetPlayerCollection()[i].Send(player.Name + " has left.");
}
}