internal void AddPlayer(string residentPlayer, string newResident, RegionList region) { Residents.Add(newResident); RegionLoader.Save(region); Log.WritePlayer(residentPlayer, "Region added resident " + newResident); Client nr = PlayerList.GetPlayerByName(newResident); if (nr != null) { nr.TellSystem(Chat.Aqua, residentPlayer + " added you to " + Name); RegionCrossing.SetRegion(nr.Session); } }
/// <summary> /// Change the region protection type /// </summary> public void SetType(Client player, string type) { if (ResidentPermissions(player) == false) { player.TellSystem(Chat.Yellow, " You are not a resident of this region"); return; } type = type.ToLowerInvariant().Trim(); switch (type) { case "": //public case PublicType.Type: case Protected.Type: case Adventure.Type: case SpawnRegion.Type: break; //OK default: if (player.Admin() == false) { player.TellSystem(Chat.Red, "Unknown type: " + type); player.TellSystem(Chat.Yellow, "Choose one of: public, protected, adventure, night"); return; } else { player.TellSystem(Chat.Yellow, "Custom type: " + type); } break; } Type = type; player.TellSystem(Chat.Aqua, "Region type is now: " + type); RegionLoader.Save(player.Session.World.Regions); //Update all players foreach (Client c in PlayerList.List) { if (c.Session.CurrentRegion == this) { RegionCrossing.SetRegion(c.Session); } } }