public void UnshareDoors(PList.Player exfriend, Fougerite.Player unsharing) { ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share"); ((ArrayList)command.GetSharedDoors()[unsharing.UID]).Remove(exfriend.UserID); unsharing.MessageFrom(Core.Name, string.Format(yellow + "☢" + green + "Player:" + yellow + " {0} " + green + "can no longer open your doors.", exfriend.DisplayName)); Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(exfriend.UserID.ToString()); if (client != null) { client.MessageFrom(Core.Name, string.Format(yellow + "☢" + green + "You can no longer open: " + yellow + "{0}'s" + green + " doors.", unsharing.Name)); } }
public void UnshareDoors(PList.Player exfriend, Fougerite.Player unsharing) { ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share"); ((ArrayList)command.GetSharedDoors()[unsharing.UID]).Remove(exfriend.UserID); unsharing.MessageFrom(Core.Name, string.Format("{0} can use your doors no longer.", exfriend.DisplayName)); Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(exfriend.UserID.ToString()); if (client != null) { client.MessageFrom(Core.Name, string.Format("{0} is no longer sharing his doors with you.", unsharing.Name)); } }
public void UnshareDoors(PList.Player exfriend, Fougerite.Player unsharing) { ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share"); ((ArrayList)command.GetSharedDoors()[unsharing.UID]).Remove(exfriend.UserID); unsharing.MessageFrom(Core.Name, string.Format("{0} ya no podrá abrir las puertas de tu casa.", exfriend.DisplayName)); Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(exfriend.UserID.ToString()); if (client != null) { client.MessageFrom(Core.Name, string.Format("{0} te quitó el permiso de abrir sus puertas.", unsharing.Name)); } }
public void UnshareDoors(PList.Player exfriend, NetUser unsharing) { ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share"); ArrayList list = (ArrayList)command.GetSharedDoors()[unsharing.userID]; list.Remove(exfriend.UserID); Util.sayUser(unsharing.networkPlayer, Core.Name, string.Format("{0} can use your doors no longer.", exfriend.DisplayName)); PlayerClient client; if (PlayerClient.FindByUserID(exfriend.UserID, out client)) { Util.sayUser(client.netPlayer, Core.Name, string.Format("{0} is no longer sharing his doors with you.", unsharing.displayName)); } }
public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments) { string str = ""; for (int i = 0; i < ChatArguments.Length; i++) { str = str + ChatArguments[i] + " "; } str = str.Trim(); if ((ChatArguments != null) || (str == "")) { if (str != null) { foreach (PlayerClient client in PlayerClient.All) { ulong userID = client.userID; ulong num3 = Arguments.argUser.userID; if (client.netUser.displayName.ToLower() == str.ToLower()) { if (userID == num3) { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Why would you unshare with yourself?"); return; } ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share"); ArrayList list = (ArrayList)command.GetSharedDoors()[num3]; if ((list != null) && list.Contains(userID)) { list.Remove(userID); Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have stopped sharing doors with " + client.netUser.displayName); Util.sayUser(client.netPlayer, Core.Name, Arguments.argUser.displayName + " has stopped sharing doors with you"); return; } } } Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "No player found with the name: " + str); } } else { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Sharing Doors Usage: /unshare \"playerName\""); } }
public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments) { var pl = Fougerite.Server.Cache[Arguments.argUser.userID]; string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' }); if (playerName == string.Empty) { pl.MessageFrom(Core.Name, "Sharing Doors Usage: /unshare playerName"); return; } ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share"); ArrayList shareList = (ArrayList)command.GetSharedDoors()[Arguments.argUser.userID]; if (shareList == null) { pl.MessageFrom(Core.Name, "You aren't sharing doors with anyone."); return; } PList list = new PList(); list.Add(0, "Cancel"); foreach (ulong id in shareList) { if (Core.userCache.ContainsKey(id)) { if (Core.userCache[id].Equals(playerName, StringComparison.OrdinalIgnoreCase)) { UnshareDoors(new PList.Player(id, Core.userCache[id]), pl); } else if (Core.userCache[id].ToUpperInvariant().Contains(playerName.ToUpperInvariant())) { list.Add(id, Core.userCache[id]); } } else { Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(id.ToString()); if (client != null) { if (client.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase)) { UnshareDoors(new PList.Player(id, client.Name), pl); } else if (Core.userCache[id].ToUpperInvariant().Contains(playerName.ToUpperInvariant())) { list.Add(id, Core.userCache[id]); } } } } if (list.Count == 1) { pl.MessageFrom(Core.Name, string.Format("You aren't sharing doors with {0}.", playerName)); return; } pl.MessageFrom(Core.Name, string.Format("{0} players{1} {2}: ", ((list.Count - 1)).ToString(), (((list.Count - 1) > 1) ? "s match" : " matches"), playerName)); for (int i = 1; i < list.Count; i++) { pl.MessageFrom(Core.Name, string.Format("{0} - {1}", i, list.PlayerList[i].DisplayName)); } pl.MessageFrom(Core.Name, "0 - Cancel"); pl.MessageFrom(Core.Name, "Please enter the number matching the player you won't share doors with."); Core.unshareWaitList[pl.UID] = list; }
public void DeleteDoors(ulong UID, Fougerite.Player player) { ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share"); ((ArrayList)command.GetSharedDoors()[UID]).Remove(player.UID); }