Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
BIN
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Beta 6.doc
Normal file
BIN
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Beta 6.doc
Normal file
Binary file not shown.
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Alliance : Channel
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
new Alliance();
|
||||
}
|
||||
|
||||
public Alliance() : base("Alliance")
|
||||
{
|
||||
Commands.Add("ally");
|
||||
Commands.Add("a");
|
||||
DefaultC = 0x9E;
|
||||
|
||||
Register(this);
|
||||
}
|
||||
|
||||
public override bool CanChat(Mobile m, bool say)
|
||||
{
|
||||
if (m.Guild == null)
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(36));
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanChat(m, say);
|
||||
}
|
||||
|
||||
protected override void Broadcast(Mobile m, string msg)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
if (data.Mobile.AccessLevel >= m.AccessLevel && ((data.GlobalG && !data.GIgnores.Contains(m)) || data.GListens.Contains(m)))
|
||||
data.Mobile.SendMessage(data.GlobalGC, String.Format("(Alliance) <{0}> {1}: {2}", NameFor(m), m.Name, msg ));
|
||||
else if (data.Channels.Contains(Name) && !data.Ignores.Contains(m))
|
||||
{
|
||||
if (data.Mobile.Guild == null || m.Guild == null)
|
||||
continue;
|
||||
|
||||
if (data.Mobile.Guild != m.Guild && !((Server.Guilds.Guild)data.Mobile.Guild).Allies.Contains((Server.Guilds.Guild)m.Guild))
|
||||
continue;
|
||||
|
||||
data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? data.ColorFor(this) : Data.GetData(m).StaffC, String.Format("<{0}{1}> {2}: {3}", NameFor(m), (Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GumpOptions(GumpPlus g, int x, int y)
|
||||
{
|
||||
// Options like guild menu access, guildmaster options
|
||||
|
||||
base.GumpOptions(g, x, y);
|
||||
}
|
||||
|
||||
public override ArrayList BuildList(Mobile m)
|
||||
{
|
||||
ArrayList list = base.BuildList(m);
|
||||
|
||||
foreach (Mobile mob in new ArrayList(list))
|
||||
if (mob.Guild == null || m.Guild == null || (mob.Guild != m.Guild && !((Server.Guilds.Guild)mob.Guild).Allies.Contains((Server.Guilds.Guild)m.Guild)))
|
||||
list.Remove(mob);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
338
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Channel.cs
Normal file
338
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Channel.cs
Normal file
@@ -0,0 +1,338 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.HuePickers;
|
||||
using Server.Gumps;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public enum ChatStyle { Global, Regional }
|
||||
|
||||
public class Channel
|
||||
{
|
||||
private static ArrayList s_Channels = new ArrayList();
|
||||
|
||||
public static ArrayList Channels { get{ return s_Channels; } }
|
||||
|
||||
public static void Register(Channel c)
|
||||
{
|
||||
foreach (string str in c.Commands)
|
||||
CommandSystem.Register(str, AccessLevel.Player, new CommandEventHandler(ChannelCommand));
|
||||
}
|
||||
|
||||
public static Channel GetByName(string str)
|
||||
{
|
||||
foreach (Channel c in s_Channels)
|
||||
if (c.Name == str)
|
||||
return c;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void ChannelCommand(CommandEventArgs args)
|
||||
{
|
||||
foreach (Channel c in s_Channels)
|
||||
foreach (string str in c.Commands)
|
||||
if (str == args.Command)
|
||||
{
|
||||
c.OnChat(args.Mobile, args.ArgString);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddCommand(string str)
|
||||
{
|
||||
CommandSystem.Register(str, AccessLevel.Player, new CommandEventHandler(ChannelCommand));
|
||||
}
|
||||
|
||||
public static void RemoveCommand(string str)
|
||||
{
|
||||
CommandSystem.Entries.Remove(str);
|
||||
}
|
||||
|
||||
public static void Save()
|
||||
{
|
||||
if (!Directory.Exists("Saves/Chat/"))
|
||||
Directory.CreateDirectory("Saves/Chat/");
|
||||
|
||||
GenericWriter writer = new BinaryFileWriter(Path.Combine("Saves/Chat/", "Channels34.bin"), true);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
foreach (Channel c in s_Channels)
|
||||
if (c.Mod)
|
||||
list.Add(c);
|
||||
|
||||
writer.Write(list.Count);
|
||||
foreach (Channel c in list)
|
||||
c.Save(writer);
|
||||
|
||||
writer.Close();
|
||||
}
|
||||
|
||||
public static void Load()
|
||||
{
|
||||
if ( !File.Exists( Path.Combine( "Saves/Chat/", "Channels34.bin" ) ) )
|
||||
return;
|
||||
|
||||
using (FileStream bin = new FileStream(Path.Combine("Saves/Chat/", "Channels34.bin"), FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
GenericReader reader = new BinaryFileReader(new BinaryReader(bin));
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
Channel c;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
c = new Channel("");
|
||||
c.Load(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Class Definitions
|
||||
|
||||
private string c_Name;
|
||||
private ArrayList c_Commands;
|
||||
private int c_DefaultC;
|
||||
private ChatStyle c_Style;
|
||||
private bool c_Mod, c_ToIrc, c_NewChars;
|
||||
|
||||
public string Name { get { return c_Name; } set { c_Name = value; } }
|
||||
public ArrayList Commands { get { return c_Commands; } }
|
||||
public int DefaultC { get { return c_DefaultC; } set { c_DefaultC = value; } }
|
||||
public ChatStyle Style { get { return c_Style; } set { c_Style = value; } }
|
||||
public bool Mod { get { return c_Mod; } set { c_Mod = value; } }
|
||||
public bool ToIrc { get { return c_ToIrc; } set { c_ToIrc = value; } }
|
||||
public bool NewChars { get { return c_NewChars; } set { c_NewChars = value; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Channel( string name )
|
||||
{
|
||||
c_Name = name;
|
||||
|
||||
c_Commands = new ArrayList();
|
||||
c_DefaultC = 0x47E;
|
||||
|
||||
s_Channels.Add(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public virtual string NameFor(Mobile m)
|
||||
{
|
||||
if (c_Style == ChatStyle.Regional && m.Region != null && m.Region.Name != "")
|
||||
return c_Name + " (" + m.Region.Name + ")";
|
||||
|
||||
return c_Name;
|
||||
}
|
||||
|
||||
public virtual bool CanChat(Mobile m, bool say)
|
||||
{
|
||||
if (Data.GetData(m).Banned)
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(33));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (c_Style == ChatStyle.Regional && (m.Region == null || m.Region.Name == ""))
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(35));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnChat(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 2 || !(obj[0] is Mobile) || !(obj[1] is string))
|
||||
return;
|
||||
|
||||
OnChat((Mobile)obj[0], obj[1].ToString(), false);
|
||||
}
|
||||
|
||||
public virtual void OnChat(Mobile m, string msg)
|
||||
{
|
||||
OnChat(m, msg, true);
|
||||
}
|
||||
|
||||
public virtual void OnChat(Mobile m, string msg, bool spam)
|
||||
{
|
||||
if (msg == null || msg == "")
|
||||
{
|
||||
if( Data.GetData(m).Channels.Contains(c_Name))
|
||||
Data.GetData(m).CurrentChannel = this;
|
||||
|
||||
ChannelGump.SendTo(m);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CanChat(m, true))
|
||||
return;
|
||||
|
||||
msg = Filter.FilterText(m, msg);
|
||||
|
||||
if (!CanChat(m, false))
|
||||
return;
|
||||
|
||||
if (!Data.GetData(m).Channels.Contains(c_Name))
|
||||
{
|
||||
m.SendMessage(Data.GetData(m).SystemC, General.Local(34));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TrackSpam.LogSpam(m, "Chat", TimeSpan.FromSeconds(Data.ChatSpam)))
|
||||
{
|
||||
if (spam) m.SendMessage(Data.GetData(m).SystemC, General.Local(97));
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(4), new TimerStateCallback(OnChat), new object[] { m, msg });
|
||||
return;
|
||||
}
|
||||
|
||||
Broadcast(m, msg);
|
||||
|
||||
if (c_ToIrc && IrcConnection.Connection.Connected)
|
||||
IrcConnection.Connection.SendUserMessage(m, "(" + c_Name + ") " + msg);
|
||||
}
|
||||
|
||||
protected virtual void Broadcast(Mobile m, string msg)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
if (data.Channels.Contains(c_Name) && !data.Ignores.Contains(m))
|
||||
{
|
||||
if (c_Style == ChatStyle.Regional && data.Mobile.Region != m.Region)
|
||||
continue;
|
||||
|
||||
data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? data.ColorFor(this) : Data.GetData(m).StaffC, String.Format("<{0}{1}> {2}: {3}", c_Name, (c_Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
|
||||
}
|
||||
else if (data.Mobile.AccessLevel >= m.AccessLevel && ((data.GlobalC && !data.GIgnores.Contains(m)) || data.GListens.Contains(m)))
|
||||
data.Mobile.SendMessage(data.GlobalCC, String.Format("(Global) <{0}{1}> {2}: {3}", c_Name, (c_Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg ));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void GumpOptions( GumpPlus g, int x, int y )
|
||||
{
|
||||
int oldY = y;
|
||||
|
||||
g.AddHtml(x, y + 10, 300, 21, HTML.White + "<CENTER>" + c_Name + " " + General.Local(40), false, false);
|
||||
|
||||
string txt = HTML.White + General.Local(42) + ":";
|
||||
|
||||
foreach (string str in Data.GetData(g.Owner).CurrentChannel.Commands)
|
||||
txt += " " + str;
|
||||
|
||||
g.AddHtml(x + 30, y += 30, 170, 21, txt, false, false);
|
||||
|
||||
g.AddHtml(x + 130, y += 25, 120, 21, HTML.White + c_Name + " " + General.Local(49), false, false);
|
||||
g.AddImage(x + 100, y, 0x2342, Data.GetData(g.Owner).ColorFor(this));
|
||||
g.AddButton(x + 104, y + 4, 0x2716, 0x2716, "Channel Color", new TimerStateCallback(ChannelColor), g);
|
||||
|
||||
g.Entries.Insert( 0, new GumpBackground(x, oldY, 300, y-oldY+40, 0x1400));
|
||||
}
|
||||
|
||||
public virtual ArrayList BuildList(Mobile m)
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
if (m.AccessLevel < data.Mobile.AccessLevel && !Data.ShowStaff)
|
||||
continue;
|
||||
|
||||
if (!data.Channels.Contains(c_Name))
|
||||
continue;
|
||||
|
||||
if (data.Status == OnlineStatus.Hidden && data.Mobile.AccessLevel >= m.AccessLevel)
|
||||
continue;
|
||||
|
||||
list.Add(data.Mobile);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private void ChannelColor(object o)
|
||||
{
|
||||
if (!(o is GumpPlus))
|
||||
return;
|
||||
|
||||
((GumpPlus)o).Owner.SendHuePicker(new InternalPicker((GumpPlus)o, this));
|
||||
}
|
||||
|
||||
private void Save(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0); // Version
|
||||
|
||||
writer.Write(c_Name);
|
||||
writer.Write((int)c_Style);
|
||||
writer.Write(c_ToIrc);
|
||||
writer.Write(c_NewChars);
|
||||
|
||||
writer.Write(c_Commands.Count);
|
||||
foreach (string str in c_Commands)
|
||||
writer.Write(str);
|
||||
}
|
||||
|
||||
private void Load(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
c_Name = reader.ReadString();
|
||||
c_Style = (ChatStyle)reader.ReadInt();
|
||||
c_ToIrc = reader.ReadBool();
|
||||
c_NewChars = reader.ReadBool();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; ++i)
|
||||
c_Commands.Add(reader.ReadString());
|
||||
|
||||
foreach (string str in c_Commands)
|
||||
AddCommand(str);
|
||||
|
||||
c_Mod = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Classes
|
||||
|
||||
protected class InternalPicker : HuePicker
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
private Channel c_Chan;
|
||||
|
||||
public InternalPicker(GumpPlus g, Channel c) : base(0x1018)
|
||||
{
|
||||
c_Gump = g;
|
||||
c_Chan = c;
|
||||
}
|
||||
|
||||
public override void OnResponse(int hue)
|
||||
{
|
||||
Data.GetData(c_Gump.Owner).ChannelColors[c_Chan.Name] = hue;
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
69
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Faction.cs
Normal file
69
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Faction.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Faction : Channel
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
new Faction();
|
||||
}
|
||||
|
||||
public Faction() : base("Faction")
|
||||
{
|
||||
Commands.Add("faction");
|
||||
Commands.Add("f");
|
||||
DefaultC = 0x17;
|
||||
|
||||
Register(this);
|
||||
}
|
||||
|
||||
public override bool CanChat(Mobile m, bool say)
|
||||
{
|
||||
if (!General.IsInFaction(m))
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(37));
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanChat(m, say);
|
||||
}
|
||||
|
||||
protected override void Broadcast(Mobile m, string msg)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
if (data.Channels.Contains(Name) && !data.Ignores.Contains(m))
|
||||
{
|
||||
if (data.Mobile.Guild != m.Guild)
|
||||
continue;
|
||||
|
||||
data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? data.ColorFor(this) : Data.GetData(m).StaffC, String.Format("<{0}{1}> {2}: {3}", NameFor(m), (Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
|
||||
}
|
||||
else if (data.Mobile.AccessLevel >= m.AccessLevel && (data.GlobalF || data.GListens.Contains(m)))
|
||||
data.Mobile.SendMessage(data.GlobalFC, String.Format("(Global) <{0}> {1}: {2}", NameFor(m), m.Name, msg));
|
||||
}
|
||||
}
|
||||
|
||||
public override void GumpOptions(GumpPlus g, int x, int y)
|
||||
{
|
||||
// Not sure what faction options I will have
|
||||
|
||||
base.GumpOptions(g, x, y);
|
||||
}
|
||||
|
||||
public override ArrayList BuildList(Mobile m)
|
||||
{
|
||||
ArrayList list = base.BuildList(m);
|
||||
|
||||
foreach (Mobile mob in new ArrayList(list))
|
||||
if (General.FactionName(mob) != General.FactionName(m))
|
||||
list.Remove(mob);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
73
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Guild.cs
Normal file
73
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Guild.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Guild : Channel
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
new Guild();
|
||||
}
|
||||
|
||||
public Guild() : base("Guild")
|
||||
{
|
||||
Commands.Add("guild");
|
||||
Commands.Add("g");
|
||||
DefaultC = 0x44;
|
||||
|
||||
Register(this);
|
||||
}
|
||||
|
||||
public override string NameFor(Mobile m)
|
||||
{
|
||||
if (m.Guild == null)
|
||||
return Name;
|
||||
|
||||
if (m.Guild.Abbreviation == "")
|
||||
return Name;
|
||||
|
||||
return m.Guild.Abbreviation;
|
||||
}
|
||||
|
||||
public override bool CanChat(Mobile m, bool say)
|
||||
{
|
||||
if (m.Guild == null)
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(36));
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanChat(m, say);
|
||||
}
|
||||
|
||||
protected override void Broadcast(Mobile m, string msg)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
if (data.Mobile.AccessLevel >= m.AccessLevel && ((data.GlobalG && !data.GIgnores.Contains(m)) || data.GListens.Contains(m)))
|
||||
data.Mobile.SendMessage(data.GlobalGC, String.Format("(Global) <{0}> {1}: {2}", NameFor(m), m.Name, msg));
|
||||
else if (data.Channels.Contains(Name) && !data.Ignores.Contains(m))
|
||||
{
|
||||
if (data.Mobile.Guild != m.Guild)
|
||||
continue;
|
||||
|
||||
data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? data.ColorFor(this) : Data.GetData(m).StaffC, String.Format("<{0}{1}> {2}: {3}", NameFor(m), (Style == ChatStyle.Regional && m.Region != null ? "-" + m.Region.Name : ""), m.Name, msg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override ArrayList BuildList(Mobile m)
|
||||
{
|
||||
ArrayList list = base.BuildList(m);
|
||||
|
||||
foreach (Mobile mob in new ArrayList(list))
|
||||
if (mob.Guild != m.Guild)
|
||||
list.Remove(mob);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
110
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Irc.cs
Normal file
110
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Irc.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class IRC : Channel
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
new IRC();
|
||||
}
|
||||
|
||||
public IRC() : base("IRC")
|
||||
{
|
||||
Commands.Add("irc");
|
||||
Commands.Add("i");
|
||||
DefaultC = 0x1FC;
|
||||
|
||||
Register(this);
|
||||
}
|
||||
|
||||
public override string NameFor(Mobile m)
|
||||
{
|
||||
return Data.IrcRoom;
|
||||
}
|
||||
|
||||
public override bool CanChat(Mobile m, bool say)
|
||||
{
|
||||
if (IrcConnection.Connection == null || !IrcConnection.Connection.Connected)
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(158));
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanChat(m, say);
|
||||
}
|
||||
|
||||
public void Broadcast(string name, string msg)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
if (data.Channels.Contains(Name) && !data.IrcIgnores.Contains(name))
|
||||
data.Mobile.SendMessage(data.ColorFor(this), msg);
|
||||
}
|
||||
|
||||
protected override void Broadcast(Mobile m, string msg)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
if (data.Channels.Contains(Name) && !data.Ignores.Contains(m))
|
||||
data.Mobile.SendMessage(m.AccessLevel == AccessLevel.Player ? data.ColorFor(this) : Data.GetData(m).StaffC, String.Format("<{0}> {1}: {2}", NameFor(m), m.Name, msg));
|
||||
|
||||
IrcConnection.Connection.SendUserMessage(m, msg);
|
||||
}
|
||||
|
||||
public override void GumpOptions(GumpPlus g, int x, int y)
|
||||
{
|
||||
int oldY = y;
|
||||
|
||||
g.AddHtml(x, y + 10, 300, 21, HTML.White + "<CENTER>" + Name + " " + General.Local(40), false, false);
|
||||
|
||||
string txt = HTML.White + General.Local(42) + ":";
|
||||
|
||||
foreach (string str in Data.GetData(g.Owner).CurrentChannel.Commands)
|
||||
txt += " " + str;
|
||||
|
||||
g.AddHtml(x + 30, y += 30, 170, 21, txt, false, false);
|
||||
|
||||
g.AddHtml(x + 130, y += 25, 120, 21, HTML.White + Name + " " + General.Local(49), false, false);
|
||||
g.AddImage(x + 100, y, 0x2342, Data.GetData(g.Owner).ColorFor(this));
|
||||
g.AddButton(x + 104, y + 4, 0x2716, 0x2716, "Channel Color", new TimerStateCallback(ChannelColor), g);
|
||||
|
||||
g.AddHtml(x + 130, y += 25, 120, 21, HTML.White + General.Local(159), false, false);
|
||||
g.AddButton(x + 100, y, Data.GetData(g.Owner).IrcRaw ? 0x2343 : 0x2342, Data.GetData(g.Owner).IrcRaw ? 0x2343 : 0x2342, "IRC Raw", new TimerStateCallback(IrcRaw), g);
|
||||
|
||||
g.Entries.Insert(0, new GumpBackground(x, oldY, 300, y - oldY + 40, 0x1400));
|
||||
}
|
||||
|
||||
public override ArrayList BuildList(Mobile m)
|
||||
{
|
||||
ArrayList list = base.BuildList(m);
|
||||
|
||||
foreach (string str in Data.IrcList)
|
||||
list.Add(str);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private void ChannelColor(object o)
|
||||
{
|
||||
if (!(o is GumpPlus))
|
||||
return;
|
||||
|
||||
((GumpPlus)o).Owner.SendHuePicker(new InternalPicker((GumpPlus)o, this));
|
||||
}
|
||||
|
||||
private void IrcRaw(object o)
|
||||
{
|
||||
if (!(o is GumpPlus))
|
||||
return;
|
||||
|
||||
GumpPlus g = (GumpPlus)o;
|
||||
|
||||
Data.GetData(g.Owner).IrcRaw = !Data.GetData(g.Owner).IrcRaw;
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Staff.cs
Normal file
35
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Channels/Staff.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Staff : Channel
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
new Staff();
|
||||
}
|
||||
|
||||
public Staff() : base("Staff")
|
||||
{
|
||||
Commands.Add("staff");
|
||||
Commands.Add("st");
|
||||
DefaultC = 0x26;
|
||||
|
||||
Register(this);
|
||||
}
|
||||
|
||||
public override bool CanChat(Mobile m, bool say)
|
||||
{
|
||||
if (m.AccessLevel == AccessLevel.Player)
|
||||
{
|
||||
if (say) m.SendMessage(Data.GetData(m).SystemC, General.Local(191));
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanChat(m, say);
|
||||
}
|
||||
}
|
||||
}
|
||||
199
Scripts/SubSystem/Knives Chat 3.0 Beta 6/ChatLocal.txt
Normal file
199
Scripts/SubSystem/Knives Chat 3.0 Beta 6/ChatLocal.txt
Normal file
@@ -0,0 +1,199 @@
|
||||
Add Friend
|
||||
Remove Friend
|
||||
Ignore
|
||||
Remove Ignore
|
||||
Grant Global
|
||||
Revoke Global
|
||||
Ban
|
||||
Remove Ban
|
||||
Global Ignore
|
||||
Global Unignore
|
||||
Listen
|
||||
Remove Listen
|
||||
Set your away message
|
||||
Send Message
|
||||
Read Messages
|
||||
Client
|
||||
Goto
|
||||
Message Sound
|
||||
Friend and Messaging Options
|
||||
Online
|
||||
Away
|
||||
Busy
|
||||
Hidden
|
||||
You must unhide to see the player list
|
||||
Only friends can send messages
|
||||
Require friend requests
|
||||
Global Messages
|
||||
Sound on message receive
|
||||
Default Message Sound
|
||||
Friends speech shortcut
|
||||
Friend online alert
|
||||
Please select a channel to view
|
||||
Friends
|
||||
You are banned from chat
|
||||
You must join the channel first
|
||||
You are not in a chatting region
|
||||
You are not in a guild
|
||||
You are not in a faction
|
||||
Channels
|
||||
General Channel Options
|
||||
Options
|
||||
Channels speech shortcut
|
||||
Commands
|
||||
Global
|
||||
Global Chat
|
||||
Global World
|
||||
View All
|
||||
System Color
|
||||
Staff Color
|
||||
Color
|
||||
Channel
|
||||
Ignores
|
||||
GIgnores
|
||||
GListens
|
||||
Bans
|
||||
Display
|
||||
Mail
|
||||
Mail and Messaging Options
|
||||
Auto delete week old messages
|
||||
Mail speech shortcut
|
||||
from
|
||||
You must target a book
|
||||
Message to
|
||||
Recording. Press send when finished.
|
||||
Recording stopped
|
||||
Now recording. Everything you enter on the command line will appear in the message.
|
||||
You must have a subject and message to send
|
||||
Message sent to
|
||||
You are now ignoring
|
||||
You delete the message
|
||||
Speech command set to
|
||||
Speech command cleared
|
||||
is no longer on your friend list
|
||||
is now on your friend list
|
||||
You are no longer ignoring
|
||||
now has global listening access
|
||||
no longer has global access
|
||||
You ban
|
||||
You lift the ban from
|
||||
You are no longer global ignoring
|
||||
You are now global ignoring
|
||||
You are no longer globally listening to
|
||||
You are now globally listening to
|
||||
is no longer online
|
||||
Friend Request
|
||||
Do you want to add this player as a friend?
|
||||
You have sent a friend request to
|
||||
has accepted your friend request
|
||||
has denied your friend request
|
||||
You deny
|
||||
You are now banned from chat
|
||||
Your chat ban has been lifted
|
||||
You've been granted global access
|
||||
Your global access has been revoked
|
||||
Broadcast to all
|
||||
Broadcast
|
||||
You can send another request in
|
||||
You must wait a few moments between messages
|
||||
Enable IRC
|
||||
Filter and Spam Options
|
||||
IRC Options
|
||||
Misc Options
|
||||
The server is already attempting to connect
|
||||
The server is already connected
|
||||
IRC connection failed
|
||||
Attempting to connect...
|
||||
Connection could not be established
|
||||
Connecting to IRC server...
|
||||
Server is now connected to IRC channel
|
||||
IRC names list updating
|
||||
IRC connection down
|
||||
Filter violation detected:
|
||||
Too many search results, be more specific
|
||||
No matching names found
|
||||
Select a name
|
||||
Auto Connect
|
||||
Auto Reconnect
|
||||
Nickname
|
||||
Server
|
||||
Room
|
||||
Port
|
||||
White
|
||||
Black
|
||||
Blue
|
||||
Green
|
||||
Light Red
|
||||
Brown
|
||||
Purple
|
||||
Orange
|
||||
Yellow
|
||||
Light Green
|
||||
Cyan
|
||||
Light Cyan
|
||||
Light Blue
|
||||
Pink
|
||||
Grey
|
||||
Light Grey
|
||||
Select a Color
|
||||
Staff Color
|
||||
Connect
|
||||
Cancel Connect
|
||||
Close Connection
|
||||
Apply filter to world speech
|
||||
Apply filter to private messages
|
||||
Chat Spam
|
||||
Pm Spam
|
||||
Request Spam
|
||||
Filter Ban
|
||||
Add/Remove Filter
|
||||
You remove the filter:
|
||||
You add the filter:
|
||||
Filters:
|
||||
Show staff in channel lists
|
||||
Max Mailbox Size
|
||||
Filter Penalty
|
||||
None
|
||||
Ban
|
||||
Jail
|
||||
IRC connection is down
|
||||
IRC Raw
|
||||
Select Ban Time
|
||||
30 minutes
|
||||
1 hour
|
||||
12 hours
|
||||
1 day
|
||||
1 week
|
||||
1 month
|
||||
1 year
|
||||
Local file reloaded
|
||||
Reload localized text file
|
||||
days
|
||||
hours
|
||||
minutes
|
||||
is now online
|
||||
Error loading chat information. Please report this to Knives at kmwill23@hotmail.com
|
||||
Error saving chat information. Please report this to Knives at kmwill23@hotmail.com
|
||||
Error filtering text. Please report this to Knives at kmwill23@hotmail.com
|
||||
Public Channel Options
|
||||
Create New
|
||||
Please select a channel
|
||||
Name
|
||||
Style
|
||||
Global
|
||||
Regional
|
||||
Send Chat to IRC
|
||||
Add/Remove Command
|
||||
Error loading channel information. Please report this to Knives at kmwill23@hotmail.com
|
||||
Error saving channel information. Please report this to Knives at kmwill23@hotmail.com
|
||||
Auto join new players
|
||||
You have left the channel
|
||||
You have joined the channel
|
||||
You must be staff to chat here
|
||||
Global Guild
|
||||
Global Faction
|
||||
The message needs a subject before you can begin recording
|
||||
Quick Bar
|
||||
Message Read Receipts
|
||||
has read
|
||||
EndOfFile
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class ChannelList
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("List", AccessLevel.Player, new CommandEventHandler(OnList));
|
||||
CommandSystem.Register("L", AccessLevel.Player, new CommandEventHandler(OnList));
|
||||
}
|
||||
|
||||
private static void OnList(CommandEventArgs args)
|
||||
{
|
||||
ChannelGump.SendTo(args.Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Friends.cs
Normal file
20
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Friends.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Friends
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("Friends", AccessLevel.Player, new CommandEventHandler(OnFriends));
|
||||
CommandSystem.Register("Fri", AccessLevel.Player, new CommandEventHandler(OnFriends));
|
||||
}
|
||||
|
||||
private static void OnFriends(CommandEventArgs args)
|
||||
{
|
||||
FriendsGump.SendTo(args.Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Mail.cs
Normal file
20
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Mail.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Mail
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("Mail", AccessLevel.Player, new CommandEventHandler(OnMail));
|
||||
CommandSystem.Register("Ma", AccessLevel.Player, new CommandEventHandler(OnMail));
|
||||
}
|
||||
|
||||
private static void OnMail(CommandEventArgs args)
|
||||
{
|
||||
MailGump.SendTo(args.Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
92
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Pm.cs
Normal file
92
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Pm.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Commands;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Pm
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("pm", AccessLevel.Player, new CommandEventHandler(OnMessage));
|
||||
CommandSystem.Register("msg", AccessLevel.Player, new CommandEventHandler(OnMessage));
|
||||
}
|
||||
|
||||
private static void OnMessage(CommandEventArgs args)
|
||||
{
|
||||
if (args.ArgString == null || args.ArgString == "")
|
||||
return;
|
||||
|
||||
string name = args.GetString(0);
|
||||
string text = "";
|
||||
|
||||
if (args.Arguments.Length > 1)
|
||||
text = args.ArgString.Substring(name.Length + 1, args.ArgString.Length - name.Length - 1);
|
||||
|
||||
ArrayList list = GetMsgCanidates(args.Mobile, name);
|
||||
|
||||
if (list.Count > 10)
|
||||
args.Mobile.SendMessage(Data.GetData(args.Mobile).SystemC, General.Local(112));
|
||||
else if (list.Count == 0)
|
||||
args.Mobile.SendMessage(Data.GetData(args.Mobile).SystemC, General.Local(113));
|
||||
else if (list.Count == 1)
|
||||
SendMessageGump.SendTo(args.Mobile, (Mobile)list[0], text);
|
||||
else
|
||||
new InternalGump(args.Mobile, list, text);
|
||||
}
|
||||
|
||||
private static ArrayList GetMsgCanidates(Mobile m, string name)
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
foreach (Data data in new ArrayList(Data.Datas.Values))
|
||||
if (data.Mobile.Name.ToLower().IndexOf(name) != -1 && Message.CanMessage(m, data.Mobile))
|
||||
list.Add(data.Mobile);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
private class InternalGump : GumpPlus
|
||||
{
|
||||
private ArrayList c_List;
|
||||
private string c_Text;
|
||||
|
||||
public InternalGump(Mobile m, ArrayList list, string txt) : base(m, 100, 100)
|
||||
{
|
||||
c_List = list;
|
||||
c_Text = txt;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, 150, 21, HTML.White + "<CENTER>" + General.Local(114), false, false);
|
||||
|
||||
y += 5;
|
||||
|
||||
foreach (Mobile m in c_List)
|
||||
{
|
||||
AddHtml(60, y += 20, 90, 21, HTML.White + m.Name, false, false);
|
||||
AddButton(45, y + 3, 0x2716, 0x2716, "Select", new TimerStateCallback(Select), m);
|
||||
}
|
||||
|
||||
Entries.Insert(0, new GumpBackground(0, 0, 150, y + 40, 0x1400));
|
||||
}
|
||||
|
||||
private void Select(object o)
|
||||
{
|
||||
if (!(o is Mobile))
|
||||
return;
|
||||
|
||||
SendMessageGump.SendTo(Owner, (Mobile)o, c_Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Setup.cs
Normal file
20
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Commands/Setup.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Setup
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("ChatSetup", AccessLevel.Administrator, new CommandEventHandler(OnSetup));
|
||||
CommandSystem.Register("cs", AccessLevel.Administrator, new CommandEventHandler(OnSetup));
|
||||
}
|
||||
|
||||
private static void OnSetup(CommandEventArgs args)
|
||||
{
|
||||
SetupGump.SendTo(args.Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
786
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Data.cs
Normal file
786
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Data.cs
Normal file
@@ -0,0 +1,786 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Accounting;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public enum OnlineStatus { Online, Away, Busy, Hidden }
|
||||
|
||||
public class Data
|
||||
{
|
||||
public static void Save()
|
||||
{
|
||||
foreach (Mobile m in new ArrayList(s_Datas.Keys))
|
||||
if (m.Deleted)
|
||||
s_Datas.Remove(m);
|
||||
|
||||
if (!Directory.Exists("Saves/Chat/"))
|
||||
Directory.CreateDirectory("Saves/Chat/");
|
||||
|
||||
GenericWriter writer = new BinaryFileWriter(Path.Combine("Saves/Chat/", "Chat34.bin"), true);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(s_Filters.Count);
|
||||
foreach (string str in s_Filters)
|
||||
writer.Write(str);
|
||||
|
||||
writer.Write((int)s_FilterPenalty);
|
||||
writer.Write(s_MaxMsgs);
|
||||
writer.Write(s_ChatSpam);
|
||||
writer.Write(s_MsgSpam);
|
||||
writer.Write(s_RequestSpam);
|
||||
writer.Write(s_FilterBanLength);
|
||||
writer.Write(s_IrcPort);
|
||||
writer.Write(s_IrcMaxAttempts);
|
||||
writer.Write(s_ShowStaff);
|
||||
writer.Write(s_IrcEnabled);
|
||||
writer.Write(s_IrcAutoConnect);
|
||||
writer.Write(s_IrcAutoReconnect);
|
||||
writer.Write(s_FilterSpeech);
|
||||
writer.Write(s_FilterMsg);
|
||||
writer.Write((int)s_IrcStaffColor);
|
||||
writer.Write(s_IrcServer);
|
||||
writer.Write(s_IrcRoom);
|
||||
writer.Write(s_IrcNick);
|
||||
|
||||
foreach (Data data in new ArrayList(s_Datas.Values))
|
||||
if (data.Mobile.Player && ((Account)data.Mobile.Account).LastLogin < DateTime.Now - TimeSpan.FromDays(30))
|
||||
s_Datas.Remove(data.Mobile);
|
||||
|
||||
writer.Write(s_Datas.Count);
|
||||
foreach (Data data in s_Datas.Values)
|
||||
data.Save(writer);
|
||||
|
||||
writer.Close();
|
||||
}
|
||||
|
||||
public static void Load()
|
||||
{
|
||||
if ( !File.Exists( Path.Combine( "Saves/Chat/", "Chat34.bin" ) ) )
|
||||
return;
|
||||
|
||||
using (FileStream bin = new FileStream(Path.Combine("Saves/Chat/", "Chat34.bin"), FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
GenericReader reader = new BinaryFileReader(new BinaryReader(bin));
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for(int i = 0; i < count; ++i )
|
||||
s_Filters.Add(reader.ReadString());
|
||||
|
||||
s_FilterPenalty = (FilterPenalty)reader.ReadInt();
|
||||
s_MaxMsgs = reader.ReadInt();
|
||||
s_ChatSpam = reader.ReadInt();
|
||||
s_MsgSpam = reader.ReadInt();
|
||||
s_RequestSpam = reader.ReadInt();
|
||||
s_FilterBanLength = reader.ReadInt();
|
||||
s_IrcPort = reader.ReadInt();
|
||||
s_IrcMaxAttempts = reader.ReadInt();
|
||||
s_ShowStaff = reader.ReadBool();
|
||||
s_IrcEnabled = reader.ReadBool();
|
||||
s_IrcAutoConnect = reader.ReadBool();
|
||||
s_IrcAutoReconnect = reader.ReadBool();
|
||||
s_FilterSpeech = reader.ReadBool();
|
||||
s_FilterMsg = reader.ReadBool();
|
||||
s_IrcStaffColor = (IrcColor)reader.ReadInt();
|
||||
s_IrcServer = reader.ReadString();
|
||||
s_IrcRoom = reader.ReadString();
|
||||
s_IrcNick = reader.ReadString();
|
||||
|
||||
count = reader.ReadInt();
|
||||
Data data;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
data = new Data();
|
||||
data.Load(reader);
|
||||
|
||||
if (data.Mobile != null)
|
||||
s_Datas[data.Mobile] = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Static Definitions
|
||||
|
||||
private static Hashtable s_Datas = new Hashtable();
|
||||
private static ArrayList s_Filters = new ArrayList();
|
||||
private static ArrayList s_IrcList = new ArrayList();
|
||||
private static FilterPenalty s_FilterPenalty;
|
||||
private static int s_MaxMsgs = 50;
|
||||
private static int s_ChatSpam = 2;
|
||||
private static int s_MsgSpam = 5;
|
||||
private static int s_RequestSpam = 24;
|
||||
private static int s_FilterBanLength = 5;
|
||||
private static int s_IrcPort = 6667;
|
||||
private static int s_IrcMaxAttempts = 3;
|
||||
private static bool s_ShowStaff = false;
|
||||
private static bool s_IrcEnabled = false;
|
||||
private static bool s_IrcAutoConnect = false;
|
||||
private static bool s_IrcAutoReconnect = false;
|
||||
private static bool s_FilterSpeech = false;
|
||||
private static bool s_FilterMsg = false;
|
||||
private static IrcColor s_IrcStaffColor = IrcColor.Black;
|
||||
private static string s_IrcServer = "";
|
||||
private static string s_IrcRoom = "";
|
||||
private static string s_IrcNick = Server.Misc.ServerList.ServerName;
|
||||
|
||||
public static Hashtable Datas { get { return s_Datas; } }
|
||||
public static ArrayList Filters { get { return s_Filters; } }
|
||||
public static ArrayList IrcList { get { return s_IrcList; } }
|
||||
public static FilterPenalty FilterPenalty { get { return s_FilterPenalty; } set { s_FilterPenalty = value; } }
|
||||
public static int MaxMsgs { get { return s_MaxMsgs; } set { s_MaxMsgs = value; } }
|
||||
public static int ChatSpam { get { return s_ChatSpam; } set { s_ChatSpam = value; } }
|
||||
public static int MsgSpam { get { return s_MsgSpam; } set { s_MsgSpam = value; } }
|
||||
public static int RequestSpam { get { return s_RequestSpam; } set { s_RequestSpam = value; } }
|
||||
public static int FilterBanLength { get { return s_FilterBanLength; } set { s_FilterBanLength = value; } }
|
||||
public static int IrcPort { get { return s_IrcPort; } set { s_IrcPort = value; } }
|
||||
public static int IrcMaxAttempts { get { return s_IrcMaxAttempts; } set { s_IrcMaxAttempts = value; } }
|
||||
public static bool ShowStaff { get { return s_ShowStaff; } set { s_ShowStaff = value; } }
|
||||
public static bool IrcAutoConnect { get { return s_IrcAutoConnect; } set { s_IrcAutoConnect = value; } }
|
||||
public static bool IrcAutoReconnect { get { return s_IrcAutoReconnect; } set { s_IrcAutoReconnect = value; } }
|
||||
public static bool FilterSpeech { get { return s_FilterSpeech; } set { s_FilterSpeech = value; } }
|
||||
public static bool FilterMsg { get { return s_FilterMsg; } set { s_FilterMsg = value; } }
|
||||
public static string IrcServer { get { return s_IrcServer; } set { s_IrcServer = value; } }
|
||||
public static string IrcNick { get { return s_IrcNick; } set { s_IrcNick = value; } }
|
||||
|
||||
public static bool IrcEnabled
|
||||
{
|
||||
get { return s_IrcEnabled; }
|
||||
set
|
||||
{
|
||||
s_IrcEnabled = value;
|
||||
if (!value)
|
||||
{
|
||||
IrcConnection.Connection.CancelConnect();
|
||||
IrcConnection.Connection.Disconnect(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static IrcColor IrcStaffColor
|
||||
{
|
||||
get { return s_IrcStaffColor; }
|
||||
set
|
||||
{
|
||||
if ((int)value > 15)
|
||||
value = (IrcColor)0;
|
||||
|
||||
if ((int)value < 0)
|
||||
value = (IrcColor)15;
|
||||
|
||||
s_IrcStaffColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static Data GetData(Mobile m)
|
||||
{
|
||||
if (s_Datas[m] == null)
|
||||
return new Data(m);
|
||||
|
||||
return (Data)s_Datas[m];
|
||||
}
|
||||
|
||||
public static string IrcRoom
|
||||
{
|
||||
get { return s_IrcRoom; }
|
||||
set
|
||||
{
|
||||
s_IrcRoom = value;
|
||||
|
||||
if (s_IrcRoom.IndexOf("#") != 0)
|
||||
s_IrcRoom = "#" + s_IrcRoom;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Class Definitions
|
||||
|
||||
private Mobile c_Mobile;
|
||||
private Channel c_CurrentChannel;
|
||||
private OnlineStatus c_Status;
|
||||
private object c_Recording;
|
||||
private ArrayList c_Friends, c_Ignores, c_Messages, c_GIgnores, c_GListens, c_Channels, c_IrcIgnores;
|
||||
private Hashtable c_Sounds, c_ChannelColors;
|
||||
private int c_GlobalMC, c_GlobalCC, c_GlobalGC, c_GlobalFC, c_GlobalWC, c_SystemC, c_ChannelPP, c_FriendsPP, c_MailPP, c_DefaultSound, c_StaffC;
|
||||
private bool c_GlobalAccess, c_Global, c_GlobalM, c_GlobalC, c_GlobalG, c_GlobalF, c_GlobalW, c_Banned, c_FriendsOnly, c_MsgSound, c_ByRequest, c_FriendAlert, c_SevenDays, c_ReadReceipt, c_IrcRaw, c_QuickBar;
|
||||
private string c_AwayMsg, c_FriendsSpeech, c_ChannelsSpeech, c_MailSpeech;
|
||||
private DateTime c_BannedUntil;
|
||||
|
||||
public Mobile Mobile { get { return c_Mobile; } }
|
||||
public Channel CurrentChannel { get { return c_CurrentChannel; } set { c_CurrentChannel = value; } }
|
||||
public OnlineStatus Status { get { return c_Status; } set { c_Status = value; } }
|
||||
public object Recording{ get{ return c_Recording; } set{ c_Recording = value; } }
|
||||
public ArrayList Friends { get { return c_Friends; } }
|
||||
public ArrayList Ignores { get { return c_Ignores; } }
|
||||
public ArrayList Messages { get { return c_Messages; } }
|
||||
public ArrayList GIgnores { get { return c_GIgnores; } }
|
||||
public ArrayList GListens { get { return c_GListens; } }
|
||||
public ArrayList Channels { get { return c_Channels; } }
|
||||
public ArrayList IrcIgnores { get { return c_IrcIgnores; } }
|
||||
public Hashtable ChannelColors { get { return c_ChannelColors; } }
|
||||
public bool Global { get { return c_Global; } set { c_Global = value; } }
|
||||
public bool GlobalM { get { return c_GlobalM && c_Global; } set { c_GlobalM = value; } }
|
||||
public bool GlobalC { get { return c_GlobalC && c_Global; } set { c_GlobalC = value; } }
|
||||
public bool GlobalG { get { return c_GlobalG && c_Global; } set { c_GlobalG = value; } }
|
||||
public bool GlobalF { get { return c_GlobalF && c_Global; } set { c_GlobalF = value; } }
|
||||
public bool GlobalW { get { return c_GlobalW && c_Global; } set { c_GlobalW = value; } }
|
||||
public bool FriendsOnly { get { return c_FriendsOnly; } set { c_FriendsOnly = value; } }
|
||||
public bool MsgSound { get { return c_MsgSound; } set { c_MsgSound = value; } }
|
||||
public bool ByRequest { get { return c_ByRequest; } set { c_ByRequest = value; } }
|
||||
public bool FriendAlert { get { return c_FriendAlert; } set { c_FriendAlert = value; } }
|
||||
public bool SevenDays { get { return c_SevenDays; } set { c_SevenDays = value; } }
|
||||
public bool ReadReceipt { get { return c_ReadReceipt; } set { c_ReadReceipt = value; } }
|
||||
public bool IrcRaw { get { return c_IrcRaw; } set { c_IrcRaw = value; } }
|
||||
public bool QuickBar { get { return c_QuickBar; } set { c_QuickBar = value; } }
|
||||
public int GlobalMC { get { return c_GlobalMC; } set { c_GlobalMC = value; } }
|
||||
public int GlobalCC { get { return c_GlobalCC; } set { c_GlobalCC = value; } }
|
||||
public int GlobalGC { get { return c_GlobalGC; } set { c_GlobalGC = value; } }
|
||||
public int GlobalFC { get { return c_GlobalFC; } set { c_GlobalFC = value; } }
|
||||
public int GlobalWC { get { return c_GlobalWC; } set { c_GlobalWC = value; } }
|
||||
public int SystemC { get { return c_SystemC; } set { c_SystemC = value; } }
|
||||
public int StaffC { get { return c_StaffC; } set { c_StaffC = value; } }
|
||||
public string AwayMsg { get { return c_AwayMsg; } set { c_AwayMsg = value; } }
|
||||
public string FriendsSpeech { get { return c_FriendsSpeech; } set { c_FriendsSpeech = value; } }
|
||||
public string ChannelsSpeech { get { return c_ChannelsSpeech; } set { c_ChannelsSpeech = value; } }
|
||||
public string MailSpeech { get { return c_MailSpeech; } set { c_MailSpeech = value; } }
|
||||
|
||||
public int FriendsPP
|
||||
{
|
||||
get { return c_FriendsPP; }
|
||||
set
|
||||
{
|
||||
c_FriendsPP = value;
|
||||
|
||||
if (c_FriendsPP < 5)
|
||||
c_FriendsPP = 5;
|
||||
if (c_FriendsPP > 15)
|
||||
c_FriendsPP = 15;
|
||||
}
|
||||
}
|
||||
|
||||
public int ChannelPP
|
||||
{
|
||||
get { return c_ChannelPP; }
|
||||
set
|
||||
{
|
||||
c_ChannelPP = value;
|
||||
|
||||
if (c_ChannelPP < 5)
|
||||
c_ChannelPP = 5;
|
||||
if (c_ChannelPP > 15)
|
||||
c_ChannelPP = 15;
|
||||
}
|
||||
}
|
||||
|
||||
public int MailPP
|
||||
{
|
||||
get { return c_MailPP; }
|
||||
set
|
||||
{
|
||||
c_MailPP = value;
|
||||
|
||||
if (c_MailPP < 3)
|
||||
c_MailPP = 3;
|
||||
if (c_MailPP > 10)
|
||||
c_MailPP = 10;
|
||||
}
|
||||
}
|
||||
|
||||
public int DefaultSound
|
||||
{
|
||||
get { return c_DefaultSound; }
|
||||
set
|
||||
{
|
||||
foreach (Mobile m in c_Sounds.Keys)
|
||||
if ((int)c_Sounds[m] == c_DefaultSound)
|
||||
c_Sounds[m] = value;
|
||||
|
||||
c_DefaultSound = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GlobalAccess
|
||||
{
|
||||
get { return c_GlobalAccess || c_Mobile.AccessLevel >= AccessLevel.Administrator; }
|
||||
set
|
||||
{
|
||||
c_GlobalAccess = value;
|
||||
|
||||
if (value)
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(92));
|
||||
else
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(93));
|
||||
}
|
||||
}
|
||||
|
||||
public bool Banned
|
||||
{
|
||||
get{ return c_Banned; }
|
||||
set
|
||||
{
|
||||
c_Banned = value;
|
||||
|
||||
if (value)
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(90));
|
||||
else
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(91));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Data()
|
||||
{
|
||||
c_Friends = new ArrayList();
|
||||
c_Ignores = new ArrayList();
|
||||
c_Messages = new ArrayList();
|
||||
c_GIgnores = new ArrayList();
|
||||
c_GListens = new ArrayList();
|
||||
c_Channels = new ArrayList();
|
||||
c_IrcIgnores = new ArrayList();
|
||||
c_Sounds = new Hashtable();
|
||||
c_ChannelColors = new Hashtable();
|
||||
c_FriendsPP = 10;
|
||||
c_ChannelPP = 10;
|
||||
c_MailPP = 5;
|
||||
c_SystemC = 0x161;
|
||||
c_GlobalMC = 0x26;
|
||||
c_GlobalCC = 0x47E;
|
||||
c_GlobalGC = 0x44;
|
||||
c_GlobalFC = 0x17;
|
||||
c_GlobalWC = 0x3;
|
||||
c_StaffC = 0x3B4;
|
||||
c_AwayMsg = "";
|
||||
c_FriendsSpeech = "";
|
||||
c_ChannelsSpeech = "";
|
||||
c_MailSpeech = "";
|
||||
c_BannedUntil = DateTime.Now;
|
||||
|
||||
c_IrcRaw = true;
|
||||
}
|
||||
|
||||
public Data(Mobile m)
|
||||
{
|
||||
c_Mobile = m;
|
||||
|
||||
c_Friends = new ArrayList();
|
||||
c_Ignores = new ArrayList();
|
||||
c_Messages = new ArrayList();
|
||||
c_GIgnores = new ArrayList();
|
||||
c_GListens = new ArrayList();
|
||||
c_Channels = new ArrayList();
|
||||
c_IrcIgnores = new ArrayList();
|
||||
c_Sounds = new Hashtable();
|
||||
c_ChannelColors = new Hashtable();
|
||||
c_FriendsPP = 10;
|
||||
c_ChannelPP = 10;
|
||||
c_MailPP = 5;
|
||||
c_SystemC = 0x161;
|
||||
c_GlobalMC = 0x26;
|
||||
c_GlobalCC = 0x47E;
|
||||
c_GlobalGC = 0x44;
|
||||
c_GlobalFC = 0x17;
|
||||
c_GlobalWC = 0x3;
|
||||
c_StaffC = 0x3B4;
|
||||
c_AwayMsg = "";
|
||||
c_FriendsSpeech = "";
|
||||
c_ChannelsSpeech = "";
|
||||
c_MailSpeech = "";
|
||||
c_BannedUntil = DateTime.Now;
|
||||
|
||||
if (m.AccessLevel >= AccessLevel.Administrator)
|
||||
c_GlobalAccess = true;
|
||||
|
||||
s_Datas[m] = this;
|
||||
|
||||
foreach (Channel c in Channel.Channels)
|
||||
if (c.NewChars)
|
||||
c_Channels.Add(c.Name);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public bool NewMsg()
|
||||
{
|
||||
foreach (Message msg in c_Messages)
|
||||
if (!msg.Read)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool NewMsgFrom(Mobile m)
|
||||
{
|
||||
foreach (Message msg in c_Messages)
|
||||
if (!msg.Read && msg.From == m)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void CheckMsg()
|
||||
{
|
||||
foreach( Message msg in c_Messages )
|
||||
if (!msg.Read)
|
||||
{
|
||||
MessageGump.SendTo(c_Mobile, msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckMsgFrom(Mobile m)
|
||||
{
|
||||
foreach(Message msg in c_Messages)
|
||||
if (!msg.Read && msg.From == m)
|
||||
{
|
||||
MessageGump.SendTo(c_Mobile, msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetSound(Mobile m)
|
||||
{
|
||||
if (c_Sounds[m] == null)
|
||||
c_Sounds[m] = c_DefaultSound;
|
||||
|
||||
return (int)c_Sounds[m];
|
||||
}
|
||||
|
||||
public void SetSound(Mobile m, int num)
|
||||
{
|
||||
if (num < 0)
|
||||
num = 0;
|
||||
|
||||
c_Sounds[m] = num;
|
||||
}
|
||||
|
||||
public int ColorFor(Channel c)
|
||||
{
|
||||
if (c_ChannelColors[c.Name] == null)
|
||||
c_ChannelColors[c.Name] = c.DefaultC;
|
||||
|
||||
return (int)c_ChannelColors[c.Name];
|
||||
}
|
||||
|
||||
public void AddFriend(Mobile m)
|
||||
{
|
||||
if (c_Friends.Contains(m) || m == c_Mobile)
|
||||
return;
|
||||
|
||||
c_Friends.Add(m);
|
||||
c_Mobile.SendMessage(c_SystemC, m.Name + " " + General.Local(73));
|
||||
|
||||
if (m.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(m, typeof(FriendsGump));
|
||||
if (m.HasGump(typeof(ChannelGump)))
|
||||
General.RefreshGump(m, typeof(ChannelGump));
|
||||
if (c_Mobile.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(c_Mobile, typeof(FriendsGump));
|
||||
if (c_Mobile.HasGump(typeof(ChannelGump)))
|
||||
General.RefreshGump(c_Mobile, typeof(ChannelGump));
|
||||
}
|
||||
|
||||
public void RemoveFriend(Mobile m)
|
||||
{
|
||||
if (!c_Friends.Contains(m))
|
||||
return;
|
||||
|
||||
c_Friends.Remove(m);
|
||||
c_Mobile.SendMessage(c_SystemC, m.Name + " " + General.Local(72));
|
||||
|
||||
if (m.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(m, typeof(FriendsGump));
|
||||
if (m.HasGump(typeof(ChannelGump)))
|
||||
General.RefreshGump(m, typeof(ChannelGump));
|
||||
if (c_Mobile.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(c_Mobile, typeof(FriendsGump));
|
||||
if (c_Mobile.HasGump(typeof(ChannelGump)))
|
||||
General.RefreshGump(c_Mobile, typeof(ChannelGump));
|
||||
}
|
||||
|
||||
public void AddIgnore(Mobile m)
|
||||
{
|
||||
if (c_Ignores.Contains(m) || m == c_Mobile)
|
||||
return;
|
||||
|
||||
c_Ignores.Add(m);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(68) + " " + m.Name);
|
||||
}
|
||||
|
||||
public void RemoveIgnore(Mobile m)
|
||||
{
|
||||
if (!c_Ignores.Contains(m))
|
||||
return;
|
||||
|
||||
c_Ignores.Remove(m);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(74) + " " + m.Name);
|
||||
}
|
||||
|
||||
public void AddGIgnore(Mobile m)
|
||||
{
|
||||
if (c_GIgnores.Contains(m))
|
||||
return;
|
||||
|
||||
c_GIgnores.Add(m);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(80) + " " + m.Name);
|
||||
}
|
||||
|
||||
public void RemoveGIgnore(Mobile m)
|
||||
{
|
||||
if (!c_GIgnores.Contains(m))
|
||||
return;
|
||||
|
||||
c_GIgnores.Remove(m);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(79) + " " + m.Name);
|
||||
}
|
||||
|
||||
public void AddGListen(Mobile m)
|
||||
{
|
||||
if (c_GListens.Contains(m))
|
||||
return;
|
||||
|
||||
c_GListens.Add(m);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(82) + " " + m.Name);
|
||||
}
|
||||
|
||||
public void RemoveGListen(Mobile m)
|
||||
{
|
||||
if (!c_GListens.Contains(m))
|
||||
return;
|
||||
|
||||
c_GListens.Remove(m);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(81) + " " + m.Name);
|
||||
}
|
||||
|
||||
public void AddIrcIgnore(string str)
|
||||
{
|
||||
if (c_IrcIgnores.Contains(str))
|
||||
return;
|
||||
|
||||
c_IrcIgnores.Add(str);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(68) + " " + str);
|
||||
}
|
||||
|
||||
public void RemoveIrcIgnore(string str)
|
||||
{
|
||||
if (!c_IrcIgnores.Contains(str))
|
||||
return;
|
||||
|
||||
c_IrcIgnores.Remove(str);
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(74) + " " + str);
|
||||
}
|
||||
|
||||
public void AddMessage(Message msg)
|
||||
{
|
||||
c_Messages.Add(msg);
|
||||
|
||||
if(c_MsgSound)
|
||||
c_Mobile.SendSound(GetSound(msg.From));
|
||||
}
|
||||
|
||||
public void DeleteMessage(Message msg)
|
||||
{
|
||||
c_Messages.Remove(msg);
|
||||
|
||||
c_Mobile.SendMessage(c_SystemC, General.Local(69));
|
||||
}
|
||||
|
||||
public void Ban(TimeSpan ts)
|
||||
{
|
||||
c_BannedUntil = DateTime.Now + ts;
|
||||
c_Banned = true;
|
||||
Mobile.SendMessage(c_SystemC, General.Local(90));
|
||||
|
||||
Timer.DelayCall(ts, new TimerCallback(RemoveBan));
|
||||
}
|
||||
|
||||
public void RemoveBan()
|
||||
{
|
||||
c_BannedUntil = DateTime.Now;
|
||||
c_Banned = false;
|
||||
Mobile.SendMessage(c_SystemC, General.Local(91));
|
||||
}
|
||||
|
||||
public void Save(GenericWriter writer)
|
||||
{
|
||||
writer.Write(1); // Version
|
||||
|
||||
// version 1
|
||||
|
||||
writer.Write(c_ReadReceipt);
|
||||
writer.Write(c_QuickBar);
|
||||
|
||||
// version 0
|
||||
|
||||
writer.Write(c_Mobile);
|
||||
writer.Write((int)c_Status);
|
||||
writer.WriteMobileList(c_Friends, true);
|
||||
writer.WriteMobileList(c_Ignores, true);
|
||||
writer.WriteMobileList(c_GIgnores, true);
|
||||
writer.WriteMobileList(c_GListens, true);
|
||||
|
||||
foreach (string str in new ArrayList(c_Channels))
|
||||
if (Channel.GetByName(str) == null)
|
||||
c_Channels.Remove(str);
|
||||
|
||||
writer.Write(c_Channels.Count);
|
||||
foreach (string str in c_Channels)
|
||||
writer.Write(str);
|
||||
|
||||
writer.Write(c_Messages.Count);
|
||||
foreach (Message msg in c_Messages)
|
||||
msg.Save(writer);
|
||||
|
||||
writer.Write(c_Sounds.Count);
|
||||
foreach (Mobile m in c_Sounds.Keys)
|
||||
{
|
||||
writer.Write(m);
|
||||
writer.Write((int)c_Sounds[m]);
|
||||
}
|
||||
|
||||
foreach (string str in new ArrayList(c_ChannelColors.Keys))
|
||||
if (Channel.GetByName(str) == null)
|
||||
c_ChannelColors.Remove(str);
|
||||
|
||||
writer.Write(c_ChannelColors.Count);
|
||||
foreach (string str in c_ChannelColors.Keys)
|
||||
{
|
||||
writer.Write(str);
|
||||
writer.Write((int)c_ChannelColors[str]);
|
||||
}
|
||||
|
||||
writer.Write(c_GlobalMC);
|
||||
writer.Write(c_GlobalCC);
|
||||
writer.Write(c_GlobalGC);
|
||||
writer.Write(c_GlobalFC);
|
||||
writer.Write(c_GlobalWC);
|
||||
writer.Write(c_SystemC);
|
||||
writer.Write(c_ChannelPP);
|
||||
writer.Write(c_FriendsPP);
|
||||
writer.Write(c_MailPP);
|
||||
writer.Write(c_DefaultSound);
|
||||
writer.Write(c_StaffC);
|
||||
writer.Write(c_GlobalAccess);
|
||||
writer.Write(c_Global);
|
||||
writer.Write(c_GlobalM);
|
||||
writer.Write(c_GlobalC);
|
||||
writer.Write(c_GlobalG);
|
||||
writer.Write(c_GlobalF);
|
||||
writer.Write(c_GlobalW);
|
||||
writer.Write(c_Banned);
|
||||
writer.Write(c_FriendsOnly);
|
||||
writer.Write(c_MsgSound);
|
||||
writer.Write(c_ByRequest);
|
||||
writer.Write(c_FriendAlert);
|
||||
writer.Write(c_SevenDays);
|
||||
writer.Write(c_IrcRaw);
|
||||
writer.Write(c_AwayMsg);
|
||||
writer.Write(c_FriendsSpeech);
|
||||
writer.Write(c_ChannelsSpeech);
|
||||
writer.Write(c_MailSpeech);
|
||||
writer.Write(c_BannedUntil);
|
||||
}
|
||||
|
||||
public void Load(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version >= 1 )
|
||||
{
|
||||
c_ReadReceipt = reader.ReadBool();
|
||||
c_QuickBar = reader.ReadBool();
|
||||
}
|
||||
|
||||
c_Mobile = reader.ReadMobile();
|
||||
c_Status = (OnlineStatus)reader.ReadInt();
|
||||
c_Friends = reader.ReadMobileList();
|
||||
c_Ignores = reader.ReadMobileList();
|
||||
c_GIgnores = reader.ReadMobileList();
|
||||
c_GListens = reader.ReadMobileList();
|
||||
|
||||
c_Channels = new ArrayList();
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; ++i)
|
||||
c_Channels.Add(reader.ReadString());
|
||||
|
||||
c_Messages = new ArrayList();
|
||||
Message msg;
|
||||
count = reader.ReadInt();
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
msg = new Message();
|
||||
msg.Load(reader);
|
||||
|
||||
if (msg.From != null)
|
||||
c_Messages.Add(msg);
|
||||
}
|
||||
|
||||
c_Sounds = new Hashtable();
|
||||
Mobile m;
|
||||
count = reader.ReadInt();
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
m = reader.ReadMobile();
|
||||
c_Sounds[m] = reader.ReadInt();
|
||||
}
|
||||
|
||||
c_ChannelColors = new Hashtable();
|
||||
string str = "";
|
||||
count = reader.ReadInt();
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
str = reader.ReadString();
|
||||
c_ChannelColors[str] = reader.ReadInt();
|
||||
}
|
||||
|
||||
c_GlobalMC = reader.ReadInt();
|
||||
c_GlobalCC = reader.ReadInt();
|
||||
c_GlobalGC = reader.ReadInt();
|
||||
c_GlobalFC = reader.ReadInt();
|
||||
c_GlobalWC = reader.ReadInt();
|
||||
c_SystemC = reader.ReadInt();
|
||||
c_ChannelPP = reader.ReadInt();
|
||||
c_FriendsPP = reader.ReadInt();
|
||||
c_MailPP = reader.ReadInt();
|
||||
c_DefaultSound = reader.ReadInt();
|
||||
c_StaffC = reader.ReadInt();
|
||||
c_GlobalAccess = reader.ReadBool();
|
||||
c_Global = reader.ReadBool();
|
||||
c_GlobalM = reader.ReadBool();
|
||||
c_GlobalC = reader.ReadBool();
|
||||
c_GlobalG = reader.ReadBool();
|
||||
c_GlobalF = reader.ReadBool();
|
||||
c_GlobalW = reader.ReadBool();
|
||||
c_Banned = reader.ReadBool();
|
||||
c_FriendsOnly = reader.ReadBool();
|
||||
c_MsgSound = reader.ReadBool();
|
||||
c_ByRequest = reader.ReadBool();
|
||||
c_FriendAlert = reader.ReadBool();
|
||||
c_SevenDays = reader.ReadBool();
|
||||
c_IrcRaw = reader.ReadBool();
|
||||
c_AwayMsg = reader.ReadString();
|
||||
c_FriendsSpeech = reader.ReadString();
|
||||
c_ChannelsSpeech = reader.ReadString();
|
||||
c_MailSpeech = reader.ReadString();
|
||||
c_BannedUntil = reader.ReadDateTime();
|
||||
|
||||
if (c_BannedUntil > DateTime.Now)
|
||||
Ban(c_BannedUntil - DateTime.Now);
|
||||
else
|
||||
RemoveBan();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
214
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/DefaultLocal.cs
Normal file
214
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/DefaultLocal.cs
Normal file
@@ -0,0 +1,214 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class DefaultLocal
|
||||
{
|
||||
public static ArrayList Load()
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
list.Add("Add Friend");
|
||||
list.Add("Remove Friend");
|
||||
list.Add("Ignore");
|
||||
list.Add("Remove Ignore");
|
||||
list.Add("Grant Global");
|
||||
list.Add("Revoke Global");
|
||||
list.Add("Ban");
|
||||
list.Add("Remove Ban");
|
||||
list.Add("Global Ignore");
|
||||
list.Add("Global Unignore");
|
||||
list.Add("Listen");
|
||||
list.Add("Remove Listen");
|
||||
list.Add("Set your away message");
|
||||
list.Add("Send Message");
|
||||
list.Add("Read Messages");
|
||||
list.Add("Client");
|
||||
list.Add("Goto");
|
||||
list.Add("Message Sound");
|
||||
list.Add("Friend and Messaging Options");
|
||||
list.Add("Online");
|
||||
list.Add("Away");
|
||||
list.Add("Busy");
|
||||
list.Add("*Unused");
|
||||
list.Add("*Unused");
|
||||
list.Add("Only friends can send messages");
|
||||
list.Add("Require friend requests");
|
||||
list.Add("Global Messages");
|
||||
list.Add("Sound on message receive");
|
||||
list.Add("Default Message Sound");
|
||||
list.Add("Friends speech shortcut");
|
||||
list.Add("Friend online alert");
|
||||
list.Add("Please select a channel to view");
|
||||
list.Add("Friends");
|
||||
list.Add("You are banned from chat");
|
||||
list.Add("You must join the channel first");
|
||||
list.Add("You are not in a chatting region");
|
||||
list.Add("You are not in a guild");
|
||||
list.Add("You are not in a faction");
|
||||
list.Add("Channels");
|
||||
list.Add("General Channel Options");
|
||||
list.Add("Options");
|
||||
list.Add("Channels speech shortcut");
|
||||
list.Add("Commands");
|
||||
list.Add("Global");
|
||||
list.Add("Global Chat");
|
||||
list.Add("Global World");
|
||||
list.Add("View All");
|
||||
list.Add("System Color");
|
||||
list.Add("Staff Color");
|
||||
list.Add("Color");
|
||||
list.Add("Channel");
|
||||
list.Add("Ignores");
|
||||
list.Add("GIgnores");
|
||||
list.Add("GListens");
|
||||
list.Add("Bans");
|
||||
list.Add("Display");
|
||||
list.Add("Mail");
|
||||
list.Add("Mail and Messaging Options");
|
||||
list.Add("Auto delete week old messages");
|
||||
list.Add("Mail speech shortcut");
|
||||
list.Add("from");
|
||||
list.Add("You must target a book");
|
||||
list.Add("Message to");
|
||||
list.Add("Recording. Press send when finished.");
|
||||
list.Add("Recording stopped");
|
||||
list.Add("Now recording. Everything you enter on the command line will appear in the message.");
|
||||
list.Add("You must have a subject and message to send");
|
||||
list.Add("Message sent to");
|
||||
list.Add("You are now ignoring");
|
||||
list.Add("You delete the message");
|
||||
list.Add("Speech command set to");
|
||||
list.Add("Speech command cleared");
|
||||
list.Add("is no longer on your friend list");
|
||||
list.Add("is now on your friend list");
|
||||
list.Add("You are no longer ignoring");
|
||||
list.Add("now has global listening access");
|
||||
list.Add("no longer has global access");
|
||||
list.Add("You ban");
|
||||
list.Add("You lift the ban from");
|
||||
list.Add("You are no longer global ignoring");
|
||||
list.Add("You are now global ignoring");
|
||||
list.Add("You are no longer globally listening to");
|
||||
list.Add("You are now globally listening to");
|
||||
list.Add("is no longer online");
|
||||
list.Add("Friend Request");
|
||||
list.Add("Do you want to add this player as a friend?");
|
||||
list.Add("You have sent a friend request to");
|
||||
list.Add("has accepted your friend request");
|
||||
list.Add("has denied your friend request");
|
||||
list.Add("You deny");
|
||||
list.Add("You are now banned from chat");
|
||||
list.Add("Your chat ban has been lifted");
|
||||
list.Add("You've been granted global access");
|
||||
list.Add("Your global access has been revoked");
|
||||
list.Add("Broadcast to all");
|
||||
list.Add("Broadcast");
|
||||
list.Add("You can send another request in");
|
||||
list.Add("You must wait a few moments between messages");
|
||||
list.Add("Enable IRC");
|
||||
list.Add("Filter and Spam Options");
|
||||
list.Add("IRC Options");
|
||||
list.Add("Misc Options");
|
||||
list.Add("The server is already attempting to connect");
|
||||
list.Add("The server is already connected");
|
||||
list.Add("IRC connection failed");
|
||||
list.Add("Attempting to connect...");
|
||||
list.Add("Connection could not be established");
|
||||
list.Add("Connecting to IRC server...");
|
||||
list.Add("Server is now connected to IRC channel");
|
||||
list.Add("IRC names list updating");
|
||||
list.Add("IRC connection down");
|
||||
list.Add("Filter violation detected:");
|
||||
list.Add("Too many search results, be more specific");
|
||||
list.Add("No matching names found");
|
||||
list.Add("Select a name");
|
||||
list.Add("Auto Connect");
|
||||
list.Add("Auto Reconnect");
|
||||
list.Add("Nickname");
|
||||
list.Add("Server");
|
||||
list.Add("Room");
|
||||
list.Add("Port");
|
||||
list.Add("White");
|
||||
list.Add("Black");
|
||||
list.Add("Blue");
|
||||
list.Add("Green");
|
||||
list.Add("Light Red");
|
||||
list.Add("Brown");
|
||||
list.Add("Purple");
|
||||
list.Add("Orange");
|
||||
list.Add("Yellow");
|
||||
list.Add("Light Green");
|
||||
list.Add("Cyan");
|
||||
list.Add("Light Cyan");
|
||||
list.Add("Light Blue");
|
||||
list.Add("Pink");
|
||||
list.Add("Grey");
|
||||
list.Add("Light Grey");
|
||||
list.Add("Select a Color");
|
||||
list.Add("Staff Color");
|
||||
list.Add("Connect");
|
||||
list.Add("Cancel Connect");
|
||||
list.Add("Close Connection");
|
||||
list.Add("Apply filter to world speech");
|
||||
list.Add("Apply filter to private messages");
|
||||
list.Add("Chat Spam");
|
||||
list.Add("Pm Spam");
|
||||
list.Add("Request Spam");
|
||||
list.Add("Filter Ban");
|
||||
list.Add("Add/Remove Filter");
|
||||
list.Add("You remove the filter:");
|
||||
list.Add("You add the filter:");
|
||||
list.Add("Filters:");
|
||||
list.Add("Show staff in channel lists");
|
||||
list.Add("Max Mailbox Size");
|
||||
list.Add("Filter Penalty");
|
||||
list.Add("None");
|
||||
list.Add("Ban");
|
||||
list.Add("Jail");
|
||||
list.Add("IRC connection is down");
|
||||
list.Add("IRC Raw");
|
||||
list.Add("Select Ban Time");
|
||||
list.Add("30 minutes");
|
||||
list.Add("1 hour");
|
||||
list.Add("12 hours");
|
||||
list.Add("1 day");
|
||||
list.Add("1 week");
|
||||
list.Add("1 month");
|
||||
list.Add("1 year");
|
||||
list.Add("Local file reloaded");
|
||||
list.Add("Reload localized text file");
|
||||
list.Add("days");
|
||||
list.Add("hours");
|
||||
list.Add("minutes");
|
||||
list.Add("is now online");
|
||||
list.Add("Error loading chat information. Please report this to Knives at kmwill23@hotmail.com");
|
||||
list.Add("Error saving chat information. Please report this to Knives at kmwill23@hotmail.com");
|
||||
list.Add("Error filtering text. Please report this to Knives at kmwill23@hotmail.com");
|
||||
list.Add("Public Channel Options");
|
||||
list.Add("Create New");
|
||||
list.Add("Please select a channel");
|
||||
list.Add("Name");
|
||||
list.Add("Style");
|
||||
list.Add("Global");
|
||||
list.Add("Regional");
|
||||
list.Add("Send Chat to IRC");
|
||||
list.Add("Add/Remove Command");
|
||||
list.Add("Error loading channel information. Please report this to Knives at kmwill23@hotmail.com");
|
||||
list.Add("Error saving channel information. Please report this to Knives at kmwill23@hotmail.com");
|
||||
list.Add("Auto join new players");
|
||||
list.Add("You have left the channel");
|
||||
list.Add("You have joined the channel");
|
||||
list.Add("You must be staff to chat here");
|
||||
list.Add("Global Guild");
|
||||
list.Add("Global Faction");
|
||||
list.Add("The message needs a subject before you can begin recording");
|
||||
list.Add("Quick Bar");
|
||||
list.Add("Message Read Receipts");
|
||||
list.Add("has read");
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
75
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Filter.cs
Normal file
75
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Filter.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public enum FilterPenalty { None, Ban, Jail }
|
||||
|
||||
public class Filter
|
||||
{
|
||||
public static string FilterText(Mobile m, string s)
|
||||
{
|
||||
return FilterText(m, s, true);
|
||||
}
|
||||
|
||||
public static string FilterText( Mobile m, string s, bool punish )
|
||||
{try{
|
||||
|
||||
string filter = "";
|
||||
string subOne = "";
|
||||
string subTwo = "";
|
||||
string subThree = "";
|
||||
int index = 0;
|
||||
|
||||
for( int i = 0; i < Data.Filters.Count; ++i )
|
||||
{
|
||||
filter = Data.Filters[i].ToString();
|
||||
|
||||
if ( filter == "" )
|
||||
{
|
||||
Data.Filters.Remove( filter );
|
||||
continue;
|
||||
}
|
||||
|
||||
index = s.ToLower().IndexOf( filter );
|
||||
|
||||
if ( index >= 0 )
|
||||
{
|
||||
if ( m.AccessLevel == AccessLevel.Player && punish)
|
||||
{
|
||||
if (Data.FilterPenalty != FilterPenalty.None)
|
||||
m.SendMessage(Data.GetData(m).SystemC, General.Local(111) + " " + filter);
|
||||
|
||||
if (Data.FilterPenalty == FilterPenalty.Ban)
|
||||
Data.GetData(m).Ban(TimeSpan.FromMinutes(Data.FilterBanLength));
|
||||
|
||||
if (Data.FilterPenalty == FilterPenalty.Jail)
|
||||
{
|
||||
//Insert your jail method here
|
||||
}
|
||||
|
||||
if (Data.FilterPenalty != FilterPenalty.None)
|
||||
return "";
|
||||
}
|
||||
|
||||
subOne = s.Substring( 0, index );
|
||||
subTwo = "";
|
||||
|
||||
for( int ii = 0; ii < filter.Length; ++ii )
|
||||
subTwo+="*";
|
||||
|
||||
subThree = s.Substring( index+filter.Length, s.Length-filter.Length-index );
|
||||
|
||||
s = subOne + subTwo + subThree;
|
||||
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
}catch{ Errors.Report( General.Local(176) ); }
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
249
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/General.cs
Normal file
249
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/General.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class General
|
||||
{
|
||||
private static string s_Version = "3.0 Beta 6";
|
||||
private static DateTime s_ReleaseDate = new DateTime(2006, 6, 18);
|
||||
|
||||
public static string Version { get { return s_Version; } }
|
||||
public static DateTime ReleaseDate { get { return s_ReleaseDate; } }
|
||||
|
||||
private static ArrayList s_Locals = new ArrayList();
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
EventSink.WorldLoad += new WorldLoadEventHandler(OnLoad);
|
||||
EventSink.WorldSave += new WorldSaveEventHandler(OnSave);
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.Speech += new SpeechEventHandler(OnSpeech);
|
||||
EventSink.Login += new LoginEventHandler(OnLogin);
|
||||
EventSink.CharacterCreated += new CharacterCreatedEventHandler(OnCreate);
|
||||
}
|
||||
|
||||
private static void OnLoad()
|
||||
{
|
||||
LoadLocalFile();
|
||||
|
||||
try
|
||||
{
|
||||
Data.Load();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Errors.Report(Local(174));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Channel.Load();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Errors.Report(Local(186));
|
||||
}
|
||||
|
||||
if (Data.IrcAutoConnect)
|
||||
IrcConnection.Connection.Connect();
|
||||
}
|
||||
|
||||
private static void OnSave(WorldSaveEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
Data.Save();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Errors.Report(Local(175));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Channel.Save();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Errors.Report(Local(187));
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnSpeech(SpeechEventArgs args)
|
||||
{
|
||||
if (Data.GetData(args.Mobile).Recording is SendMessageGump)
|
||||
{
|
||||
if (!args.Mobile.HasGump(typeof(SendMessageGump)))
|
||||
{
|
||||
Data.GetData(args.Mobile).Recording = null;
|
||||
return;
|
||||
}
|
||||
|
||||
((SendMessageGump)Data.GetData(args.Mobile).Recording).AddText(" " + args.Speech);
|
||||
args.Handled = true;
|
||||
args.Speech = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (Data.GetData(args.Mobile).FriendsSpeech == args.Speech)
|
||||
{
|
||||
FriendsGump.SendTo(args.Mobile);
|
||||
args.Handled = true;
|
||||
args.Speech = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (Data.GetData(args.Mobile).ChannelsSpeech == args.Speech)
|
||||
{
|
||||
ChannelGump.SendTo(args.Mobile);
|
||||
args.Handled = true;
|
||||
args.Speech = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (Data.GetData(args.Mobile).MailSpeech == args.Speech)
|
||||
{
|
||||
MailGump.SendTo(args.Mobile);
|
||||
args.Handled = true;
|
||||
args.Speech = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (Data.FilterSpeech)
|
||||
args.Speech = Filter.FilterText(args.Mobile, args.Speech, false);
|
||||
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
if (data.Mobile.AccessLevel >= args.Mobile.AccessLevel && ((data.GlobalW && !data.GIgnores.Contains(args.Mobile)) || data.GListens.Contains(args.Mobile)) && !data.Mobile.InRange(args.Mobile.Location, 10))
|
||||
data.Mobile.SendMessage(data.GlobalWC, String.Format("(Global) <World> {0}: {1}", args.Mobile.Name, args.Speech));
|
||||
}
|
||||
|
||||
private static void OnLogin(LoginEventArgs args)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
if (data.Friends.Contains(args.Mobile) && data.FriendAlert)
|
||||
data.Mobile.SendMessage(data.SystemC, args.Mobile.Name + " " + Local(173));
|
||||
|
||||
if (data.SevenDays)
|
||||
foreach (Message msg in new ArrayList(data.Messages))
|
||||
if (msg.Received < DateTime.Now - TimeSpan.FromDays(7))
|
||||
data.Messages.Remove(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnCreate(CharacterCreatedEventArgs args)
|
||||
{
|
||||
if (args.Mobile == null)
|
||||
return;
|
||||
|
||||
Data data = Data.GetData(args.Mobile);
|
||||
|
||||
foreach (Channel c in Channel.Channels)
|
||||
if (c.NewChars)
|
||||
data.Channels.Add(c.Name);
|
||||
}
|
||||
|
||||
public static void LoadLocalFile()
|
||||
{
|
||||
s_Locals.Clear();
|
||||
|
||||
if (File.Exists("Data/ChatLocal.txt"))
|
||||
{
|
||||
using (FileStream bin = new FileStream("Data/ChatLocal.txt", FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
StreamReader reader = new StreamReader(bin);
|
||||
string text = "";
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
text = reader.ReadLine();
|
||||
|
||||
if (text == "EndOfFile")
|
||||
break;
|
||||
|
||||
s_Locals.Add(text);
|
||||
}
|
||||
catch { break; }
|
||||
}
|
||||
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
|
||||
if (s_Locals.Count == 0)
|
||||
s_Locals = DefaultLocal.Load();
|
||||
}
|
||||
|
||||
public static string Local(int num)
|
||||
{
|
||||
if (num < 0 || num >= s_Locals.Count)
|
||||
return "Local Error";
|
||||
|
||||
return s_Locals[num].ToString();
|
||||
}
|
||||
|
||||
public static void RefreshGump(Mobile m, Type type)
|
||||
{
|
||||
if (m.NetState == null)
|
||||
return;
|
||||
|
||||
foreach (Gump g in m.NetState.Gumps)
|
||||
if (g is GumpPlus && g.GetType() == type)
|
||||
{
|
||||
m.CloseGump(type);
|
||||
((GumpPlus)g).NewGump();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearGump(Mobile m, Type type)
|
||||
{
|
||||
if (m.NetState == null)
|
||||
return;
|
||||
|
||||
m.CloseGump(type);
|
||||
|
||||
foreach (Gump g in new ArrayList(m.NetState.Gumps))
|
||||
if (g.GetType() == type)
|
||||
{
|
||||
m.NetState.Gumps.Remove(g);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInFaction(Mobile m)
|
||||
{
|
||||
if (m == null || !m.Player)
|
||||
return false;
|
||||
|
||||
return (((PlayerMobile)m).FactionPlayerState != null && ((PlayerMobile)m).FactionPlayerState.Faction != null);
|
||||
}
|
||||
|
||||
public static string FactionName(Mobile m)
|
||||
{
|
||||
if (!IsInFaction(m))
|
||||
return "";
|
||||
|
||||
return ((PlayerMobile)m).FactionPlayerState.Faction.Definition.PropName;
|
||||
}
|
||||
|
||||
public static string FactionTitle(Mobile m)
|
||||
{
|
||||
if (!IsInFaction(m))
|
||||
return "";
|
||||
|
||||
return ((PlayerMobile)m).FactionPlayerState.Rank.Title;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,353 @@
|
||||
using System;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public enum IrcColor
|
||||
{
|
||||
White = 0,
|
||||
Black = 1,
|
||||
Blue = 2,
|
||||
Green = 3,
|
||||
LightRed = 4,
|
||||
Brown = 5,
|
||||
Purple = 6,
|
||||
Orange = 7,
|
||||
Yellow = 8,
|
||||
LightGreen = 9,
|
||||
Cyan = 10,
|
||||
LightCyan = 11,
|
||||
LightBlue = 12,
|
||||
Pink = 13,
|
||||
Grey = 14,
|
||||
LightGrey = 15,
|
||||
};
|
||||
|
||||
public class IrcConnection
|
||||
{
|
||||
private static IrcConnection s_Connection = new IrcConnection();
|
||||
|
||||
public static IrcConnection Connection{ get{ return s_Connection; } }
|
||||
|
||||
private TcpClient c_Tcp;
|
||||
private Thread c_Thread;
|
||||
private StreamReader c_Reader;
|
||||
private StreamWriter c_Writer;
|
||||
private bool c_Connecting, c_Connected;
|
||||
private int c_Attempts;
|
||||
private DateTime c_LastPong;
|
||||
|
||||
public bool Connecting{ get{ return c_Connecting; } }
|
||||
public bool Connected{ get{ return c_Connected; } }
|
||||
public bool HasMoreAttempts{ get{ return c_Attempts <= Data.IrcMaxAttempts; } }
|
||||
|
||||
public IrcConnection()
|
||||
{
|
||||
}
|
||||
|
||||
public void Connect( Mobile m )
|
||||
{
|
||||
Data data = Data.GetData( m );
|
||||
|
||||
if ( c_Connecting )
|
||||
{
|
||||
m.SendMessage( data.SystemC, General.Local(102) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( c_Connected )
|
||||
{
|
||||
m.SendMessage( data.SystemC, General.Local(103) );
|
||||
return;
|
||||
}
|
||||
|
||||
Connect();
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
{
|
||||
new Thread( new ThreadStart( ConnectTcp ) ).Start();
|
||||
}
|
||||
|
||||
public void CancelConnect()
|
||||
{
|
||||
c_Attempts = Data.IrcMaxAttempts;
|
||||
}
|
||||
|
||||
private void Reconnect()
|
||||
{
|
||||
c_Attempts++;
|
||||
|
||||
if ( !HasMoreAttempts )
|
||||
{
|
||||
c_Attempts = 1;
|
||||
BroadcastSystem( General.Local(104) );
|
||||
return;
|
||||
}
|
||||
|
||||
BroadcastSystem( General.Local(105) + c_Attempts );
|
||||
|
||||
Connect();
|
||||
}
|
||||
|
||||
private void ConnectTcp()
|
||||
{
|
||||
try{ c_Tcp = new TcpClient( Data.IrcServer, Data.IrcPort ); }
|
||||
catch
|
||||
{
|
||||
BroadcastSystem( General.Local(106) );
|
||||
|
||||
Reconnect();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ConnectStream();
|
||||
}
|
||||
|
||||
private void ConnectStream()
|
||||
{try{
|
||||
|
||||
c_Connecting = true;
|
||||
c_LastPong = DateTime.Now;
|
||||
|
||||
c_Reader = new StreamReader(c_Tcp.GetStream(), System.Text.Encoding.Default);
|
||||
c_Writer = new StreamWriter(c_Tcp.GetStream(), System.Text.Encoding.Default);
|
||||
|
||||
BroadcastSystem( General.Local(107) );
|
||||
|
||||
SendMessage(String.Format("USER {0} 1 * :Hello!", Data.IrcNick));
|
||||
SendMessage(String.Format("NICK {0}", Data.IrcNick));
|
||||
|
||||
c_Thread = new Thread(new ThreadStart(ReadStream));
|
||||
c_Thread.Start();
|
||||
|
||||
Server.Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), new Server.TimerCallback( Names ) );
|
||||
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
if (data.Mobile.HasGump(typeof(SetupGump)))
|
||||
General.RefreshGump(data.Mobile, typeof(SetupGump));
|
||||
|
||||
}catch{ Errors.Report( String.Format( "IrcConnection-> ConnectStream" ) ); } }
|
||||
|
||||
private void Names()
|
||||
{
|
||||
if (c_Connected)
|
||||
SendMessage("NAMES " + Data.IrcRoom);
|
||||
else
|
||||
return;
|
||||
|
||||
Server.Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), new Server.TimerCallback( Names ) );
|
||||
}
|
||||
|
||||
private void PingPong(string str)
|
||||
{
|
||||
if (!c_Connecting && !c_Connected)
|
||||
return;
|
||||
|
||||
if (str.IndexOf("PING") != -1)
|
||||
str = str.Replace("PING", "PONG");
|
||||
else
|
||||
str = str.Replace("PONG", "PING");
|
||||
|
||||
SendMessage( str );
|
||||
}
|
||||
|
||||
public void SendMessage( string msg )
|
||||
{
|
||||
try{
|
||||
|
||||
BroadcastRaw( msg );
|
||||
|
||||
c_Writer.WriteLine( msg );
|
||||
c_Writer.Flush();
|
||||
|
||||
}catch{ Disconnect(); }
|
||||
}
|
||||
|
||||
public void SendUserMessage( Mobile m, string msg )
|
||||
{
|
||||
if ( !Connected )
|
||||
return;
|
||||
|
||||
msg = OutParse( m, m.Name + ": " + msg );
|
||||
s_Connection.SendMessage( String.Format( "PRIVMSG {0} : {1}", Data.IrcRoom, msg ));
|
||||
|
||||
BroadcastRaw( String.Format( "PRIVMSG {0} : {1}", Data.IrcRoom, msg ) );
|
||||
}
|
||||
|
||||
private string OutParse( Mobile m, string str )
|
||||
{
|
||||
if ( m.AccessLevel != AccessLevel.Player )
|
||||
return str = '\x0003' + ((int)Data.IrcStaffColor).ToString() + str;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
private void BroadcastSystem( string msg )
|
||||
{
|
||||
foreach( Data data in Data.Datas.Values )
|
||||
if ( data.Channels.Contains("IRC") && !data.Banned )
|
||||
data.Mobile.SendMessage( data.SystemC, msg );
|
||||
}
|
||||
|
||||
private void Broadcast( string name, string msg )
|
||||
{
|
||||
if (!(Channel.GetByName("IRC") is IRC))
|
||||
return;
|
||||
|
||||
((IRC)Channel.GetByName("IRC")).Broadcast(name, msg);
|
||||
}
|
||||
|
||||
private void Broadcast( Mobile m, string msg )
|
||||
{
|
||||
}
|
||||
|
||||
private void BroadcastRaw( string msg )
|
||||
{
|
||||
foreach( Data data in Data.Datas.Values )
|
||||
if ( data.IrcRaw )
|
||||
data.Mobile.SendMessage( data.SystemC, "RAW: " + msg );
|
||||
}
|
||||
|
||||
private void ReadStream()
|
||||
{try{
|
||||
|
||||
string input = "";
|
||||
|
||||
while( c_Thread.IsAlive )
|
||||
{
|
||||
input = c_Reader.ReadLine();
|
||||
|
||||
if ( input == null )
|
||||
break;
|
||||
|
||||
HandleInput( input );
|
||||
}
|
||||
|
||||
Disconnect();
|
||||
|
||||
}catch{ Disconnect(); } }
|
||||
|
||||
private void HandleInput( string str )
|
||||
{try{
|
||||
|
||||
if (str == null)
|
||||
return;
|
||||
|
||||
BroadcastRaw( str );
|
||||
|
||||
if ( str.IndexOf( "PONG" ) != -1 || str.IndexOf("PING") != -1 )
|
||||
{
|
||||
PingPong( str );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( str.IndexOf( "353" ) != -1 )
|
||||
{
|
||||
BroadcastRaw( General.Local(109) );
|
||||
|
||||
int index = str.ToLower().IndexOf( Data.IrcRoom.ToLower() ) + Data.IrcRoom.Length + 2;
|
||||
|
||||
if ( index == 1 )
|
||||
return;
|
||||
|
||||
string strList = str.Substring( index, str.Length-index );
|
||||
|
||||
string[] strs = strList.Trim().Split( ' ' );
|
||||
|
||||
Data.IrcList.Clear();
|
||||
Data.IrcList.AddRange( strs );
|
||||
Data.IrcList.Remove( Data.IrcNick );
|
||||
}
|
||||
|
||||
if (str.IndexOf("001") != -1 && c_Connecting)
|
||||
{
|
||||
c_Connected = true;
|
||||
c_Connecting = false;
|
||||
BroadcastSystem(General.Local(108));
|
||||
c_Attempts = 1;
|
||||
|
||||
SendMessage(String.Format("JOIN {0}", Data.IrcRoom));
|
||||
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
if (data.Mobile.HasGump(typeof(SetupGump)))
|
||||
General.RefreshGump(data.Mobile, typeof(SetupGump));
|
||||
}
|
||||
|
||||
if (str.Length > 300)
|
||||
return;
|
||||
|
||||
if (str.IndexOf("PRIVMSG") != -1)
|
||||
{
|
||||
string parOne = str.Substring( 1, str.IndexOf( "!" )-1 );
|
||||
|
||||
string parThree = str.Substring( str.IndexOf( "!" )+1, str.Length-str.IndexOf("!")-(str.Length-str.IndexOf("PRIVMSG"))-1);
|
||||
|
||||
int index = 0;
|
||||
|
||||
index = str.ToLower().IndexOf( Data.IrcRoom.ToLower() ) + Data.IrcRoom.Length + 2;
|
||||
|
||||
if ( index == 1 )
|
||||
return;
|
||||
|
||||
string parTwo = str.Substring( index, str.Length-index );
|
||||
|
||||
if ( parTwo.IndexOf( "ACTION" ) != -1 )
|
||||
{
|
||||
index = parTwo.IndexOf( "ACTION" ) + 7;
|
||||
parTwo = parTwo.Substring( index, parTwo.Length-index );
|
||||
str = String.Format( "<{0}> {1} {2}", Data.IrcRoom, parOne, parTwo );
|
||||
}
|
||||
else
|
||||
str = String.Format( "<{0}> {1}: {2}", Data.IrcRoom, parOne, parTwo );
|
||||
|
||||
Broadcast( parOne, str );
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e) { Errors.Report(String.Format("IrcConnection-> HandleInput")); Console.WriteLine(e.Message); }}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
Disconnect( true );
|
||||
}
|
||||
|
||||
public void Disconnect(bool reconn)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (c_Connected)
|
||||
BroadcastSystem(General.Local(110));
|
||||
|
||||
c_Connected = false;
|
||||
c_Connecting = false;
|
||||
|
||||
if (c_Thread != null)
|
||||
{
|
||||
c_Thread.Abort();
|
||||
c_Thread = null;
|
||||
}
|
||||
if (c_Reader != null)
|
||||
c_Reader.Close();
|
||||
if (c_Writer != null)
|
||||
c_Writer.Close();
|
||||
if (c_Tcp != null)
|
||||
c_Tcp.Close();
|
||||
|
||||
if (reconn)
|
||||
Reconnect();
|
||||
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
if (data.Mobile.HasGump(typeof(SetupGump)))
|
||||
General.RefreshGump(data.Mobile, typeof(SetupGump));
|
||||
}
|
||||
catch { Errors.Report(String.Format("IrcConnection-> Disconnect")); }
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Message.cs
Normal file
89
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Message.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public enum MsgType { Normal, Invite, System }
|
||||
|
||||
public class Message
|
||||
{
|
||||
public static bool CanMessage(Mobile from, Mobile to)
|
||||
{
|
||||
if (from.AccessLevel > to.AccessLevel)
|
||||
return true;
|
||||
|
||||
Data df = Data.GetData(from);
|
||||
Data dt = Data.GetData(to);
|
||||
|
||||
if (df.Banned || dt.Banned)
|
||||
return false;
|
||||
if (df.FriendsOnly && !df.Friends.Contains(to))
|
||||
return false;
|
||||
if (dt.FriendsOnly && !dt.Friends.Contains(from))
|
||||
return false;
|
||||
if (df.Ignores.Contains(to))
|
||||
return false;
|
||||
if (dt.Ignores.Contains(from))
|
||||
return false;
|
||||
if (dt.Messages.Count >= Data.MaxMsgs)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private Mobile c_From;
|
||||
private string c_Msg, c_Subject;
|
||||
private MsgType c_Type;
|
||||
private DateTime c_Received;
|
||||
private bool c_Read;
|
||||
|
||||
public Mobile From { get { return c_From; } }
|
||||
public string Msg { get { return c_Msg; } }
|
||||
public string Subject { get { return c_Subject; } }
|
||||
public MsgType Type { get { return c_Type; } }
|
||||
public DateTime Received { get { return c_Received; } }
|
||||
public bool Read { get { return c_Read; } set { c_Read = value; } }
|
||||
|
||||
public Message()
|
||||
{
|
||||
c_Msg = "";
|
||||
c_Subject = "";
|
||||
}
|
||||
|
||||
public Message(Mobile from, string sub, string msg, MsgType type)
|
||||
{
|
||||
c_From = from;
|
||||
c_Msg = msg;
|
||||
c_Subject = sub;
|
||||
c_Type = type;
|
||||
|
||||
c_Received = DateTime.Now;
|
||||
}
|
||||
|
||||
public void Save(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0); // Version
|
||||
|
||||
writer.Write(c_From);
|
||||
writer.Write(c_Msg);
|
||||
writer.Write(c_Subject);
|
||||
writer.Write((int)c_Type);
|
||||
writer.Write(c_Received);
|
||||
writer.Write(c_Read);
|
||||
}
|
||||
|
||||
public void Load(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
c_From = reader.ReadMobile();
|
||||
c_Msg = reader.ReadString();
|
||||
c_Subject = reader.ReadString();
|
||||
c_Type = (MsgType)reader.ReadInt();
|
||||
c_Received = reader.ReadDateTime();
|
||||
c_Read = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
462
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Profile.cs
Normal file
462
Scripts/SubSystem/Knives Chat 3.0 Beta 6/General/Profile.cs
Normal file
@@ -0,0 +1,462 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class Profile
|
||||
{
|
||||
public static void Insert(Mobile m, GumpPlus g, int x, int y)
|
||||
{
|
||||
if ( m == null )
|
||||
return;
|
||||
|
||||
Data data = Data.GetData(g.Owner);
|
||||
|
||||
int oldY = y;
|
||||
|
||||
g.AddHtml(x, y += 10, 300, 21, HTML.White + "<CENTER>" + Server.Misc.Titles.ComputeTitle(g.Owner, m), false, false);
|
||||
|
||||
if (m.AccessLevel != AccessLevel.Player)
|
||||
g.AddHtml(x, y += 20, 300, 21, HTML.White + "<CENTER>" + m.AccessLevel, false, false);
|
||||
else
|
||||
{
|
||||
if (m.Guild != null)
|
||||
g.AddHtml(x, y += 20, 300, 21, HTML.White + "<CENTER>[" + m.Guild.Abbreviation + "] " + m.GuildTitle, false, false);
|
||||
if(General.IsInFaction(m))
|
||||
g.AddHtml(x, y += 20, 300, 21, HTML.White + "<CENTER>" + General.FactionName(m) + " " + General.FactionTitle(m), false, false);
|
||||
}
|
||||
|
||||
g.AddButton(x + 20, (y += 30) + 3, 0x2716, 0x2716, "Friend", new TimerStateCallback(Friend), new object[] { data, m, g });
|
||||
g.AddHtml(x + 40, y, 120, 21, HTML.White + (data.Friends.Contains(m) ? General.Local(1) : General.Local(0)), false, false);
|
||||
|
||||
g.AddButton(x + 170, y + 3, 0x2716, 0x2716, "Ignore", new TimerStateCallback(Ignore), new object[] { data, m, g });
|
||||
g.AddHtml(x + 190, y, 120, 21, HTML.White + (data.Ignores.Contains(m) ? General.Local(3) : General.Local(2)), false, false);
|
||||
|
||||
if (Chat3.Message.CanMessage(data.Mobile, m))
|
||||
{
|
||||
g.AddButton(x + 20, (y += 20) + 3, 0x2716, 0x2716, "Send Message", new TimerStateCallback(Message), new object[] { data, m, g });
|
||||
g.AddHtml(x + 40, y, 120, 21, HTML.White + General.Local(13), false, false);
|
||||
}
|
||||
|
||||
if (data.Mobile.AccessLevel >= AccessLevel.GameMaster && data.Mobile.AccessLevel > m.AccessLevel)
|
||||
{
|
||||
g.AddButton(x + 170, y + 3, 0x2716, 0x2716, "Read Messages", new TimerStateCallback(ReadMessages), new object[] { data, m, g });
|
||||
g.AddHtml(x + 190, y, 120, 21, HTML.Red + General.Local(14), false, false, false);
|
||||
}
|
||||
|
||||
y += 20;
|
||||
|
||||
if (data.Mobile.AccessLevel == AccessLevel.Administrator && m.AccessLevel != AccessLevel.Administrator && m.AccessLevel != AccessLevel.Player)
|
||||
{
|
||||
g.AddButton(x + 20, y + 3, 0x2716, 0x2716, "Global Access", new TimerStateCallback(GlobalAccess), new object[] { m, g });
|
||||
g.AddHtml(x + 40, y, 120, 21, HTML.LightPurple + (Data.GetData(m).GlobalAccess ? General.Local(5) : General.Local(4)), false, false, false);
|
||||
}
|
||||
|
||||
if (data.Mobile.AccessLevel >= AccessLevel.GameMaster && m.AccessLevel == AccessLevel.Player)
|
||||
{
|
||||
g.AddButton(x + 170, y + 3, 0x2716, 0x2716, "Ban", new TimerStateCallback(Ban), new object[] { m, g });
|
||||
g.AddHtml(x + 190, y, 120, 21, HTML.Red + (Data.GetData(m).Banned ? General.Local(7) : General.Local(6)), false, false, false);
|
||||
}
|
||||
|
||||
if (data.GlobalAccess)
|
||||
{
|
||||
y += 20;
|
||||
|
||||
if (data.Global)
|
||||
{
|
||||
g.AddButton(x + 20, y + 3, 0x2716, 0x2716, "Global Ignore", new TimerStateCallback(GIgnore), new object[] { data, m, g });
|
||||
g.AddHtml(x + 40, y, 120, 21, HTML.Red + (data.GIgnores.Contains(m) ? General.Local(9) : General.Local(8)), false, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
g.AddButton(x + 170, y + 3, 0x2716, 0x2716, "Global Listen", new TimerStateCallback(GListen), new object[] { data, m, g });
|
||||
g.AddHtml(x + 190, y, 120, 21, HTML.Red + (data.GListens.Contains(m) ? General.Local(11) : General.Local(10)), false, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (data.Mobile.AccessLevel >= AccessLevel.GameMaster && m.NetState != null)
|
||||
{
|
||||
g.AddButton(x + 20, (y += 20) + 3, 0x2716, 0x2716, "Client", new TimerStateCallback(Client), new object[] { data, m, g });
|
||||
g.AddHtml(x + 40, y, 120, 21, HTML.Red + General.Local(15), false, false, false);
|
||||
|
||||
g.AddButton(x + 170, y + 3, 0x2716, 0x2716, "Goto", new TimerStateCallback(Goto), new object[] { data, m, g });
|
||||
g.AddHtml(x + 190, y, 120, 21, HTML.Red + General.Local(16), false, false, false);
|
||||
}
|
||||
|
||||
if (data.MsgSound)
|
||||
{
|
||||
g.AddHtml(x, y+=25, 300, 21, HTML.White + "<CENTER>" + General.Local(17), false, false);
|
||||
g.AddImageTiled(x+125, y+=25, 50, 21, 0xBBA);
|
||||
g.AddTextField(x+125, y, 50, 21, 0x480, 0, data.GetSound(m).ToString());
|
||||
g.AddButton(x + 185, y+3, 0x15E1, 0x15E5, "Play Sound", new TimerStateCallback(PlaySound), new object[] { data, m, g });
|
||||
g.AddButton(x + 110, y, 0x983, 0x983, "Sound Up", new TimerStateCallback(SoundUp), new object[] { data, m, g });
|
||||
g.AddButton(x + 110, y+10, 0x985, 0x985, "Sound Down", new TimerStateCallback(SoundDown), new object[] { data, m, g });
|
||||
}
|
||||
|
||||
g.Entries.Insert( 0, new GumpBackground(x, oldY, 300, y+40-oldY, 0x1400));
|
||||
}
|
||||
|
||||
private static void Friend(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
if (Data.GetData(m).ByRequest && !data.Friends.Contains(m))
|
||||
{
|
||||
if (!TrackSpam.LogSpam(g.Owner, "Request " + m.Name, TimeSpan.FromHours(24)))
|
||||
{
|
||||
TimeSpan ts = TrackSpam.NextAllowedIn(g.Owner, "Request " + m.Name, TimeSpan.FromHours(Data.RequestSpam));
|
||||
string txt = (ts.Days != 0 ? ts.Days + " " + General.Local(170) + " " : "") + (ts.Hours != 0 ? ts.Hours + " " + General.Local(171) + " " : "") + (ts.Minutes != 0 ? ts.Minutes + " " + General.Local(172) + " " : "");
|
||||
|
||||
g.Owner.SendMessage(data.SystemC, General.Local(96) + " " + txt);
|
||||
g.NewGump();
|
||||
return;
|
||||
}
|
||||
|
||||
Data.GetData(m).AddMessage(new Message(g.Owner, General.Local(84), General.Local(85), MsgType.Invite));
|
||||
|
||||
g.Owner.SendMessage(data.SystemC, General.Local(86) + " " + m.Name);
|
||||
|
||||
if (m.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(m, typeof(FriendsGump));
|
||||
else
|
||||
FriendsGump.SendTo(m, true);
|
||||
|
||||
General.RefreshGump(m, typeof(MailGump));
|
||||
|
||||
g.NewGump();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.Friends.Contains(m))
|
||||
data.RemoveFriend(m);
|
||||
else
|
||||
data.AddFriend(m);
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void Ignore(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
if (data.Ignores.Contains(m))
|
||||
data.RemoveIgnore(m);
|
||||
else
|
||||
data.AddIgnore(m);
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void Message(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
g.NewGump();
|
||||
|
||||
if (Chat3.Message.CanMessage(data.Mobile, m))
|
||||
SendMessageGump.SendTo(data.Mobile, m);
|
||||
}
|
||||
|
||||
private static void ReadMessages(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
g.NewGump();
|
||||
|
||||
MailGump.SendTo(data.Mobile, m);
|
||||
}
|
||||
|
||||
private static void GlobalAccess(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 2 || !(obj[0] is Mobile) || !(obj[1] is GumpPlus))
|
||||
return;
|
||||
|
||||
Mobile m = (Mobile)obj[0];
|
||||
GumpPlus g = (GumpPlus)obj[1];
|
||||
|
||||
Data.GetData(m).GlobalAccess = !Data.GetData(m).GlobalAccess;
|
||||
|
||||
if (Data.GetData(m).GlobalAccess)
|
||||
g.Owner.SendMessage(Data.GetData(g.Owner).SystemC, m.Name + " " + General.Local(75));
|
||||
else
|
||||
g.Owner.SendMessage(Data.GetData(g.Owner).SystemC, m.Name + " " + General.Local(76));
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void Ban(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 2 || !(obj[0] is Mobile) || !(obj[1] is GumpPlus))
|
||||
return;
|
||||
|
||||
Mobile m = (Mobile)obj[0];
|
||||
GumpPlus g = (GumpPlus)obj[1];
|
||||
|
||||
if (Data.GetData(m).Banned)
|
||||
{
|
||||
Data.GetData(m).RemoveBan();
|
||||
g.Owner.SendMessage(Data.GetData(g.Owner).SystemC, General.Local(78) + " " + m.Name);
|
||||
g.NewGump();
|
||||
}
|
||||
else
|
||||
new InternalGump(m, g);
|
||||
}
|
||||
|
||||
private static void GIgnore(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
if (data.GIgnores.Contains(m))
|
||||
data.RemoveGIgnore(m);
|
||||
else
|
||||
data.AddGIgnore(m);
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void GListen(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
if (data.GListens.Contains(m))
|
||||
data.RemoveGListen(m);
|
||||
else
|
||||
data.AddGListen(m);
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void Client(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
g.NewGump();
|
||||
|
||||
if (m.NetState == null)
|
||||
data.Mobile.SendMessage(data.SystemC, m.Name + " " + General.Local(83));
|
||||
else
|
||||
data.Mobile.SendGump(new ClientGump(data.Mobile, m.NetState));
|
||||
}
|
||||
|
||||
private static void Goto(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
if (m.NetState == null)
|
||||
data.Mobile.SendMessage(data.SystemC, m.Name + " " + General.Local(83));
|
||||
else
|
||||
{
|
||||
data.Mobile.Location = m.Location;
|
||||
data.Mobile.Map = m.Map;
|
||||
}
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void PlaySound(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
data.SetSound(m, Utility.ToInt32(g.GetTextField(0)));
|
||||
data.Mobile.SendSound(data.GetSound(m));
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void SoundUp(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
data.SetSound(m, data.GetSound(m) + 1);
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
private static void SoundDown(object o)
|
||||
{
|
||||
if (!(o is object[]))
|
||||
return;
|
||||
|
||||
object[] obj = (object[])o;
|
||||
|
||||
if (obj.Length != 3 || !(obj[0] is Data) || !(obj[1] is Mobile) || !(obj[2] is GumpPlus))
|
||||
return;
|
||||
|
||||
Data data = (Data)obj[0];
|
||||
Mobile m = (Mobile)obj[1];
|
||||
GumpPlus g = (GumpPlus)obj[2];
|
||||
|
||||
data.SetSound(m, data.GetSound(m) - 1);
|
||||
|
||||
g.NewGump();
|
||||
}
|
||||
|
||||
|
||||
private class InternalGump : GumpPlus
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
private Mobile c_Target;
|
||||
|
||||
public InternalGump(Mobile m, GumpPlus g) : base(g.Owner, 100, 100)
|
||||
{
|
||||
c_Gump = g;
|
||||
c_Target = m;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, 150, 21, HTML.White + "<CENTER>" + General.Local(160), false, false);
|
||||
|
||||
AddHtml(40, y += 20, 100, 21, HTML.White + General.Local(161), false, false);
|
||||
AddButton(25, y + 3, 0x2716, 0x2716, "30 minutes", new TimerStateCallback(BanTime), TimeSpan.FromMinutes(30));
|
||||
AddHtml(40, y += 20, 100, 21, HTML.White + General.Local(162), false, false);
|
||||
AddButton(25, y + 3, 0x2716, 0x2716, "1 hour", new TimerStateCallback(BanTime), TimeSpan.FromHours(1));
|
||||
AddHtml(40, y += 20, 100, 21, HTML.White + General.Local(163), false, false);
|
||||
AddButton(25, y + 3, 0x2716, 0x2716, "12 hours", new TimerStateCallback(BanTime), TimeSpan.FromHours(12));
|
||||
AddHtml(40, y += 20, 100, 21, HTML.White + General.Local(164), false, false);
|
||||
AddButton(25, y + 3, 0x2716, 0x2716, "1 day", new TimerStateCallback(BanTime), TimeSpan.FromDays(1));
|
||||
AddHtml(40, y += 20, 100, 21, HTML.White + General.Local(165), false, false);
|
||||
AddButton(25, y + 3, 0x2716, 0x2716, "1 week", new TimerStateCallback(BanTime), TimeSpan.FromDays(7));
|
||||
AddHtml(40, y += 20, 100, 21, HTML.White + General.Local(166), false, false);
|
||||
AddButton(25, y + 3, 0x2716, 0x2716, "1 month", new TimerStateCallback(BanTime), TimeSpan.FromDays(30));
|
||||
AddHtml(40, y += 20, 100, 21, HTML.White + General.Local(167), false, false);
|
||||
AddButton(25, y + 3, 0x2716, 0x2716, "1 year", new TimerStateCallback(BanTime), TimeSpan.FromDays(365));
|
||||
|
||||
Entries.Insert(0, new GumpBackground(0, 0, 150, y + 40, 0x1400));
|
||||
}
|
||||
|
||||
private void BanTime(object o)
|
||||
{
|
||||
if (!(o is TimeSpan))
|
||||
return;
|
||||
|
||||
Data.GetData(c_Target).Ban((TimeSpan)o);
|
||||
Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(77) + " " + c_Target.Name);
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class TrackSpam
|
||||
{
|
||||
private static Hashtable s_Log = new Hashtable();
|
||||
|
||||
public static bool LogSpam( Mobile m, string type, TimeSpan limit )
|
||||
{
|
||||
if ( s_Log.Contains( m ) )
|
||||
{
|
||||
Hashtable table = (Hashtable)s_Log[m];
|
||||
|
||||
if ( table.Contains( type ) )
|
||||
{
|
||||
if ( (DateTime)table[type] > DateTime.Now-limit )
|
||||
return false;
|
||||
|
||||
table[type] = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Hashtable table = new Hashtable();
|
||||
table[type] = DateTime.Now;
|
||||
s_Log[m] = table;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static TimeSpan NextAllowedIn( Mobile m, string type, TimeSpan limit )
|
||||
{
|
||||
if ( s_Log[m] == null )
|
||||
return TimeSpan.FromSeconds( 1 );
|
||||
|
||||
Hashtable table = (Hashtable)s_Log[m];
|
||||
|
||||
if ( table[type] == null || (DateTime)table[type]+limit < DateTime.Now )
|
||||
return TimeSpan.FromSeconds( 1 );
|
||||
|
||||
return (DateTime)table[type]+limit-DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
1114
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/ChannelGump.cs
Normal file
1114
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/ChannelGump.cs
Normal file
File diff suppressed because it is too large
Load Diff
645
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/FriendsGump.cs
Normal file
645
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/FriendsGump.cs
Normal file
@@ -0,0 +1,645 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.HuePickers;
|
||||
using Server.Gumps;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class FriendsGump : GumpPlus
|
||||
{
|
||||
public static void SendTo(Mobile m)
|
||||
{
|
||||
SendTo(m, false);
|
||||
}
|
||||
|
||||
public static void SendTo(Mobile m, bool min)
|
||||
{
|
||||
General.ClearGump(m, typeof(FriendsGump));
|
||||
|
||||
new FriendsGump(m, min);
|
||||
}
|
||||
|
||||
#region Class Definitions
|
||||
|
||||
private int c_Page, c_Height, c_Width;
|
||||
private Mobile c_Profile;
|
||||
private bool c_Minimized, c_Options, c_Search;
|
||||
private string c_TxtSearch, c_CharSearch;
|
||||
|
||||
public Data GetData { get { return Data.GetData(Owner); } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public FriendsGump(Mobile m, bool min) : base(m, 250, 50)
|
||||
{
|
||||
c_Minimized = min;
|
||||
|
||||
if (c_Minimized)
|
||||
Override = false;
|
||||
|
||||
c_Page = 0;
|
||||
c_TxtSearch = "";
|
||||
c_CharSearch = "";
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
Owner.CloseGump(typeof(FriendsGump));
|
||||
|
||||
c_Height = 80 + (GetData.FriendsPP * 20);
|
||||
c_Width = 160;
|
||||
|
||||
if (c_Minimized)
|
||||
AddImage(0, 0, 0x9C5);
|
||||
else
|
||||
AddBackground(0, 0, c_Width, c_Height, 0x1400);
|
||||
|
||||
AddButton(0, 0, 0x13A8, 0x13A8, "Minimize", new TimerCallback(Minimize));
|
||||
|
||||
if ( c_Minimized )
|
||||
AddLabel(1, -3, 0x47E, "^");
|
||||
else
|
||||
AddLabel(2, -9, 0x47E, "_");
|
||||
|
||||
if (c_Minimized)
|
||||
DisplayMin();
|
||||
else
|
||||
DisplayList();
|
||||
}
|
||||
|
||||
private void DisplayMin()
|
||||
{
|
||||
AddHtml(60, 1, 80, 21, HTML.White + General.Local(19 + (int)GetData.Status), false, false, false);
|
||||
AddButton(42, 5, 0x2716, 0x2716, "Status", new TimerCallback(Status));
|
||||
|
||||
if (GetData.NewMsg())
|
||||
AddButton(20, 2, 0x1523, 0x1523, "Check Message", new TimerCallback(CheckMsg));
|
||||
}
|
||||
|
||||
private ArrayList BuildList()
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
if (c_TxtSearch == "" && c_CharSearch == "")
|
||||
{
|
||||
list = new ArrayList( GetData.Friends );
|
||||
|
||||
foreach( Message msg in GetData.Messages )
|
||||
if (!msg.Read && !list.Contains(msg.From))
|
||||
list.Add(msg.From);
|
||||
|
||||
list.Sort(new InternalSort(GetData));
|
||||
return list;
|
||||
}
|
||||
|
||||
foreach( Mobile m in GetData.Friends )
|
||||
if( m.Name.ToLower().IndexOf(c_TxtSearch.ToLower()) != -1 || m.Name.ToLower().IndexOf(c_CharSearch.ToLower()) == 0 )
|
||||
list.Add(m);
|
||||
|
||||
list.Sort(new InternalSort(GetData));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private void DisplayList()
|
||||
{
|
||||
if (c_Profile != null && !GetData.Friends.Contains(c_Profile))
|
||||
c_Profile = null;
|
||||
|
||||
if (c_Profile != null)
|
||||
Chat3.Profile.Insert(c_Profile, this, c_Width+20, 0);
|
||||
if (c_Search)
|
||||
SearchTab();
|
||||
if (c_Options)
|
||||
OptionsTab();
|
||||
|
||||
ArrayList list = BuildList();
|
||||
|
||||
int perpage = GetData.FriendsPP;
|
||||
int y = 10;
|
||||
|
||||
if ( perpage*c_Page > list.Count || c_Page < 0 )
|
||||
c_Page = 0;
|
||||
|
||||
AddImage(8, y - 1, 0x9C5);
|
||||
AddHtml(10, y, c_Width - 20, 21, HTML.White + "<CENTER>" + General.Local(32), false, false, false);
|
||||
|
||||
y += 20;
|
||||
|
||||
if (perpage*(c_Page+1) < list.Count)
|
||||
AddButton(c_Width / 2 - 10, c_Height - 25, 0x25E8, 0x25E9, "Page Up", new TimerCallback(PageUp));
|
||||
if (c_Page != 0)
|
||||
AddButton(c_Width/2-10, 30, 0x25E4, 0x25E5, "Page Down", new TimerCallback(PageDown));
|
||||
|
||||
AddButton(10, 32, 0x983, 0x983, "PerPage Down", new TimerCallback(PerPageDown));
|
||||
AddButton(20, 32, 0x985, 0x985, "PerPage Up", new TimerCallback(PerPageUp));
|
||||
|
||||
AddButton(6, c_Height - 30, 0x768, 0x768, "Options", new TimerCallback(Options));
|
||||
AddButton(22, c_Height - 30, 0x768, 0x768, "Search", new TimerCallback(Search));
|
||||
AddLabel(11, c_Height - 30, c_Options ? 0x34 : 0x47E, "O");
|
||||
AddLabel(27, c_Height - 30, c_Search ? 0x34 : 0x47E, "S");
|
||||
|
||||
AddHtml(c_Width-53, c_Height-29, 80, 21, HTML.White + General.Local(19+(int)GetData.Status), false, false);
|
||||
AddButton(c_Width-70, c_Height-26, 0x2716, 0x2716, "Status", new TimerCallback(Status));
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = perpage * c_Page; i < list.Count && i < perpage * (c_Page + 1); ++i)
|
||||
{
|
||||
AddHtml(45, y += 20, 90, 21, HTML.White + ((Mobile)list[i]).Name + (Data.GetData((Mobile)list[i]).Status != OnlineStatus.Online ? " (" + General.Local(19 + (int)Data.GetData((Mobile)list[i]).Status) + ")" : ""), false, false, false);
|
||||
|
||||
AddButton(30, y + 3, list[i] == c_Profile ? 0x939 : 0x2716, list[i] == c_Profile ? 0x939 : 0x2716, "Profile", new TimerStateCallback(Profile), (Mobile)list[i]);
|
||||
|
||||
if (GetData.NewMsgFrom((Mobile)list[i]))
|
||||
AddButton(10, y, 0x1523, 0x1523, "Check Message From", new TimerStateCallback(CheckMsgFrom), (Mobile)list[i]);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
AddHtml(45, y += 20, 80, 21, HTML.White + "!!!", false, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void SearchTab()
|
||||
{
|
||||
AddBackground(c_Width + 20, 10, 130, 40, 0x1400);
|
||||
|
||||
AddImageTiled(c_Width + 30, 20, 90, 21, 0xBBC);
|
||||
AddTextField(c_Width + 30, 20, 90, 21, 0x480, 1, c_TxtSearch);
|
||||
AddButton(c_Width + 127, 24, 0x2716, 0x2716, "Text Search", new TimerCallback(TxtSearch));
|
||||
|
||||
char[] chars = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
|
||||
|
||||
int x = c_Width + 17;
|
||||
int y = 51;
|
||||
|
||||
foreach (char c in chars)
|
||||
{
|
||||
AddButton(x += 20, y, 0x2344, 0x2344, "Char Search", new TimerStateCallback(CharSearch), c.ToString());
|
||||
AddHtml(x + 6, y, 20, 20, (c_CharSearch == c.ToString() ? HTML.Green : HTML.White) + c, false, false, false);
|
||||
|
||||
if (x >= c_Width + 115)
|
||||
{
|
||||
x = c_Width + 17;
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OptionsTab()
|
||||
{
|
||||
int x = c_Width+20;
|
||||
|
||||
AddHtml(x, 10, 300, 21, HTML.White + "<CENTER>" + General.Local(18), false, false);
|
||||
|
||||
int y = 10;
|
||||
|
||||
if (GetData.GlobalAccess && GetData.Global)
|
||||
{
|
||||
AddHtml(x + 120, y+=25, 120, 21, HTML.Red + General.Local(26), false, false, false);
|
||||
AddButton(x + 70, y, GetData.GlobalM ? 0x2343 : 0x2342, GetData.GlobalM ? 0x2343 : 0x2342, "Global Messages", new TimerCallback(GlobalMsg));
|
||||
AddImage(x + 90, y, 0x2342, GetData.GlobalMC);
|
||||
AddButton(x + 94, y + 4, 0x2716, 0x2716, "GlobalMsgColor", new TimerCallback(GlobalMsgColor));
|
||||
}
|
||||
|
||||
AddHtml(x + 60, y += 25, 220, 21, HTML.White + General.Local(24), false, false);
|
||||
AddButton(x + 30, y, GetData.FriendsOnly ? 0x2343 : 0x2342, GetData.FriendsOnly ? 0x2343 : 0x2342, "Friends Only", new TimerCallback(FriendsOnly));
|
||||
AddHtml(x + 60, y += 20, 220, 21, HTML.White + General.Local(25), false, false);
|
||||
AddButton(x + 30, y, GetData.ByRequest ? 0x2343 : 0x2342, GetData.ByRequest ? 0x2343 : 0x2342, "Friend Request", new TimerCallback(FriendRequest));
|
||||
AddHtml(x + 60, y+=20, 220, 21, HTML.White + General.Local(30), false, false);
|
||||
AddButton(x + 30, y, GetData.FriendAlert ? 0x2343 : 0x2342, GetData.FriendAlert ? 0x2343 : 0x2342, "Friend Alert", new TimerCallback(FriendAlert));
|
||||
AddHtml(x + 60, y += 20, 220, 21, HTML.White + General.Local(196), false, false);
|
||||
AddButton(x + 30, y, GetData.ReadReceipt ? 0x2343 : 0x2342, GetData.ReadReceipt ? 0x2343 : 0x2342, "Read Receipt", new TimerCallback(ReadReceipt));
|
||||
|
||||
AddHtml(x + 30, y += 25, 170, 21, HTML.White + General.Local(29), false, false);
|
||||
AddImageTiled(x + 175, y, 70, 21, 0xBBA);
|
||||
AddTextField(x + 175, y, 70, 21, 0x480, 2, GetData.FriendsSpeech);
|
||||
AddButton(x + 255, y + 3, 0x2716, 0x2716, "Submit Speech", new TimerCallback(SubmitSpeech));
|
||||
|
||||
AddHtml(x + 60, y += 23, 220, 21, HTML.White + General.Local(27), false, false);
|
||||
AddButton(x + 30, y, GetData.MsgSound ? 0x2343 : 0x2342, GetData.MsgSound ? 0x2343 : 0x2342, "Message Sound", new TimerCallback(MessageSound));
|
||||
|
||||
if (GetData.MsgSound)
|
||||
{
|
||||
AddHtml(x, y+=25, 300, 21, HTML.White + "<CENTER>" + General.Local(28), false, false);
|
||||
AddImageTiled(x+125, y+=25, 50, 21, 0xBBA);
|
||||
AddTextField(x+125, y, 50, 21, 0x480, 1, GetData.DefaultSound.ToString());
|
||||
AddButton(x + 185, y+3, 0x15E1, 0x15E5, "Play Sound", new TimerCallback(PlaySound));
|
||||
AddButton(x + 110, y, 0x983, 0x983, "Sound Up", new TimerCallback(SoundUp));
|
||||
AddButton(x + 110, y+10, 0x985, 0x985, "Sound Down", new TimerCallback(SoundDown));
|
||||
}
|
||||
|
||||
Entries.Insert(0, new GumpBackground(x, 0, 300, y+40, 0x1400));
|
||||
}
|
||||
|
||||
private string GetColor(Mobile m)
|
||||
{
|
||||
if (Owner == m)
|
||||
return HTML.Yellow;
|
||||
if (Data.GetData(m).Banned)
|
||||
return HTML.Red;
|
||||
if (GetData.Ignores.Contains(m))
|
||||
return HTML.AshRed;
|
||||
if (GetData.Global && GetData.GIgnores.Contains(m))
|
||||
return HTML.AshRed;
|
||||
if (!GetData.Global && GetData.GListens.Contains(m))
|
||||
return HTML.Blue;
|
||||
if (m.NetState == null)
|
||||
return HTML.DarkGray;
|
||||
if (Data.GetData(m).Status == OnlineStatus.Away || Data.GetData(m).Status == OnlineStatus.Busy)
|
||||
return HTML.Gray;
|
||||
if (m.AccessLevel > AccessLevel.Player)
|
||||
return HTML.LightPurple;
|
||||
if (m.Guild != null && (m.Guild == Owner.Guild))
|
||||
return HTML.Green;
|
||||
|
||||
return HTML.White;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
if (c_Profile != null || c_Search || c_Options)
|
||||
{
|
||||
c_Profile = null;
|
||||
c_Options = false;
|
||||
c_Search = false;
|
||||
NewGump();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Responses
|
||||
|
||||
private void Minimize()
|
||||
{
|
||||
c_Minimized = !c_Minimized;
|
||||
|
||||
if (c_Minimized)
|
||||
Override = false;
|
||||
else
|
||||
Override = true;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PageUp()
|
||||
{
|
||||
c_Page++;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PageDown()
|
||||
{
|
||||
c_Page--;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PerPageUp()
|
||||
{
|
||||
GetData.FriendsPP++;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PerPageDown()
|
||||
{
|
||||
GetData.FriendsPP--;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Search()
|
||||
{
|
||||
c_Search = !c_Search;
|
||||
|
||||
c_Profile = null;
|
||||
c_Options = false;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Options()
|
||||
{
|
||||
c_Options = !c_Options;
|
||||
|
||||
c_Profile = null;
|
||||
c_Search = false;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void CheckMsgFrom(object o)
|
||||
{
|
||||
if (!(o is Mobile))
|
||||
return;
|
||||
|
||||
GetData.CheckMsgFrom((Mobile)o);
|
||||
|
||||
General.RefreshGump(Owner, typeof(MailGump));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void CheckMsg()
|
||||
{
|
||||
GetData.CheckMsg();
|
||||
|
||||
General.RefreshGump(Owner, typeof(MailGump));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Profile(object o)
|
||||
{
|
||||
if (!(o is Mobile))
|
||||
return;
|
||||
|
||||
if (c_Profile == o)
|
||||
c_Profile = null;
|
||||
else
|
||||
c_Profile = (Mobile)o;
|
||||
|
||||
c_Options = false;
|
||||
c_Search = false;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void TxtSearch()
|
||||
{
|
||||
c_TxtSearch = GetTextField(1);
|
||||
c_CharSearch = "";
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void CharSearch(object o)
|
||||
{
|
||||
if (!(o is string))
|
||||
return;
|
||||
|
||||
if (c_CharSearch == o.ToString())
|
||||
c_CharSearch = "";
|
||||
else
|
||||
c_CharSearch = o.ToString();
|
||||
|
||||
c_TxtSearch = "";
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Status()
|
||||
{
|
||||
new StatusGump(Owner, this);
|
||||
}
|
||||
|
||||
private void FriendsOnly()
|
||||
{
|
||||
GetData.FriendsOnly = !GetData.FriendsOnly;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void FriendRequest()
|
||||
{
|
||||
GetData.ByRequest = !GetData.ByRequest;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void FriendAlert()
|
||||
{
|
||||
GetData.FriendAlert = !GetData.FriendAlert;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void ReadReceipt()
|
||||
{
|
||||
GetData.ReadReceipt = !GetData.ReadReceipt;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void GlobalMsg()
|
||||
{
|
||||
GetData.GlobalM = !GetData.GlobalM;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void GlobalMsgColor()
|
||||
{
|
||||
Owner.SendHuePicker(new InternalPicker(this));
|
||||
}
|
||||
|
||||
private void MessageSound()
|
||||
{
|
||||
GetData.MsgSound = !GetData.MsgSound;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PlaySound()
|
||||
{
|
||||
GetData.DefaultSound = Utility.ToInt32(GetTextField(1));
|
||||
Owner.SendSound(GetData.DefaultSound);
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SoundUp()
|
||||
{
|
||||
GetData.DefaultSound = GetData.DefaultSound+1;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SoundDown()
|
||||
{
|
||||
GetData.DefaultSound = GetData.DefaultSound-1;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SubmitSpeech()
|
||||
{
|
||||
GetData.FriendsSpeech = GetTextField(2);
|
||||
|
||||
if (GetData.FriendsSpeech != "")
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(70) + " \"" + GetData.FriendsSpeech + "\"");
|
||||
else
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(71));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Classes
|
||||
|
||||
private class InternalSort : IComparer
|
||||
{
|
||||
private Data c_Data;
|
||||
|
||||
public InternalSort( Data data )
|
||||
{
|
||||
c_Data = data;
|
||||
}
|
||||
|
||||
public int Compare(object x, object y)
|
||||
{
|
||||
if (x == null && y == null)
|
||||
return 0;
|
||||
if (x == null || !(x is Mobile))
|
||||
return -1;
|
||||
if (y == null || !(y is Mobile))
|
||||
return 1;
|
||||
|
||||
Mobile a = (Mobile)x;
|
||||
Mobile b = (Mobile)y;
|
||||
|
||||
if (c_Data.NewMsgFrom(a) && !c_Data.NewMsgFrom(b))
|
||||
return 1;
|
||||
if (c_Data.NewMsgFrom(b) && !c_Data.NewMsgFrom(a))
|
||||
return -1;
|
||||
|
||||
if (a.NetState != null && b.NetState == null)
|
||||
return 1;
|
||||
if (a.NetState == null && b.NetState != null)
|
||||
return -1;
|
||||
|
||||
return Insensitive.Compare(a.Name, b.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class StatusGump : GumpPlus
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
|
||||
public StatusGump(Mobile m, GumpPlus g) : base(m, 100, 100)
|
||||
{
|
||||
m.CloseGump(typeof(StatusGump));
|
||||
|
||||
c_Gump = g;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
AddBackground(0, 0, 100, 100, 0x1400);
|
||||
|
||||
int y = 20;
|
||||
|
||||
AddHtml(40, y, 80, 21, HTML.White + General.Local(19), false, false, false);
|
||||
AddButton(20, y + 2, 0x2716, 0x2716, "Online", new TimerStateCallback(Status), OnlineStatus.Online);
|
||||
AddHtml(40, y += 20, 80, 21, HTML.White + General.Local(20), false, false, false);
|
||||
AddButton(20, y + 2, 0x2716, 0x2716, "Away", new TimerStateCallback(Status), OnlineStatus.Away);
|
||||
AddHtml(40, y += 20, 80, 21, HTML.White + General.Local(21), false, false, false);
|
||||
AddButton(20, y + 2, 0x2716, 0x2716, "Busy", new TimerStateCallback(Status), OnlineStatus.Busy);
|
||||
AddHtml(40, y += 20, 80, 21, HTML.White + General.Local(22), false, false, false);
|
||||
AddButton(20, y + 2, 0x2716, 0x2716, "Hidden", new TimerStateCallback(Status), OnlineStatus.Hidden);
|
||||
}
|
||||
|
||||
private void Status(object o)
|
||||
{
|
||||
if (!(o is OnlineStatus))
|
||||
return;
|
||||
|
||||
Data.GetData(Owner).Status = (OnlineStatus)o;
|
||||
|
||||
if ((OnlineStatus)o == OnlineStatus.Away || (OnlineStatus)o == OnlineStatus.Busy)
|
||||
new AwayGump(Owner, c_Gump);
|
||||
else
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class AwayGump : GumpPlus
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
|
||||
public AwayGump(Mobile m, GumpPlus g) : base(m, 100, 100)
|
||||
{
|
||||
m.CloseGump(typeof(AwayGump));
|
||||
|
||||
c_Gump = g;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
AddBackground(0, 0, 200, 200, 0x1400);
|
||||
|
||||
AddHtml(0, 10, 200, 21, HTML.White + "<CENTER>" + General.Local(12), false, false);
|
||||
AddImageTiled(10, 30, 180, 120, 0xBBC);
|
||||
AddTextField(10, 30, 180, 120, 0x480, 0, Data.GetData(Owner).AwayMsg);
|
||||
AddButton(60, 160, 0xFB1, 0xFB3, "Clear", new TimerCallback(ClearMsg));
|
||||
AddButton(120, 160, 0xFB7, 0xFB9, "Submit", new TimerCallback(Submit));
|
||||
}
|
||||
|
||||
private void ClearMsg()
|
||||
{
|
||||
Data.GetData(Owner).AwayMsg = "";
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Submit()
|
||||
{
|
||||
Data.GetData(Owner).AwayMsg = GetTextField(0);
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class InternalPicker : HuePicker
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
|
||||
public InternalPicker(GumpPlus g) : base(0x1018)
|
||||
{
|
||||
c_Gump = g;
|
||||
}
|
||||
|
||||
public override void OnResponse(int hue)
|
||||
{
|
||||
Data.GetData(c_Gump.Owner).GlobalMC = hue;
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
507
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/MailGump.cs
Normal file
507
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/MailGump.cs
Normal file
@@ -0,0 +1,507 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.HuePickers;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class MailGump : GumpPlus
|
||||
{
|
||||
public static void SendTo(Mobile m)
|
||||
{
|
||||
SendTo(m, m);
|
||||
}
|
||||
|
||||
public static void SendTo(Mobile from, Mobile to)
|
||||
{
|
||||
General.ClearGump(from, typeof(MailGump));
|
||||
|
||||
new MailGump(from, to);
|
||||
}
|
||||
|
||||
#region Class Definitions
|
||||
|
||||
private Mobile c_Target;
|
||||
private int c_Width, c_Height, c_Page;
|
||||
private bool c_Options, c_Search, c_Minimized;
|
||||
private string c_CharSearch, c_TxtSearch;
|
||||
|
||||
public Data GetData { get { return Data.GetData(Owner); } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public MailGump(Mobile from, Mobile to) : base(from, 400, 50)
|
||||
{
|
||||
c_Target = to;
|
||||
|
||||
c_TxtSearch = "";
|
||||
c_CharSearch = "";
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
Owner.CloseGump(typeof(MailGump));
|
||||
|
||||
c_Width = 300;
|
||||
c_Height = 60 + (40 * GetData.MailPP);
|
||||
|
||||
if (c_Minimized)
|
||||
{
|
||||
if (GetData.NewMsg())
|
||||
AddImage(0, 0, 0xFC4);
|
||||
else
|
||||
AddImage(0, 0, 0xFC5);
|
||||
}
|
||||
else
|
||||
AddBackground(0, 0, c_Width, c_Height, 0x1400);
|
||||
|
||||
AddButton(0, 0, 0x13A8, 0x13A8, "Minimize", new TimerCallback(Minimize));
|
||||
|
||||
if (c_Minimized)
|
||||
AddLabel(1, -3, 0x47E, "^");
|
||||
else
|
||||
AddLabel(2, -9, 0x47E, "_");
|
||||
|
||||
if (c_Minimized)
|
||||
DisplayMin();
|
||||
else
|
||||
DisplayList();
|
||||
}
|
||||
|
||||
private void DisplayMin()
|
||||
{
|
||||
}
|
||||
|
||||
private ArrayList BuildList()
|
||||
{
|
||||
ArrayList list = Data.GetData(c_Target).Messages;
|
||||
|
||||
if (c_CharSearch != "")
|
||||
foreach (Message m in new ArrayList(list))
|
||||
if (m.From.Name.ToLower().IndexOf(c_CharSearch.ToLower()) != 0)
|
||||
list.Remove(m);
|
||||
|
||||
if (c_TxtSearch != "")
|
||||
foreach (Message m in new ArrayList(list))
|
||||
if (m.From.Name.ToLower().IndexOf(c_CharSearch.ToLower()) == -1)
|
||||
list.Remove(m);
|
||||
|
||||
list.Sort(new InternalSort());
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private void DisplayList()
|
||||
{
|
||||
if (c_Options)
|
||||
OptionsTab();
|
||||
if (c_Search)
|
||||
SearchTab();
|
||||
|
||||
int y = 10;
|
||||
|
||||
AddImage(78, y - 1, 0x9C5);
|
||||
AddHtml(0, y, c_Width, 21, HTML.White + "<CENTER>" + General.Local(56) + (c_Target == Owner ? "" : "(" + c_Target.Name + ")"), false, false, false);
|
||||
|
||||
AddButton(10, 32, 0x983, 0x983, "PerPage Down", new TimerCallback(PerPageDown));
|
||||
AddButton(20, 32, 0x985, 0x985, "PerPage Up", new TimerCallback(PerPageUp));
|
||||
|
||||
ArrayList list = BuildList();
|
||||
|
||||
AddHtml(c_Width - 50, y, 60, 21, HTML.White + list.Count + "/" + Data.MaxMsgs, false, false);
|
||||
|
||||
int perpage = GetData.MailPP;
|
||||
|
||||
if (perpage * c_Page > list.Count || c_Page < 0)
|
||||
c_Page = 0;
|
||||
|
||||
if (perpage * (c_Page + 1) < list.Count)
|
||||
AddButton(c_Width / 2 - 10, c_Height - 25, 0x25E8, 0x25E9, "Page Up", new TimerCallback(PageUp));
|
||||
if (c_Page != 0)
|
||||
AddButton(c_Width / 2 - 10, 30, 0x25E4, 0x25E5, "Page Down", new TimerCallback(PageDown));
|
||||
|
||||
AddButton(6, c_Height - 30, 0x768, 0x768, "Options", new TimerCallback(Options));
|
||||
AddButton(22, c_Height - 30, 0x768, 0x768, "Search", new TimerCallback(Search));
|
||||
AddLabel(11, c_Height - 30, c_Options ? 0x34 : 0x47E, "O");
|
||||
AddLabel(27, c_Height - 30, c_Search ? 0x34 : 0x47E, "S");
|
||||
|
||||
if (Owner.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
AddHtml(c_Width - 73, c_Height - 29, 80, 21, HTML.White + General.Local(95), false, false);
|
||||
AddButton(c_Width - 90, c_Height - 26, 0x2716, 0x2716, "Broadcast", new TimerCallback(Broadcast));
|
||||
}
|
||||
|
||||
y += 20;
|
||||
|
||||
Message msg;
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = perpage * c_Page; i < list.Count && i < perpage * (c_Page + 1); ++i)
|
||||
{
|
||||
msg = (Message)list[i];
|
||||
|
||||
AddHtml(45, y += 20, 180, 21, ColorFor(msg) + (msg.Read ? "" : "<B>") + msg.Subject, false, false, false);
|
||||
AddHtml(45, y += 16, 150, 21, HTML.White + General.Local(60) + " " + msg.From.Name, false, false);
|
||||
|
||||
AddButton(20, y - 10, 0x2716, 0x2716, "Open", new TimerStateCallback(Open), (Message)list[i]);
|
||||
AddButton(c_Width - 40, y - 10, 0x5686, 0x5687, "Delete", new TimerStateCallback(Delete), (Message)list[i]);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
AddHtml(45, y += 20, 90, 21, HTML.White + "!!!", false, false);
|
||||
}
|
||||
}
|
||||
|
||||
private string ColorFor(Message msg)
|
||||
{
|
||||
switch (msg.Type)
|
||||
{
|
||||
case MsgType.Normal: return HTML.White;
|
||||
case MsgType.Invite: return HTML.Yellow;
|
||||
case MsgType.System: return HTML.Red;
|
||||
default: return HTML.White;
|
||||
}
|
||||
}
|
||||
|
||||
private void SearchTab()
|
||||
{
|
||||
AddBackground(c_Width + 20, 10, 130, 40, 0x1400);
|
||||
|
||||
AddImageTiled(c_Width + 30, 20, 90, 21, 0xBBC);
|
||||
AddTextField(c_Width + 30, 20, 90, 21, 0x480, 1, c_TxtSearch);
|
||||
AddButton(c_Width + 127, 24, 0x2716, 0x2716, "Text Search", new TimerCallback(TxtSearch));
|
||||
|
||||
char[] chars = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
|
||||
|
||||
int x = c_Width + 17;
|
||||
int y = 51;
|
||||
|
||||
foreach (char c in chars)
|
||||
{
|
||||
AddButton(x += 20, y, 0x2344, 0x2344, "Char Search", new TimerStateCallback(CharSearch), c.ToString());
|
||||
AddHtml(x + 6, y, 20, 20, (c_CharSearch == c.ToString() ? HTML.Green : HTML.White) + c, false, false, false);
|
||||
|
||||
if (x >= c_Width + 115)
|
||||
{
|
||||
x = c_Width + 17;
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OptionsTab()
|
||||
{
|
||||
int x = c_Width + 20;
|
||||
|
||||
AddHtml(x, 10, 300, 21, HTML.White + "<CENTER>" + General.Local(57), false, false);
|
||||
|
||||
int y = 10;
|
||||
|
||||
if (GetData.GlobalAccess && GetData.Global)
|
||||
{
|
||||
AddHtml(x + 120, y += 25, 120, 21, HTML.Red + General.Local(26), false, false, false);
|
||||
AddButton(x + 70, y, GetData.GlobalM ? 0x2343 : 0x2342, GetData.GlobalM ? 0x2343 : 0x2342, "Global Messages", new TimerCallback(GlobalMsg));
|
||||
AddImage(x + 90, y, 0x2342, GetData.GlobalMC);
|
||||
AddButton(x + 94, y + 4, 0x2716, 0x2716, "GlobalMsgColor", new TimerCallback(GlobalMsgColor));
|
||||
}
|
||||
|
||||
AddHtml(x + 60, y += 25, 220, 21, HTML.White + General.Local(58), false, false);
|
||||
AddButton(x + 30, y, GetData.SevenDays ? 0x2343 : 0x2342, GetData.SevenDays ? 0x2343 : 0x2342, "Seven Days", new TimerCallback(SevenDays));
|
||||
AddHtml(x + 60, y += 20, 220, 21, HTML.White + General.Local(24), false, false);
|
||||
AddButton(x + 30, y, GetData.FriendsOnly ? 0x2343 : 0x2342, GetData.FriendsOnly ? 0x2343 : 0x2342, "Friends Only", new TimerCallback(FriendsOnly));
|
||||
AddHtml(x + 60, y += 20, 220, 21, HTML.White + General.Local(25), false, false);
|
||||
AddButton(x + 30, y, GetData.ByRequest ? 0x2343 : 0x2342, GetData.ByRequest ? 0x2343 : 0x2342, "Friend Request", new TimerCallback(FriendRequest));
|
||||
AddHtml(x + 60, y += 20, 220, 21, HTML.White + General.Local(196), false, false);
|
||||
AddButton(x + 30, y, GetData.ReadReceipt ? 0x2343 : 0x2342, GetData.ReadReceipt ? 0x2343 : 0x2342, "Read Receipt", new TimerCallback(ReadReceipt));
|
||||
|
||||
AddHtml(x + 30, y += 25, 170, 21, HTML.White + General.Local(59), false, false);
|
||||
AddImageTiled(x + 175, y, 70, 21, 0xBBA);
|
||||
AddTextField(x + 175, y, 70, 21, 0x480, 2, GetData.MailSpeech);
|
||||
AddButton(x + 255, y + 3, 0x2716, 0x2716, "Submit Speech", new TimerCallback(SubmitSpeech));
|
||||
|
||||
AddHtml(x + 60, y += 23, 220, 21, HTML.White + General.Local(27), false, false);
|
||||
AddButton(x + 30, y, GetData.MsgSound ? 0x2343 : 0x2342, GetData.MsgSound ? 0x2343 : 0x2342, "Message Sound", new TimerCallback(MessageSound));
|
||||
|
||||
if (GetData.MsgSound)
|
||||
{
|
||||
AddHtml(x, y += 25, 300, 21, HTML.White + "<CENTER>" + General.Local(28), false, false);
|
||||
AddImageTiled(x + 125, y += 25, 50, 21, 0xBBA);
|
||||
AddTextField(x + 125, y, 50, 21, 0x480, 1, GetData.DefaultSound.ToString());
|
||||
AddButton(x + 185, y + 3, 0x15E1, 0x15E5, "Play Sound", new TimerCallback(PlaySound));
|
||||
AddButton(x + 110, y, 0x983, 0x983, "Sound Up", new TimerCallback(SoundUp));
|
||||
AddButton(x + 110, y + 10, 0x985, 0x985, "Sound Down", new TimerCallback(SoundDown));
|
||||
}
|
||||
|
||||
Entries.Insert(0, new GumpBackground(x, 0, 300, y + 40, 0x1400));
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
if (c_Options || c_Search)
|
||||
{
|
||||
c_Options = false;
|
||||
c_Search = false;
|
||||
NewGump();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Responses
|
||||
|
||||
private void Minimize()
|
||||
{
|
||||
c_Minimized = !c_Minimized;
|
||||
|
||||
if (c_Minimized)
|
||||
Override = false;
|
||||
else
|
||||
Override = true;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PageUp()
|
||||
{
|
||||
c_Page++;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PageDown()
|
||||
{
|
||||
c_Page--;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PerPageUp()
|
||||
{
|
||||
GetData.MailPP++;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PerPageDown()
|
||||
{
|
||||
GetData.MailPP--;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Open(object o)
|
||||
{
|
||||
if (!(o is Message))
|
||||
return;
|
||||
|
||||
MessageGump.SendTo(Owner, (Message)o);
|
||||
|
||||
General.RefreshGump(Owner, typeof(FriendsGump));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Delete(object o)
|
||||
{
|
||||
if (!(o is Message))
|
||||
return;
|
||||
|
||||
GetData.DeleteMessage((Message)o);
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Search()
|
||||
{
|
||||
c_Search = !c_Search;
|
||||
|
||||
c_Options = false;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Options()
|
||||
{
|
||||
c_Options = !c_Options;
|
||||
|
||||
c_Search = false;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void TxtSearch()
|
||||
{
|
||||
c_TxtSearch = GetTextField(1);
|
||||
c_CharSearch = "";
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void CharSearch(object o)
|
||||
{
|
||||
if (!(o is string))
|
||||
return;
|
||||
|
||||
if (c_CharSearch == o.ToString())
|
||||
c_CharSearch = "";
|
||||
else
|
||||
c_CharSearch = o.ToString();
|
||||
|
||||
c_TxtSearch = "";
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SevenDays()
|
||||
{
|
||||
GetData.SevenDays = !GetData.SevenDays;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void FriendsOnly()
|
||||
{
|
||||
GetData.FriendsOnly = !GetData.FriendsOnly;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void FriendRequest()
|
||||
{
|
||||
GetData.ByRequest = !GetData.ByRequest;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void ReadReceipt()
|
||||
{
|
||||
GetData.ReadReceipt = !GetData.ReadReceipt;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void GlobalMsg()
|
||||
{
|
||||
GetData.GlobalM = !GetData.GlobalM;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void GlobalMsgColor()
|
||||
{
|
||||
Owner.SendHuePicker(new InternalPicker(this));
|
||||
}
|
||||
|
||||
private void MessageSound()
|
||||
{
|
||||
GetData.MsgSound = !GetData.MsgSound;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void PlaySound()
|
||||
{
|
||||
GetData.DefaultSound = Utility.ToInt32(GetTextField(1));
|
||||
Owner.SendSound(GetData.DefaultSound);
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SoundUp()
|
||||
{
|
||||
GetData.DefaultSound = GetData.DefaultSound + 1;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SoundDown()
|
||||
{
|
||||
GetData.DefaultSound = GetData.DefaultSound - 1;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SubmitSpeech()
|
||||
{
|
||||
GetData.MailSpeech = GetTextField(2);
|
||||
|
||||
if (GetData.MailSpeech != "")
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(70) + " \"" + GetData.MailSpeech + "\"");
|
||||
else
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(71));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Broadcast()
|
||||
{
|
||||
NewGump();
|
||||
|
||||
SendMessageGump.SendTo(Owner, null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Classes
|
||||
|
||||
private class InternalSort : IComparer
|
||||
{
|
||||
public InternalSort()
|
||||
{
|
||||
}
|
||||
|
||||
public int Compare(object x, object y)
|
||||
{
|
||||
if (x == null && y == null)
|
||||
return 0;
|
||||
if (x == null || !(x is Message))
|
||||
return -1;
|
||||
if (y == null || !(y is Message))
|
||||
return 1;
|
||||
|
||||
Message a = (Message)x;
|
||||
Message b = (Message)y;
|
||||
|
||||
if (a.Received > b.Received)
|
||||
return -1;
|
||||
if (a.Received < b.Received)
|
||||
return 1;
|
||||
|
||||
return Insensitive.Compare(a.From.Name, b.From.Name);
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalPicker : HuePicker
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
|
||||
public InternalPicker(GumpPlus g) : base(0x1018)
|
||||
{
|
||||
c_Gump = g;
|
||||
}
|
||||
|
||||
public override void OnResponse(int hue)
|
||||
{
|
||||
Data.GetData(c_Gump.Owner).GlobalMC = hue;
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
136
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/MessageGump.cs
Normal file
136
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/MessageGump.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class MessageGump : GumpPlus
|
||||
{
|
||||
public static void SendTo(Mobile m, Message msg)
|
||||
{
|
||||
new MessageGump(m, msg);
|
||||
}
|
||||
|
||||
#region Class Definitions
|
||||
|
||||
private Message c_Message;
|
||||
|
||||
public Data GetData { get { return Data.GetData(Owner); } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public MessageGump(Mobile m, Message msg) : base(m, 200, 400)
|
||||
{
|
||||
c_Message = msg;
|
||||
|
||||
if (GetData.Messages.Contains(msg))
|
||||
{
|
||||
if (!msg.Read && Data.GetData(msg.From).ReadReceipt && msg.From.AccessLevel >= m.AccessLevel)
|
||||
msg.From.SendMessage(Data.GetData(msg.From).SystemC, m.Name + " " + General.Local(197) + " " + msg.Subject);
|
||||
|
||||
msg.Read = true;
|
||||
}
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
AddBackground(0, 0, 300, 200, 0x1400);
|
||||
|
||||
int y = 10;
|
||||
|
||||
AddHtml(10, y, 280, 21, HTML.White + c_Message.Subject, false, false);
|
||||
AddHtml(15, y += 18, 150, 21, HTML.White + General.Local(60) + " " + c_Message.From.Name, false, false);
|
||||
|
||||
AddHtml(10, y += 20, 280, 200 - y - 40, HTML.White + c_Message.Msg, true, true);
|
||||
|
||||
if (GetData.Messages.Contains(c_Message))
|
||||
{
|
||||
if (c_Message.Type == MsgType.Normal)
|
||||
{
|
||||
if (Message.CanMessage(Owner, c_Message.From))
|
||||
AddButton(200, 170, 0xFA5, 0xFA6, "Reply", new TimerCallback(Reply));
|
||||
|
||||
AddButton(140, 170, 0xFB1, 0xFB2, "Delete", new TimerCallback(Delete));
|
||||
AddButton(80, 170, 0xFA2, 0xFA3, "Ignore", new TimerCallback(Ignore));
|
||||
}
|
||||
else if (c_Message.Type == MsgType.Invite)
|
||||
{
|
||||
AddButton(200, 170, 0xFA8, 0xFA9, "Accept", new TimerCallback(Accept));
|
||||
AddButton(140, 170, 0xFB1, 0xFB2, "Deny", new TimerCallback(Deny));
|
||||
AddButton(80, 170, 0xFA2, 0xFA3, "Ignore", new TimerCallback(Ignore));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Responses
|
||||
|
||||
private void Reply()
|
||||
{
|
||||
if (Message.CanMessage(Owner, c_Message.From))
|
||||
SendMessageGump.SendTo(Owner, c_Message.From, c_Message);
|
||||
}
|
||||
|
||||
private void Delete()
|
||||
{
|
||||
GetData.DeleteMessage(c_Message);
|
||||
|
||||
General.RefreshGump(Owner, typeof(MailGump));
|
||||
General.RefreshGump(Owner, typeof(FriendsGump));
|
||||
}
|
||||
|
||||
private void Ignore()
|
||||
{
|
||||
GetData.Ignores.Add(c_Message.From);
|
||||
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(68) + " " + c_Message.From.Name);
|
||||
|
||||
Deny();
|
||||
}
|
||||
|
||||
private void Accept()
|
||||
{
|
||||
c_Message.From.SendMessage(Data.GetData(c_Message.From).SystemC, Owner.Name + " " + General.Local(87));
|
||||
|
||||
GetData.AddFriend(c_Message.From);
|
||||
Data.GetData(c_Message.From).AddFriend(Owner);
|
||||
|
||||
GetData.Messages.Remove(c_Message);
|
||||
|
||||
if (Owner.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(Owner, typeof(FriendsGump));
|
||||
else
|
||||
FriendsGump.SendTo(Owner, true);
|
||||
|
||||
General.RefreshGump(Owner, typeof(MailGump));
|
||||
}
|
||||
|
||||
private void Deny()
|
||||
{
|
||||
c_Message.From.SendMessage(Data.GetData(c_Message.From).SystemC, Owner.Name + " " + General.Local(88));
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(89) + " " + c_Message.From.Name);
|
||||
|
||||
GetData.Messages.Remove(c_Message);
|
||||
|
||||
if (Owner.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(Owner, typeof(FriendsGump));
|
||||
else
|
||||
FriendsGump.SendTo(Owner, true);
|
||||
|
||||
General.RefreshGump(Owner, typeof(MailGump));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class SendMessageGump : GumpPlus
|
||||
{
|
||||
public static void SendTo(Mobile from, Mobile to)
|
||||
{
|
||||
SendTo(from, to, "", null);
|
||||
}
|
||||
|
||||
public static void SendTo(Mobile from, Mobile to, string txt)
|
||||
{
|
||||
SendTo(from, to, txt, null);
|
||||
}
|
||||
|
||||
public static void SendTo(Mobile from, Mobile to, Message reply)
|
||||
{
|
||||
SendTo(from, to, "", reply);
|
||||
}
|
||||
|
||||
public static void SendTo(Mobile from, Mobile to, string txt, Message reply)
|
||||
{
|
||||
General.ClearGump(from, typeof(SendMessageGump));
|
||||
|
||||
new SendMessageGump(from, to, txt, reply);
|
||||
}
|
||||
|
||||
#region Class Definitions
|
||||
|
||||
private Mobile c_From, c_To;
|
||||
private Message c_Reply;
|
||||
private string c_Text, c_Subject;
|
||||
|
||||
public Data GetData { get { return Data.GetData(Owner); } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public SendMessageGump(Mobile from, Mobile to, string txt, Message reply) : base(from, 200, 200)
|
||||
{
|
||||
c_From = from;
|
||||
c_To = to;
|
||||
c_Text = txt;
|
||||
c_Subject = "";
|
||||
c_Reply = reply;
|
||||
|
||||
if (c_Reply != null)
|
||||
{
|
||||
if (c_Reply.Subject.IndexOf("RE:") != 0)
|
||||
c_Subject = "RE: " + c_Reply.Subject;
|
||||
else
|
||||
c_Subject = c_Reply.Subject;
|
||||
}
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
Owner.CloseGump(typeof(SendMessageGump));
|
||||
|
||||
AddBackground(0, 0, 400, 400, 0x1400);
|
||||
|
||||
if (c_To == null)
|
||||
AddHtml(0, 8, 400, 21, HTML.White + "<CENTER>" + General.Local(94), false, false);
|
||||
else
|
||||
AddHtml(0, 8, 400, 21, HTML.White + "<CENTER>" + General.Local(62) + " " + c_To.Name, false, false);
|
||||
|
||||
AddImageTiled(20, 30, 350, 21, 0xBBC);
|
||||
AddTextField(20, 30, 350, 21, 0x480, 0, c_Subject);
|
||||
|
||||
if (GetData.Recording == this)
|
||||
{
|
||||
AddHtml(20, 30, 350, 25, HTML.White + c_Subject, true, false);
|
||||
AddHtml(10, 57, 380, 310, HTML.White + c_Text, true, true);
|
||||
AddHtml(0, 370, 400, 21, HTML.White + "<CENTER>" + General.Local(63), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddImageTiled(20, 30, 350, 21, 0xBBC);
|
||||
AddTextField(20, 30, 350, 21, 0x480, 0, c_Subject);
|
||||
|
||||
AddImageTiled(10, 57, 380, 310, 0xBBC);
|
||||
AddTextField(10, 57, 380, 310, 0x480, 1, c_Text);
|
||||
AddButton(10, 370, 0x2333, 0x2333, "Record", new TimerCallback(Record));
|
||||
}
|
||||
|
||||
AddButton(360, 370, 0xFBD, 0xFBE, "Send", new TimerCallback(Send));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Responses
|
||||
|
||||
public void AddText(string txt)
|
||||
{
|
||||
c_Text += txt;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
c_Subject = GetTextField(0);
|
||||
c_Text = GetTextField(1);
|
||||
}
|
||||
|
||||
private void Record()
|
||||
{
|
||||
Save();
|
||||
|
||||
if (c_Subject.Trim() == "")
|
||||
{
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(194));
|
||||
NewGump();
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetData.Recording != null)
|
||||
GetData.Recording = null;
|
||||
|
||||
Save();
|
||||
GetData.Recording = this;
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(65));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Send()
|
||||
{
|
||||
if( GetData.Recording == null )
|
||||
Save();
|
||||
|
||||
if (c_Subject.Trim() == "" || c_Text.Trim() == "")
|
||||
{
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(66));
|
||||
NewGump();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TrackSpam.LogSpam(Owner, "Message", TimeSpan.FromSeconds(Data.MsgSpam)))
|
||||
{
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(97));
|
||||
NewGump();
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetData.Recording == this)
|
||||
GetData.Recording = null;
|
||||
|
||||
if (Data.FilterMsg)
|
||||
{
|
||||
c_Text = Filter.FilterText(Owner, c_Text, false);
|
||||
c_Subject = Filter.FilterText(Owner, c_Subject, false);
|
||||
}
|
||||
|
||||
if (c_To == null)
|
||||
{
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
{
|
||||
data.AddMessage(new Message(Owner, c_Subject, c_Text, MsgType.System));
|
||||
|
||||
if (data.Mobile.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(data.Mobile, typeof(FriendsGump));
|
||||
else
|
||||
FriendsGump.SendTo(data.Mobile, true);
|
||||
|
||||
General.RefreshGump(data.Mobile, typeof(MailGump));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.GetData(c_To).AddMessage(new Message(Owner, c_Subject, c_Text, MsgType.Normal));
|
||||
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(67) + " " + c_To.Name);
|
||||
if (Data.GetData(c_To).Status != OnlineStatus.Online)
|
||||
Owner.SendMessage(GetData.SystemC, c_To.Name + ": " + Data.GetData(c_To).AwayMsg);
|
||||
|
||||
if (c_To.HasGump(typeof(FriendsGump)))
|
||||
General.RefreshGump(c_To, typeof(FriendsGump));
|
||||
else
|
||||
FriendsGump.SendTo(c_To, true);
|
||||
|
||||
General.RefreshGump(c_To, typeof(MailGump));
|
||||
}
|
||||
|
||||
foreach( Data data in Data.Datas.Values)
|
||||
if (data.Mobile.AccessLevel >= c_From.AccessLevel && ((data.GlobalM && !data.GIgnores.Contains(c_From)) || data.GListens.Contains(c_From)))
|
||||
data.Mobile.SendMessage(data.GlobalMC, String.Format("(Global) <Mail> {0} to {1}: {2}", Owner.Name, (c_To == null ? "All" : c_To.Name), c_Text ));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
645
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/SetupGump.cs
Normal file
645
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Gumps/SetupGump.cs
Normal file
@@ -0,0 +1,645 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public enum SetupPage { Publics, Misc, FilterSpam, IRC }
|
||||
|
||||
public class SetupGump : GumpPlus
|
||||
{
|
||||
public static void SendTo(Mobile m)
|
||||
{
|
||||
General.ClearGump(m, typeof(SetupGump));
|
||||
|
||||
new SetupGump(m);
|
||||
}
|
||||
|
||||
#region Class Definitions
|
||||
|
||||
private SetupPage c_Page;
|
||||
private int c_Width, c_Height;
|
||||
private Channel c_Channel;
|
||||
|
||||
public Data GetData { get { return Data.GetData(Owner); } }
|
||||
protected Channel Channel { get { return c_Channel; } set { c_Channel = value; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public SetupGump(Mobile m) : base(m, 200, 200)
|
||||
{
|
||||
c_Width = c_Height = 300;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
Owner.CloseGump(typeof(SetupGump));
|
||||
|
||||
AddBackground(0, 0, c_Width, c_Height, 0x1400);
|
||||
|
||||
AddButton(c_Width / 5 - 5, c_Height - 40, c_Page == SetupPage.Publics ? 0x767 : 0x768, c_Page == SetupPage.Publics ? 0x767 : 0x768, "Messages", new TimerStateCallback(Page), SetupPage.Publics);
|
||||
AddButton(c_Width / 5 * 2 - 5, c_Height - 40, c_Page == SetupPage.Misc ? 0x767 : 0x768, c_Page == SetupPage.Misc ? 0x767 : 0x768, "Messages", new TimerStateCallback(Page), SetupPage.Misc);
|
||||
AddButton(c_Width / 5 * 3 - 5, c_Height - 40, c_Page == SetupPage.FilterSpam ? 0x767 : 0x768, c_Page == SetupPage.FilterSpam ? 0x767 : 0x768, "Filter and Spam", new TimerStateCallback(Page), SetupPage.FilterSpam);
|
||||
AddButton(c_Width/5*4-5, c_Height - 40, c_Page == SetupPage.IRC ? 0x767 : 0x768, c_Page == SetupPage.IRC ? 0x767 : 0x768, "IRC", new TimerStateCallback(Page), SetupPage.IRC);
|
||||
|
||||
AddImage(13, 6, 0x476);
|
||||
|
||||
switch (c_Page)
|
||||
{
|
||||
case SetupPage.Publics: PublicsTab(); break;
|
||||
case SetupPage.Misc: MiscTab(); break;
|
||||
case SetupPage.FilterSpam: FilterSpamTab(); break;
|
||||
case SetupPage.IRC: IRCTab(); break;
|
||||
}
|
||||
|
||||
AddButton(c_Width - 20, c_Height - 20, 0xFC1, 0xFC1, "About", new TimerCallback(About));
|
||||
}
|
||||
|
||||
private void PublicsTab()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, c_Width, 21, HTML.White + "<CENTER>" + General.Local(177), false, false);
|
||||
|
||||
AddImage(77, (y += 25) - 1, 0x9C5);
|
||||
AddHtml(100, y, 100, 21, "<CENTER>" + HTML.White + (c_Channel == null ? "" : c_Channel.Name), false, false);
|
||||
AddButton(85, y+3, 0x2716, 0x2716, "Channel Select", new TimerCallback(ChannelSelect));
|
||||
|
||||
if( c_Channel != null )
|
||||
AddButton(200, y+1, 0x5686, 0x5687, "Delete Channel", new TimerCallback(DeleteChannel));
|
||||
|
||||
if (c_Channel == null)
|
||||
{
|
||||
AddHtml(0, y+=25, c_Width, 21, HTML.White + "<CENTER>" + General.Local(179), false, false);
|
||||
return;
|
||||
}
|
||||
|
||||
AddHtml(77, y+=25, 100, 21, HTML.White + General.Local(180), false, false);
|
||||
AddImageTiled(162, y, 70, 21, 0xBBA);
|
||||
AddTextField(162, y, 70, 21, 0x480, 10, "" + c_Channel.Name);
|
||||
AddButton(142, y + 3, 0x2716, 0x2716, "Submit Channel", new TimerCallback(SubmitChannel));
|
||||
|
||||
AddHtml(40, y += 25, 80, 21, HTML.White + General.Local(181) + ":", false, false);
|
||||
AddHtml(120, y, 80, 21, HTML.White + General.Local(182), false, false);
|
||||
AddHtml(200, y, 80, 21, HTML.White + General.Local(183), false, false);
|
||||
AddButton(100, y + 3, c_Channel.Style == ChatStyle.Global ? 0x939 : 0x2716, c_Channel.Style == ChatStyle.Global ? 0x939 : 0x2716, "Global", new TimerCallback(Global));
|
||||
AddButton(180, y + 3, c_Channel.Style == ChatStyle.Regional ? 0x939 : 0x2716, c_Channel.Style == ChatStyle.Regional ? 0x939 : 0x2716, "Regional", new TimerCallback(Regional));
|
||||
|
||||
AddHtml(110, y += 25, 120, 21, HTML.White + General.Local(184), false, false);
|
||||
AddButton(80, y, c_Channel.ToIrc ? 0x2343 : 0x2342, c_Channel.ToIrc ? 0x2343 : 0x2342, "Send to IRC", new TimerCallback(SendToIrc));
|
||||
|
||||
AddHtml(110, y += 25, 120, 21, HTML.White + General.Local(188), false, false);
|
||||
AddButton(80, y, c_Channel.NewChars ? 0x2343 : 0x2342, c_Channel.NewChars ? 0x2343 : 0x2342, "Auto join new characters", new TimerCallback(AutoNewChars));
|
||||
|
||||
AddHtml(27, y += 25, 150, 21, HTML.White + General.Local(185), false, false);
|
||||
AddImageTiled(182, y, 70, 21, 0xBBA);
|
||||
AddTextField(182, y, 70, 21, 0x480, 11, "");
|
||||
AddButton(162, y + 4, 0x2716, 0x2716, "Add/Remove Command", new TimerCallback(AddCommand));
|
||||
|
||||
string txt = General.Local(42) + ": ";
|
||||
|
||||
foreach (string str in c_Channel.Commands)
|
||||
txt += str + " ";
|
||||
|
||||
AddHtml(20, y += 25, 260, 60, HTML.White + txt, false, false);
|
||||
}
|
||||
|
||||
private void MiscTab()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, c_Width, 21, HTML.White + "<CENTER>" + General.Local(101), false, false);
|
||||
|
||||
AddHtml(70, y += 25, 250, 21, HTML.White + General.Local(152), false, false);
|
||||
AddButton(40, y, Data.ShowStaff ? 0x2343 : 0x2342, Data.ShowStaff ? 0x2343 : 0x2342, "Show Staff", new TimerCallback(ShowStaff));
|
||||
|
||||
AddHtml(37, y += 25, 150, 21, HTML.White + General.Local(153), false, false);
|
||||
AddImageTiled(172, y, 70, 21, 0xBBA);
|
||||
AddTextField(172, y, 70, 21, 0x480, 9, "" + Data.MaxMsgs);
|
||||
AddButton(152, y + 4, 0x2716, 0x2716, "MaxMsgs", new TimerCallback(MaxMsgs));
|
||||
|
||||
AddHtml(70, y += 25, 250, 21, HTML.White + General.Local(169), false, false);
|
||||
AddButton(45, y+3, 0x2716, 0x2716, "Reload Local", new TimerCallback(ReloadLocal));
|
||||
}
|
||||
|
||||
private void FilterSpamTab()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, c_Width, 21, HTML.White + "<CENTER>" + General.Local(99), false, false);
|
||||
|
||||
AddHtml(70, y += 25, 250, 21, HTML.White + General.Local(142), false, false);
|
||||
AddButton(40, y, Data.FilterSpeech ? 0x2343 : 0x2342, Data.FilterSpeech ? 0x2343 : 0x2342, "Filter Speech", new TimerCallback(FilterSpeech));
|
||||
AddHtml(70, y += 25, 250, 21, HTML.White + General.Local(143), false, false);
|
||||
AddButton(40, y, Data.FilterMsg ? 0x2343 : 0x2342, Data.FilterMsg ? 0x2343 : 0x2342, "Filter Messages", new TimerCallback(FilterMsg));
|
||||
|
||||
AddHtml(17, y += 25, 100, 21, HTML.White + General.Local(144), false, false);
|
||||
AddHtml(142, y, 100, 21, HTML.White + "s", false, false);
|
||||
AddImageTiled(107, y, 30, 21, 0xBBA);
|
||||
AddTextField(107, y, 30, 21, 0x480, 4, "" + Data.ChatSpam);
|
||||
|
||||
AddHtml(162, y, 100, 21, HTML.White + General.Local(145), false, false);
|
||||
AddHtml(277, y, 100, 21, HTML.White + "s", false, false);
|
||||
AddImageTiled(242, y, 30, 21, 0xBBA);
|
||||
AddTextField(242, y, 30, 21, 0x480, 5, "" + Data.MsgSpam);
|
||||
|
||||
AddHtml(17, y += 25, 100, 21, HTML.White + General.Local(146), false, false);
|
||||
AddHtml(142, y, 100, 21, HTML.White + "h", false, false);
|
||||
AddImageTiled(107, y, 30, 21, 0xBBA);
|
||||
AddTextField(107, y, 30, 21, 0x480, 6, "" + Data.RequestSpam);
|
||||
|
||||
AddHtml(162, y, 100, 21, HTML.White + General.Local(147), false, false);
|
||||
AddHtml(277, y, 100, 21, HTML.White + "m", false, false);
|
||||
AddImageTiled(242, y, 30, 21, 0xBBA);
|
||||
AddTextField(242, y, 30, 21, 0x480, 7, "" + Data.FilterBanLength);
|
||||
|
||||
AddButton(148, y - 9, 0x2716, 0x2716, "SubmitFilterSpam", new TimerCallback(SubmitFilterSpam));
|
||||
|
||||
AddHtml(90, y += 25, 150, 21, HTML.White + General.Local(154) + ": " + General.Local(155 + (int)Data.FilterPenalty), false, false);
|
||||
AddButton(70, y + 4, 0x2716, 0x2716, "Filter Penalty", new TimerCallback(FilterPenalty));
|
||||
|
||||
AddHtml(37, y+=25, 150, 21, HTML.White + General.Local(148), false, false);
|
||||
AddImageTiled(172, y, 70, 21, 0xBBA);
|
||||
AddTextField(172, y, 70, 21, 0x480, 8, "");
|
||||
AddButton(152, y + 4, 0x2716, 0x2716, "Add/Remove Filter", new TimerCallback(AddFilter));
|
||||
|
||||
string txt = General.Local(151) + " ";
|
||||
|
||||
foreach (string filter in Data.Filters)
|
||||
txt += filter + " ";
|
||||
|
||||
AddHtml(20, y += 25, 260, 60, HTML.White + txt, false, false);
|
||||
}
|
||||
|
||||
private void IRCTab()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, c_Width, 21, HTML.White + "<CENTER>" + General.Local(100), false, false);
|
||||
|
||||
AddHtml(120, y += 25, 100, 21, HTML.White + General.Local(98), false, false);
|
||||
AddButton(90, y, Data.IrcEnabled ? 0x2343 : 0x2342, Data.IrcEnabled ? 0x2343 : 0x2342, "IRC Enabled", new TimerCallback(IrcEnabled));
|
||||
|
||||
if (!Data.IrcEnabled)
|
||||
return;
|
||||
|
||||
AddHtml(60, y += 25, 100, 21, HTML.White + General.Local(115), false, false);
|
||||
AddButton(30, y, Data.IrcAutoConnect ? 0x2343 : 0x2342, Data.IrcAutoConnect ? 0x2343 : 0x2342, "IRC Auto Connect", new TimerCallback(IrcAutoConnect));
|
||||
|
||||
AddHtml(180, y, 100, 21, HTML.White + General.Local(116), false, false);
|
||||
AddButton(150, y, Data.IrcAutoReconnect ? 0x2343 : 0x2342, Data.IrcAutoReconnect ? 0x2343 : 0x2342, "IRC Auto Reconnect", new TimerCallback(IrcAutoReconnect));
|
||||
|
||||
AddHtml(60, y += 25, 100, 21, HTML.White + General.Local(117), false, false);
|
||||
AddImageTiled(130, y, 100, 21, 0xBBA);
|
||||
AddTextField(130, y, 100, 21, 0x480, 0, Data.IrcNick);
|
||||
AddButton(235, y + 4, 0x2716, 0x2716, "Submit", new TimerCallback(Submit));
|
||||
|
||||
AddHtml(60, y += 25, 100, 21, HTML.White + General.Local(118), false, false);
|
||||
AddImageTiled(130, y, 100, 21, 0xBBA);
|
||||
AddTextField(130, y, 100, 21, 0x480, 1, Data.IrcServer);
|
||||
AddButton(235, y + 4, 0x2716, 0x2716, "Submit", new TimerCallback(Submit));
|
||||
|
||||
AddHtml(60, y += 25, 100, 21, HTML.White + General.Local(119), false, false);
|
||||
AddImageTiled(130, y, 100, 21, 0xBBA);
|
||||
AddTextField(130, y, 100, 21, 0x480, 2, Data.IrcRoom);
|
||||
AddButton(235, y + 4, 0x2716, 0x2716, "Submit", new TimerCallback(Submit));
|
||||
|
||||
AddHtml(60, y += 25, 100, 21, HTML.White + General.Local(120), false, false);
|
||||
AddImageTiled(130, y, 70, 21, 0xBBA);
|
||||
AddTextField(130, y, 70, 21, 0x480, 3, "" + Data.IrcPort);
|
||||
AddButton(235, y + 4, 0x2716, 0x2716, "Submit", new TimerCallback(Submit));
|
||||
|
||||
AddHtml(60, y += 25, 150, 21, HTML.White + General.Local(138) + ": " + General.Local(121 + (int)Data.IrcStaffColor), false, false);
|
||||
AddButton(40, y + 4, 0x2716, 0x2716, "Irc Staff Color", new TimerCallback(IrcStaffColor));
|
||||
|
||||
int num = 139;
|
||||
|
||||
if (IrcConnection.Connection.Connected)
|
||||
num = 141;
|
||||
if (IrcConnection.Connection.Connecting)
|
||||
num = 140;
|
||||
|
||||
AddHtml(110, y += 40, 150, 21, HTML.White + General.Local(num), false, false);
|
||||
AddButton(90, y + 4, 0x2716, 0x2716, "Connect or Cancel or Close", new TimerCallback(ConnectCancelClose));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Responses
|
||||
|
||||
private void Page(object o)
|
||||
{
|
||||
if (!(o is SetupPage))
|
||||
return;
|
||||
|
||||
c_Page = (SetupPage)o;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void ChannelSelect()
|
||||
{
|
||||
new ChannelSelectGump(this);
|
||||
}
|
||||
|
||||
private void DeleteChannel()
|
||||
{
|
||||
if (c_Channel != null)
|
||||
{
|
||||
foreach (string str in c_Channel.Commands)
|
||||
Channel.RemoveCommand(str);
|
||||
Channel.Channels.Remove(c_Channel);
|
||||
}
|
||||
|
||||
c_Channel = null;
|
||||
|
||||
NewGump();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
private void AutoNewChars()
|
||||
{
|
||||
if (c_Channel != null)
|
||||
{
|
||||
c_Channel.NewChars = !c_Channel.NewChars;
|
||||
|
||||
if (c_Channel.NewChars)
|
||||
foreach (Data data in Data.Datas.Values)
|
||||
data.Channels.Add(c_Channel.Name);
|
||||
return;
|
||||
}
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SubmitChannel()
|
||||
{
|
||||
if( GetTextField(10) != "" )
|
||||
c_Channel.Name = GetTextField(10);
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void AddCommand()
|
||||
{
|
||||
if (GetTextField(11) == "")
|
||||
{
|
||||
NewGump();
|
||||
return;
|
||||
}
|
||||
|
||||
if (c_Channel.Commands.Contains(GetTextField(11).ToLower()))
|
||||
{
|
||||
c_Channel.Commands.Remove(GetTextField(11).ToLower());
|
||||
Channel.RemoveCommand(GetTextField(11).ToLower());
|
||||
}
|
||||
else
|
||||
{
|
||||
c_Channel.Commands.Add(GetTextField(11).ToLower());
|
||||
Channel.AddCommand(GetTextField(11).ToLower());
|
||||
}
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Global()
|
||||
{
|
||||
c_Channel.Style = ChatStyle.Global;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Regional()
|
||||
{
|
||||
c_Channel.Style = ChatStyle.Regional;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SendToIrc()
|
||||
{
|
||||
SubmitChannel();
|
||||
|
||||
c_Channel.ToIrc = !c_Channel.ToIrc;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void ShowStaff()
|
||||
{
|
||||
Data.ShowStaff = !Data.ShowStaff;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void MaxMsgs()
|
||||
{
|
||||
Data.MaxMsgs = Utility.ToInt32(GetTextField(9));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void ReloadLocal()
|
||||
{
|
||||
General.LoadLocalFile();
|
||||
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(168));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void FilterSpeech()
|
||||
{
|
||||
Data.FilterSpeech = !Data.FilterSpeech;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void FilterMsg()
|
||||
{
|
||||
Data.FilterMsg = !Data.FilterMsg;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void SubmitFilterSpam()
|
||||
{
|
||||
Data.ChatSpam = Utility.ToInt32(GetTextField(4));
|
||||
Data.MsgSpam = Utility.ToInt32(GetTextField(5));
|
||||
Data.RequestSpam = Utility.ToInt32(GetTextField(6));
|
||||
Data.FilterBanLength = Utility.ToInt32(GetTextField(7));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void AddFilter()
|
||||
{
|
||||
if (GetTextField(8).Trim() == "")
|
||||
{
|
||||
NewGump();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Data.Filters.Contains(GetTextField(8).ToLower()))
|
||||
{
|
||||
Data.Filters.Remove(GetTextField(8).ToLower());
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(149) + " " + GetTextField(8).ToLower());
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.Filters.Add(GetTextField(8).ToLower());
|
||||
Owner.SendMessage(GetData.SystemC, General.Local(150) + " " + GetTextField(8).ToLower());
|
||||
}
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void FilterPenalty()
|
||||
{
|
||||
new FilterPenaltyGump(Owner, this);
|
||||
}
|
||||
|
||||
private void IrcEnabled()
|
||||
{
|
||||
Data.IrcEnabled = !Data.IrcEnabled;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void IrcAutoConnect()
|
||||
{
|
||||
Data.IrcAutoConnect = !Data.IrcAutoConnect;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void IrcAutoReconnect()
|
||||
{
|
||||
Data.IrcAutoReconnect = !Data.IrcAutoReconnect;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void Submit()
|
||||
{
|
||||
Data.IrcNick = GetTextField(0);
|
||||
Data.IrcServer = GetTextField(1);
|
||||
Data.IrcRoom = GetTextField(2);
|
||||
Data.IrcPort = Utility.ToInt32(GetTextField(3));
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void IrcStaffColor()
|
||||
{
|
||||
new IrcStaffColorGump(Owner, this);
|
||||
}
|
||||
|
||||
private void ConnectCancelClose()
|
||||
{
|
||||
Data.IrcNick = GetTextField(0);
|
||||
Data.IrcServer = GetTextField(1);
|
||||
Data.IrcRoom = GetTextField(2);
|
||||
Data.IrcPort = Utility.ToInt32(GetTextField(3));
|
||||
|
||||
if (IrcConnection.Connection.Connected)
|
||||
IrcConnection.Connection.Disconnect(false);
|
||||
else if (IrcConnection.Connection.Connecting)
|
||||
IrcConnection.Connection.CancelConnect();
|
||||
else if (!IrcConnection.Connection.Connected)
|
||||
IrcConnection.Connection.Connect(Owner);
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
private void About()
|
||||
{
|
||||
NewGump();
|
||||
|
||||
new AboutGump(Owner);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Classes
|
||||
|
||||
private class ChannelSelectGump : GumpPlus
|
||||
{
|
||||
private SetupGump c_Gump;
|
||||
|
||||
public ChannelSelectGump(SetupGump g) : base(g.Owner, 100, 100)
|
||||
{
|
||||
c_Gump = g;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, 150, 21, HTML.White + "<CENTER>" + General.Local(38), false, false);
|
||||
|
||||
foreach (Channel c in Channel.Channels)
|
||||
{
|
||||
if (c.Mod)
|
||||
{
|
||||
AddHtml(50, y += 20, 100, 21, HTML.White + c.NameFor(Owner), false, false);
|
||||
AddButton(30, y + 3, 0x2716, 0x2716, "Select Channel", new TimerStateCallback(SelectChannel), c);
|
||||
}
|
||||
}
|
||||
|
||||
AddHtml(50, y += 30, 100, 21, HTML.White + General.Local(178), false, false);
|
||||
AddButton(30, y + 3, 0x2716, 0x2716, "New Channel", new TimerCallback(NewChannel));
|
||||
|
||||
Entries.Insert(0, new GumpBackground(0, 0, 150, y + 40, 0x1400));
|
||||
}
|
||||
|
||||
private void NewChannel()
|
||||
{
|
||||
Channel c = new Channel("New");
|
||||
c.Mod = true;
|
||||
|
||||
c_Gump.Channel = c;
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
|
||||
private void SelectChannel(object o)
|
||||
{
|
||||
if (!(o is Channel))
|
||||
return;
|
||||
|
||||
c_Gump.Channel = (Channel)o;
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class IrcStaffColorGump : GumpPlus
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
|
||||
public IrcStaffColorGump(Mobile m, GumpPlus g) : base(m, 100, 100)
|
||||
{
|
||||
c_Gump = g;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, 150, 21, HTML.White + "<CENTER>" + General.Local(137), false, false);
|
||||
|
||||
y += 5;
|
||||
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
AddHtml(60, y += 20, 90, 21, HTML.White + General.Local(121 + i), false, false);
|
||||
AddButton(40, y + 4, 0x2716, 0x2716, "Select", new TimerStateCallback(Select), i);
|
||||
}
|
||||
|
||||
Entries.Insert(0, new GumpBackground(0, 0, 150, y + 40, 0x1400));
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
|
||||
private void Select(object o)
|
||||
{
|
||||
if (!(o is int))
|
||||
return;
|
||||
|
||||
Data.IrcStaffColor = (IrcColor)(int)o;
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class FilterPenaltyGump : GumpPlus
|
||||
{
|
||||
private GumpPlus c_Gump;
|
||||
|
||||
public FilterPenaltyGump(Mobile m, GumpPlus g) : base(m, 100, 100)
|
||||
{
|
||||
c_Gump = g;
|
||||
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
int y = 10;
|
||||
|
||||
AddHtml(0, y, 150, 21, HTML.White + "<CENTER>" + General.Local(154), false, false);
|
||||
|
||||
y += 5;
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
AddHtml(60, y += 20, 90, 21, HTML.White + General.Local(155 + i), false, false);
|
||||
AddButton(40, y + 4, 0x2716, 0x2716, "Select", new TimerStateCallback(Select), i);
|
||||
}
|
||||
|
||||
Entries.Insert(0, new GumpBackground(0, 0, 150, y + 40, 0x1400));
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
|
||||
private void Select(object o)
|
||||
{
|
||||
if (!(o is int))
|
||||
return;
|
||||
|
||||
Data.FilterPenalty = (FilterPenalty)(int)o;
|
||||
|
||||
c_Gump.NewGump();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class AboutGump : GumpPlus
|
||||
{
|
||||
public AboutGump(Mobile m) : base(m, 100, 100)
|
||||
{
|
||||
NewGump();
|
||||
}
|
||||
|
||||
protected override void BuildGump()
|
||||
{
|
||||
AddBackground(0, 0, 200, 100, 0x1400);
|
||||
|
||||
string txt = HTML.White + "<CENTER>Knives' Chat<br>" + General.Version + "<br>Release Date: " + General.ReleaseDate.Month + "/" + General.ReleaseDate.Day + "/" + General.ReleaseDate.Year + "<br>Contact: kmwill23@hotmail.com";
|
||||
|
||||
AddHtml(0, 10, 200, 81, txt , false, false);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
165
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Read.doc
Normal file
165
Scripts/SubSystem/Knives Chat 3.0 Beta 6/Read.doc
Normal file
@@ -0,0 +1,165 @@
|
||||
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}
|
||||
{\f36\froman\fcharset238\fprq2 Times New Roman CE;}{\f37\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f39\froman\fcharset161\fprq2 Times New Roman Greek;}{\f40\froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\f41\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f42\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f43\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f44\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\f46\fswiss\fcharset238\fprq2 Arial CE;}{\f47\fswiss\fcharset204\fprq2 Arial Cyr;}{\f49\fswiss\fcharset161\fprq2 Arial Greek;}{\f50\fswiss\fcharset162\fprq2 Arial Tur;}{\f51\fswiss\fcharset177\fprq2 Arial (Hebrew);}
|
||||
{\f52\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f53\fswiss\fcharset186\fprq2 Arial Baltic;}{\f54\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f56\fmodern\fcharset238\fprq1 Courier New CE;}{\f57\fmodern\fcharset204\fprq1 Courier New Cyr;}
|
||||
{\f59\fmodern\fcharset161\fprq1 Courier New Greek;}{\f60\fmodern\fcharset162\fprq1 Courier New Tur;}{\f61\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f62\fmodern\fcharset178\fprq1 Courier New (Arabic);}
|
||||
{\f63\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f64\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;
|
||||
\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
|
||||
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
|
||||
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
|
||||
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable
|
||||
{\list\listtemplateid-2096845188\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1814465516\'01\u-3913 ?;}{\levelnumbers;}\loch\af3\hich\af3\dbch\af0\fbias0
|
||||
\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }
|
||||
{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23
|
||||
\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
|
||||
\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0
|
||||
\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
||||
\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691
|
||||
\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}
|
||||
\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid480735794}{\list\listtemplateid1659899392\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext
|
||||
\leveltemplateid521150660\'01-;}{\levelnumbers;}\loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
||||
\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693
|
||||
\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}
|
||||
\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600
|
||||
\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }
|
||||
{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23
|
||||
\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
|
||||
\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid928544353}}{\*\listoverridetable{\listoverride\listid480735794
|
||||
\listoverridecount0\ls1}{\listoverride\listid928544353\listoverridecount0\ls2}}{\*\rsidtbl \rsid215240\rsid1515379\rsid1998663\rsid2097447\rsid2243826\rsid2891301\rsid3219579\rsid3609592\rsid3676129\rsid3964756\rsid4016229\rsid4726250\rsid4806749
|
||||
\rsid4984422\rsid5135562\rsid5530051\rsid6228220\rsid6235869\rsid7284320\rsid7358823\rsid7887838\rsid8069067\rsid8334579\rsid9308608\rsid9571899\rsid9797101\rsid9851181\rsid9975213\rsid10174989\rsid10180233\rsid10683748\rsid12546303\rsid12865895
|
||||
\rsid13062140\rsid13656871\rsid15147074\rsid15351652\rsid15678272\rsid16153030\rsid16465683}{\*\generator Microsoft Word 11.0.5604;}{\info{\author Kevin}{\operator Kevin}{\creatim\yr2006\mo5\dy19\hr20\min29}{\revtim\yr2006\mo6\dy16\hr11\min16}{\version31}
|
||||
{\edmins118}{\nofpages3}{\nofwords1358}{\nofchars7747}{\*\company }{\nofcharsws9087}{\vern24689}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984
|
||||
\dghshow0\dgvshow3\jcompress\viewkind4\viewscale100\nolnhtadjtbl\rsidroot4806749 \fet0\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}
|
||||
{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}
|
||||
{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
|
||||
\ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\f1\fs20\insrsid3676129 Summary:}{\f1\fs20\insrsid3676129
|
||||
\par
|
||||
\par }{\f1\fs20\insrsid4726250 Version 3.0 Beta 5}{\f1\fs20\insrsid3676129
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid9571899 {\f1\fs20\insrsid9571899\charrsid9571899 Supports RunUO 2.0***
|
||||
\par
|
||||
\par ***This version, due to command modifications between RunUO 1.0 and 2.0, will not work on previous RunUO versions!}{\f1\fs20\insrsid2097447
|
||||
\par }{\f1\fs20\insrsid9571899\charrsid9571899
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid2097447 {\f1\fs20\insrsid2097447 \tab Welcome to the third incarnation of my chat system! Amazing that a new major version seems to come along every summer, and I have to admit I don\rquote
|
||||
t plan it that way. The original chat system bega}{\f1\fs20\insrsid15351652 n development in January of 2004. I released the second maj
|
||||
or version in May of 2005. Each new version is a near complete rewrite from the ground up, allowing improved performance and design, as well as the possibility for new features.}{\f1\fs20\insrsid2097447
|
||||
\par }{\f1\fs20\insrsid8334579
|
||||
\par \tab This update doesn\rquote t disappoint! When I asked for ideas to include in the new release, many users suggested a way to create new chatting channels. I\rquote
|
||||
ve done just that, and in the process streamlined the setup and options on those channels. Each channel is independent, meaning you can remove it and nothing else will suffer. Ins
|
||||
tead of an option to turn off Faction, Guild, Alliance, and other channels, you can simply remove or rename those files.
|
||||
\par }{\f1\fs20\insrsid6228220
|
||||
\par \tab Many of the changes this update are improvements to existing portions of the system. Instead of just a private message received flag
|
||||
, players now get a friends list showing where those messages are coming from, kind of like popular instant messaging programs. }{\f1\fs20\insrsid9308608
|
||||
On top of that, players have a Mail client from which they can browse and delete older mail. Staff can also go into player mai
|
||||
l accounts to view offensive messages. To prevent overflowing mailboxes, players can require senders to be friends, and mailboxes have a maximum size just like the RunUO forums. Staff members can broadcast private messages to all players. Another minor
|
||||
feature is allowing players to break the normal text limit on composing messages.
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs20\insrsid3676129
|
||||
\par }{\f1\fs20\insrsid9308608 \tab Wow, that\rquote s a lot of private messaging improvements! Thanks to some excellent advice from other RunUO users, I\rquote ve also improved the connection to IRC servers. They shou
|
||||
ld connect faster and connect to more IRC server types. Players can also now ignore IRC chatters almost the same way as in-game players.}{\f1\fs20\insrsid9851181
|
||||
\par }{\f1\fs20\insrsid1998663
|
||||
\par \tab For non-English shards, a localization file allows easy modification of all the text used for the system.
|
||||
\par }{\f1\fs20\insrsid9851181
|
||||
\par \tab I stream
|
||||
lined the overall layout of the system, including the channel lists and selection, options, search, and setup. For example, if you want options related to private messaging, check the options in your mail or friends list. Related to searching, I finally
|
||||
}{\f1\fs20\insrsid6235869 re-added the phonebook style search from the original system!}{\f1\fs20\insrsid9851181
|
||||
\par }{\f1\fs20\insrsid8069067
|
||||
\par \tab Like always, I am soliciting all feedback, complaints and ideas you may have for the system. You should also report bugs, often!
|
||||
\par }{\f1\fs20\insrsid3676129
|
||||
\par \tab }{\f1\fs20\insrsid6235869 It wouldn\rquote t be the same if I didn\rquote t include\'85 this}{\f1\fs20\insrsid3676129 system }{\b\f1\fs20\insrsid3676129 requires no existing script modifications}{\f1\fs20\insrsid3676129 .
|
||||
\par
|
||||
\par \tab }{\f1\fs20\insrsid7887838 And of course\'85}{\b\f1\fs20\insrsid3676129 The IRC capability of this chat system does not handle nickname registration. You will have to do this for your shard using another client.
|
||||
\par }{\f1\fs20\insrsid3676129
|
||||
\par }{\b\f1\fs20\insrsid3676129 Features included in this system:
|
||||
\par }{\b\f1\fs20\insrsid15147074
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid15147074 \hich\af1\dbch\af0\loch\f1 -\tab}}\pard \ql \fi-360\li720\ri0\nowidctlpar\jclisttab\tx720\faauto\ls2\rin0\lin720\itap0\pararsid15147074 {\f1\fs20\insrsid15147074 Public or regional chatting
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid15147074 \hich\af1\dbch\af0\loch\f1 -\tab}Channel creation or removal}{\f1\fs20\insrsid15147074\charrsid15147074
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid15147074 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid15147074 Guild, Alliance, Faction and IRC chatting}{\f1\fs20\insrsid15147074\charrsid15147074
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid15147074 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid15147074 Channel listings with simple navigation}{\f1\fs20\insrsid15147074\charrsid15147074
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid15147074 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid15147074 Ignoring, banning, listening, global listening}{\f1\fs20\insrsid15147074\charrsid15147074
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid16465683 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid16465683 Filtering and s}{\f1\fs20\insrsid15147074 pam prevention}{\f1\fs20\insrsid15147074\charrsid15147074
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid1998663 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid1998663 IM style Friends list}{\f1\fs20\insrsid15147074
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid1998663 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid1998663 Mailbox interface
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid1998663 \hich\af1\dbch\af0\loch\f1 -\tab}In-game integrated IRC client
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid10683748 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid10683748 Localized text file for easy language changes}{\f1\fs20\insrsid10683748\charrsid15147074
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs20\insrsid3676129
|
||||
\par }{\b\f1\fs20\insrsid3676129 Commands included in this system:}{\f1\fs20\insrsid3676129 }{\f1\fs20\insrsid13062140
|
||||
\par
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}}\pard \ql \fi-360\li720\ri0\nowidctlpar\jclisttab\tx720\faauto\ls2\rin0\lin720\itap0\pararsid13062140 {\f1\fs20\insrsid13062140
|
||||
You control the commands for your public channels!
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}Guild: }{\b\f1\fs20\insrsid13062140 G, Guild}{\f1\fs20\insrsid13062140
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}Alliance: }{\b\f1\fs20\insrsid13062140 A, Ally}{\f1\fs20\insrsid13062140
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}Faction: }{\b\f1\fs20\insrsid13062140 F, Faction}{\f1\fs20\insrsid13062140
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}IRC: }{\b\f1\fs20\insrsid13062140 I, IRC}{\f1\fs20\insrsid13062140
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}Channel List: }{\b\f1\fs20\insrsid13062140 L, List}{\f1\fs20\insrsid13062140
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}Private Message: }{\b\f1\fs20\insrsid13062140 Pm, Msg}{\f1\fs20\insrsid13062140 (Followed by a player\rquote s name and text to include in message)
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}Admin Chat Setup: }{\b\f1\fs20\insrsid13062140 CS, ChatSetup}{\f1\fs20\insrsid13062140
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}Mail: }{\b\f1\fs20\insrsid13062140 Ma, Mail}{\f1\fs20\insrsid13062140
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13062140 \hich\af1\dbch\af0\loch\f1 -\tab}}\pard \ql \fi-360\li720\ri0\nowidctlpar\jclisttab\tx720\faauto\ls2\rin0\lin720\itap0\pararsid2243826 {\f1\fs20\insrsid13062140 Friends: }{\b\f1\fs20\insrsid13062140 F, Friends
|
||||
}{\f1\fs20\insrsid2243826\charrsid13656871
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid13656871 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid13656871 Staff: }{\b\f1\fs20\insrsid13656871 St, Staff}{\f1\fs20\insrsid13656871
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid12865895 {\f1\fs20\insrsid12865895
|
||||
\par }\pard \ql \fi720\li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid9975213 {\f1\fs20\insrsid12865895 There are more commands available through the Utiliti}{\f1\fs20\insrsid9975213 es package, including the error }{\f1\fs20\insrsid12865895
|
||||
reporting system (}{\b\f1\fs20\insrsid12865895 Errors}{\f1\fs20\insrsid12865895 ) and the command changing system (}{\b\f1\fs20\insrsid12865895 Commands}{\f1\fs20\insrsid12865895 ).}{\f1\fs20\insrsid12865895\charrsid12865895
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs20\insrsid13062140
|
||||
\par }{\b\f1\fs20\insrsid3676129 Interface details:}{\f1\fs20\insrsid3676129
|
||||
\par
|
||||
\par }{\f1\fs20\insrsid12546303 \tab The major addition in 3.0 is the new Channel system. These channels are very similar to previous public chat, where players can }{\f1\fs20\insrsid4016229 turn them on and off and view the players who have pu
|
||||
blic chat on. With channels, however, server admins can add more than one public chatroom! Players can join and leave these rooms by pressing the gold button next to the channel name on the channel list.}{\f1\fs20\insrsid12546303
|
||||
\par
|
||||
\par }{\f1\fs20\insrsid4016229 \tab Let\rquote s}{\f1\fs20\insrsid9975213 begin with the channel list. On your first login you will notice that no names display on this list, because you haven\rquote
|
||||
t chosen to join any available channels. Through this setup you can join and leave those channels at will, including all public channels. Press the gold button near the top lef
|
||||
t of the menu to access the channel list. If you are in a guild, that option will be available to you.}{\f1\fs20\insrsid5530051
|
||||
If IRC is enabled and connected, so will that. Once you join a channel, the gold button will spear next to it on that selection menu. When you press
|
||||
this, the list will reappear showing the names of players in that channel. If admins have allowed, staff names will also appear.
|
||||
\par
|
||||
\par \tab Next to the channel name at the top you will notice two small arrows. This allows you to change the number of names listed, for those players who want the smallest menu possible or be able to see as many names as possible. }{
|
||||
\f1\fs20\insrsid1515379 In the right corner is a minimize button, which does just that. }{\f1\fs20\insrsid5530051 At the bottom you\rquote ll find Options, Search, Mail and Friends buttons, which open those diff
|
||||
erent modules. Administrators will also see a button with a nice red \lquote A\rquote , which will open the Chat Setup menu.
|
||||
\par
|
||||
\par \tab The \lquote O\rquote options will open to the list\rquote s side, and have options specifically for channels and that specific channel. This same options button
|
||||
will appear on the Mail and Friend interface, and follow the same idea. They also all have the Search button, which allows searching players and mail based on text or a single letter \'93phonebook\'94 search.
|
||||
\par }{\f1\fs20\insrsid2891301
|
||||
\par \tab These options also provide staff members additiona
|
||||
l options. In particular, if they have Global Access, granted by administrators, they can listen to other players. When Global is selected, you will get additional options like Global Pms, Global Chat, Global World. When Global is not selected, you can
|
||||
select individual players to listen to, and all that player\rquote s chats, messages, and world speech will be seen in your }{\f1\fs20\insrsid16153030 game window.}{\f1\fs20\insrsid2891301
|
||||
\par }{\f1\fs20\insrsid1515379
|
||||
\par \tab Each player will have a little gold button next to their name. Using this you can open up options specifically for that pla
|
||||
yer, where you can friend, ignore or send them a message. Staff can also listen or globally ignore them, open their client information, go to them, and read their mail messages.
|
||||
\par
|
||||
\par \tab The friend\rquote s list has many features I\rquote ve just described. In addition, the minimized friend\rquote
|
||||
s list will appear when you receive a private message, and you can check that message through the minimized interface. However, if you open that menu up you\rquote ll be able to see exactly who sent you that message, and chose whichever you want
|
||||
to read first. Normally, only people you\rquote ve identified as friends will appear on your list. When you receive a message from a non-friend, they will appear temporarily.
|
||||
\par }{\f1\fs20\insrsid4984422
|
||||
\par \tab The options for friends allow you to limit who can send you messages, and who can add you as a friend. By selecting \'93Only friends can send messages\'94, only if you and the other are on each other\rquote
|
||||
s friend list can you pass messages between. By selecting \'93Require friend requests\'94, players must request your approval before adding you to their friend\rquote
|
||||
s list. Of course you can also have neat sounds for private messages from specific players.
|
||||
\par
|
||||
\par \tab Those private messages permanently appear in your Mail. Be careful, because there is a limit to the number of private messages your mailbox can hold! If it\rquote
|
||||
s full, only staff can send you messages. Luckily Mail has an option to automatically delete messages that are more than 7 days old. You can also bug your Admin to change the max mailbox storage.
|
||||
\par }{\f1\fs20\insrsid3964756
|
||||
\par \tab When sending a private message to another player, you can go beyond the normal message size limit by using the new recording feature. When you activate this feature, everything you say on the UO command line will appear in your }{
|
||||
\f1\fs20\insrsid5135562 private message window.}{\f1\fs20\insrsid15678272 When done, simple hit the send button!}{\f1\fs20\insrsid3964756
|
||||
\par }{\f1\fs20\insrsid10180233
|
||||
\par \tab Administrators have their own special options menu, opened through [chatsetup or the red \lquote A\rquote button on the channel list. The first page you\rquote
|
||||
ll see is the channel setup page, where you can add and modify new public channels. The second page contains a few misc options. The third shows all filter and spam options. Finally, the fourth page lets you setup the IRC connection.}{
|
||||
\f1\fs20\insrsid2891301
|
||||
\par }{\f1\fs20\insrsid15678272
|
||||
\par \tab It\rquote s all so simple!
|
||||
\par }{\f1\fs20\insrsid3676129
|
||||
\par }{\b\f1\fs20\insrsid3676129 Installing:}{\f1\fs20\insrsid3676129
|
||||
\par
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid3609592 \hich\af1\dbch\af0\loch\f1 -\tab}}\pard \ql \fi-360\li720\ri0\nowidctlpar\jclisttab\tx720\faauto\ls2\rin0\lin720\itap0\pararsid3609592 {\f1\fs20\insrsid3609592 Remove all previous installations of Knives
|
||||
\rquote Chat
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid3609592 \hich\af1\dbch\af0\loch\f1 -\tab}Remove all previous installations of Knives\rquote Utilities
|
||||
\par {\listtext\pard\plain\f2\fs20\insrsid9797101 \hich\af2\dbch\af0\loch\f2 o\tab}}\pard \ql \fi-360\li1440\ri0\nowidctlpar\jclisttab\tx1440\faauto\ls2\ilvl1\rin0\lin1440\itap0\pararsid9797101 {\b\f1\fs20\insrsid9797101
|
||||
NOTE: If you use RunUO 1.0, the current Utilities version is 1.02!}{\f1\fs20\insrsid9797101
|
||||
\par {\listtext\pard\plain\f2\fs20\insrsid9797101 \hich\af2\dbch\af0\loch\f2 o\tab}}\pard \ql \fi-360\li1440\ri0\nowidctlpar\jclisttab\tx1440\faauto\ls2\ilvl1\rin0\lin1440\itap0\pararsid3609592 {\b\f1\fs20\insrsid9797101
|
||||
NOTE: This system uses Utilities 1.03, which is not compatible with Non-2.0 Chat or TownHouses}{\b\f1\fs20\insrsid3609592 .}{\f1\fs20\insrsid3609592
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid3609592 \hich\af1\dbch\af0\loch\f1 -\tab}}\pard \ql \fi-360\li720\ri0\nowidctlpar\jclisttab\tx720\faauto\ls2\rin0\lin720\itap0\pararsid3609592 {\f1\fs20\insrsid3609592 Drop the new Knives\rquote
|
||||
Chat and Utilities into your custom folder.
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid3609592 \hich\af1\dbch\af0\loch\f1 -\tab}If you want to use the Localization file, move ChatLocal.txt to your \lquote \\RunUO\\data\\\rquote folder.
|
||||
\par {\listtext\pard\plain\f1\fs20\insrsid3219579 \hich\af1\dbch\af0\loch\f1 -\tab}}{\f1\fs20\insrsid3219579 Run the server! }{\b\f1\fs20\insrsid3219579 No existing script modifications required!}{\f1\fs20\insrsid3219579
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\b\f1\fs20\insrsid9797101
|
||||
\par }{\b\f1\fs20\insrsid3676129 Contact Info:}{\f1\fs20\insrsid3676129 Send me an email day or night (Though I will likely be sleeping at night)! kmwill23@hotmail.com}{\b\f1\fs20\insrsid3676129
|
||||
\par }}
|
||||
Reference in New Issue
Block a user