public MudObject AddScenery(String Description, params String[] Nouns) { var scenery = new MudObject(); scenery.SetProperty("scenery?", true); scenery.SetProperty("long", Description); foreach (var noun in Nouns) { scenery.AddNoun(noun.ToUpper()); } AddScenery(scenery); return(scenery); }
internal static ClientAcceptanceStatus ClientConnected(NetworkClient Client) { var ban = ProscriptionList.IsBanned(Client.IPString); if (ban.Banned) { Core.LogError("Rejected connection from " + Client.IPString + ". Matched ban " + ban.SourceBan.Glob + " Reason: " + ban.SourceBan.Reason); return(ClientAcceptanceStatus.Rejected); } ClientLock.WaitOne(); var dummyPlayer = new MudObject(); dummyPlayer.Actor(); dummyPlayer.SetProperty("command handler", new LoginCommandHandler()); Core.TiePlayerToClient(Client, dummyPlayer); Core.SendMessage(Client, Core.SettingsObject.Banner); Core.SendMessage(Client, Core.SettingsObject.MessageOfTheDay); ConnectedClients.Add(Client); Core.SendPendingMessages(); ClientLock.ReleaseMutex(); return(ClientAcceptanceStatus.Accepted); }
public static List <MudObject> InitializeConversationTopics(this MudObject To) { if (!To.HasProperty("conversation-topics")) { To.SetProperty("conversation-topics", new List <MudObject>()); } return(To.GetProperty <List <MudObject> >("conversation-topics")); }
public MudObject AddScenery(String Description, params String[] Nouns) { var scenery = new MudObject(); scenery.SetProperty("scenery?", true); scenery.Long = Description; foreach (var noun in Nouns) scenery.Nouns.Add(noun.ToUpper()); AddScenery(scenery); return scenery; }
public void OpenLink(Direction Direction, String Destination, MudObject Portal = null) { if (RemoveAll(thing => thing.GetProperty <Direction>("link direction") == Direction && thing.GetProperty <bool>("portal?")) > 0) { Core.LogWarning("Opened duplicate link in " + Path); } if (Portal == null) { Portal = new MudObject(); Portal.SetProperty("link anonymous?", true); Portal.SetProperty("short", "link " + Direction + " to " + Destination); } Portal.SetProperty("portal?", true); Portal.SetProperty("link direction", Direction); Portal.SetProperty("link destination", Destination); Portal.Location = this; Add(Portal, RelativeLocations.CONTENTS); }
public static void OfferQuest(this MudObject This, MudObject Actor, MudObject Quest) { if (Actor != null) { Core.SendMessage(Actor, "[To accept this quest, enter the command 'accept quest'.]"); if (Actor.GetProperty <MudObject>("active-quest") != null) { Core.SendMessage(Actor, "[Accepting this quest will abandon your active quest.]"); } Actor.SetProperty("offered-quest", Quest); } }
private static void RememberActor(MudObject Player, MudObject Actor) { if (String.IsNullOrEmpty(Actor.Path)) { return; // Don't remember unimportant mobs. } if (!Player.HasProperty("introduction memory")) { Player.SetProperty("introduction memory", new Dictionary <string, bool>()); } Player.GetProperty <Dictionary <String, bool> >("introduction memory").Upsert(Actor.Path, true); }
public void OpenLink(Direction Direction, String Destination, MudObject Portal = null) { if (RemoveAll(thing => thing.GetPropertyOrDefault<Direction>("link direction", RMUD.Direction.NOWHERE) == Direction && thing.GetPropertyOrDefault<bool>("portal?", false)) > 0) Core.LogWarning("Opened duplicate link in " + Path); if (Portal == null) { Portal = new MudObject(); Portal.SetProperty("link anonymous?", true); Portal.Short = "link " + Direction + " to " + Destination; } Portal.SetProperty("portal?", true); Portal.SetProperty("link direction", Direction); Portal.SetProperty("link destination", Destination); Portal.Location = this; Add(Portal, RelativeLocations.Contents); }
public void OpenLink(Direction Direction, String Destination, MudObject Portal = null) { if (RemoveAll(thing => thing.GetPropertyOrDefault <Direction>("link direction", RMUD.Direction.NOWHERE) == Direction && thing.GetPropertyOrDefault <bool>("portal?", false)) > 0) { Core.LogWarning("Opened duplicate link in " + Path); } if (Portal == null) { Portal = new MudObject(); Portal.SetProperty("link anonymous?", true); Portal.Short = "link " + Direction + " to " + Destination; } Portal.SetProperty("portal?", true); Portal.SetProperty("link direction", Direction); Portal.SetProperty("link destination", Destination); Portal.Location = this; Add(Portal, RelativeLocations.Contents); }
public static void RemovePlayer(MudObject Actor) { GlobalRules.ConsiderPerformRule("player left", Actor); Actor.SetProperty("client", null); Move(Actor, null); }
public static void AddPlayer(MudObject Actor) { Actor.SetProperty("rank", 500); GlobalRules.ConsiderPerformRule("player joined", Actor); }
public static void TiePlayerToClient(Client Client, MudObject Actor) { Client.Player = Actor; Actor.SetProperty("client", Client); }
public void AddScenery(MudObject Scenery) { Scenery.SetProperty("scenery?", true); Add(Scenery, RelativeLocations.Contents); Scenery.Location = this; }
public void AddScenery(MudObject Scenery) { Scenery.SetProperty("scenery?", true); Add(Scenery, RelativeLocations.Contents); Scenery.Location = this; }