protected override void Load() { base.Load(); Instance = this; Logger.LogWarning("\n Loading SendURL, made by Mr.Kwabs..."); Logger.LogWarning($"\n Default URL Description: {Instance.Configuration.Instance.DefaultDescription}"); Logger.LogWarning("\n Successfully loaded SendURL, made by Mr.Kwabs!"); }
public void Execute(IRocketPlayer caller, params string[] command) { string Description; try { Description = command[2]; } catch (IndexOutOfRangeException) { Description = SendURL.Instance.Configuration.Instance.DefaultDescription; } string URL = SendURL.ValidateURL(command[1]); if (URL == "FALSE") { UnturnedChat.Say(caller, "That is an incorrect URL!", Color.red); return; } if (command[0] == "*") { foreach (SteamPlayer Victim in Provider.clients) { SendURL.Instance.URLSend(UnturnedPlayer.FromSteamPlayer(Victim), URL, Description); } Logger.LogWarning($"{caller.DisplayName} has sent a URL [{URL}] to Everyone."); UnturnedChat.Say(caller, $"Successfully sent a URL to Everyone.", Color.yellow); } else { UnturnedPlayer Victim = null; try { Victim = UnturnedPlayer.FromName(command[0]); string VictimName = Victim.DisplayName; } catch { UnturnedChat.Say(caller, "User not found!", Color.red); return; } SendURL.Instance.URLSend(Victim, URL, Description); Logger.LogWarning($"{caller.DisplayName} has sent a URL [{URL}] to {Victim.DisplayName}."); UnturnedChat.Say(caller, $"Successfully sent a URL to {Victim.DisplayName}.", Color.yellow); } }
protected override void Unload() { Instance = null; base.Unload(); }