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

@ -27,18 +27,18 @@ namespace MudEngine.Commands
{
String path = player.ActiveGame.DataPaths.Players;
for (Int32 i = 0; i < player.ActiveGame.PlayerCollection.Length; i++)
for (Int32 i = 0; i < player.ActiveGame.GetPlayerCollection().Length; i++)
{
String filename = Path.Combine(path, player.ActiveGame.PlayerCollection[i].Filename);
player.ActiveGame.PlayerCollection[i].Save(filename);
String filename = Path.Combine(path, player.ActiveGame.GetPlayerCollection()[i].Filename);
player.ActiveGame.GetPlayerCollection()[i].Save(filename);
}
//player.ActiveGame.Server.EndServer(); //-Handled in Game.Shutdown() below.
player.ActiveGame.Shutdown();
player.ActiveGame.Start();
/* Game.Start() calls this, do we need a reference to the playercollection?
/* Game.Start() calls this, do we need a reference to the GetPlayerCollection()?
* They should be unloaded anyway and re-loaded during game.start to force a clean restart of all objects.
player.ActiveGame.Server.Initialize(555, ref player.ActiveGame.PlayerCollection);
player.ActiveGame.Server.Initialize(555, ref player.ActiveGame.GetPlayerCollection());
*/
Log.Write("Server Restart Completed.");