private void Ignore() { Data.GetData(Owner).Ignores.Add(c_Message.From); Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(68) + " " + c_Message.From.RawName); if (c_Message.Type == MsgType.Invite) { Deny(); } }
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 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 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 RemoveFriend(Mobile m) { if (!c_Friends.Contains(m)) { return; } c_Friends.Remove(m); c_Mobile.SendMessage(c_SystemC, m.Name + " " + General.Local(72)); }
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)); }
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.RawName); c_Gump.NewGump(); }
public void Disconnect(bool reconn) { try { if (c_Connected) { BroadcastSystem(General.Local(110)); } c_Connected = false; c_Connecting = false; if (c_Thread != null) { try { c_Thread.Abort(); } catch { } 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(IrcGump))) { GumpPlus.RefreshGump(data.Mobile, typeof(IrcGump)); } } } catch (Exception e) { Errors.Report(General.Local(268), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } }
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)); }
private void Ban() { if (Data.GetData(c_Target).Banned) { Data.GetData(c_Target).RemoveBan(); Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(78) + " " + c_Target.Name); NewGump(); } else { new BanGump(c_Target, this); } }
private void Client() { NewGump(); if (c_Target.NetState == null) { Owner.SendMessage(Data.GetData(Owner).SystemC, c_Target.Name + " " + General.Local(83)); } else { Owner.SendGump(new ClientGump(Owner, c_Target.NetState)); } }
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)); }
public override bool CanChat(Mobile m, bool say) { if (MultiConnection.Connection == null || !MultiConnection.Connection.Connected) { if (say) { m.SendMessage(Data.GetData(m).SystemC, General.Local(158)); } return(false); } return(base.CanChat(m, say)); }
protected override void BuildGump() { int width = 200; int y = 10; AddHtml(50, y, 100, 45, "<CENTER>" + General.Local(271), false, false); AddImage(width / 2 - 80, y + 7, 0x39); AddImage(width / 2 + 50, y + 7, 0x3B); AddHtml(20, y += 45, width - 40, 80, HTML.Black + c_Not.Text, true, true); AddBackgroundZero(0, 0, width, y += 100, Data.GetData(Owner).DefaultBack); }
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)); }
public static void Save() { try { SaveGlobalOptions(); } catch (Exception e) { Errors.Report(General.Local(175), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { SavePlayerOptions(); } catch (Exception e) { Errors.Report(General.Local(228), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { SaveFriends(); } catch (Exception e) { Errors.Report(General.Local(230), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { SaveIgnores(); } catch (Exception e) { Errors.Report(General.Local(232), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { SaveGlobalListens(); } catch (Exception e) { Errors.Report(General.Local(234), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { SaveMsgs(); } catch (Exception e) { Errors.Report(General.Local(236), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } }
protected override void BuildGump() { int width = 150; int y = -10; AddHtml(0, y += 25, width, "<CENTER>" + General.Local(1)); AddImage(0 + 10, y + 2, 0x39); AddImage(0 + width - 40, y + 2, 0x3B); AddHtml(0, y += 25, width, "<CENTER>" + General.Local(46)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.All); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.All); AddHtml(0, y += 20, width, "<CENTER>" + General.Local(56)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Mail); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Mail); AddHtml(0, y += 20, width, "<CENTER>" + General.Local(203)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Friends); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Friends); AddHtml(0, y += 20, width, "<CENTER>" + General.Local(51)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Ignores); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Ignores); AddHtml(0, y += 20, width, (c_Gump.CurrentPage == ListPage.Channel ? "" : HTML.Gray) + "<CENTER>" + General.Local(206)); if (c_Gump.CurrentPage == ListPage.Channel) { AddButton(20, y + 3, 0x2716, "History", new GumpCallback(c_Gump.History)); AddButton(width - 30, y + 3, 0x2716, "History", new GumpCallback(c_Gump.History)); } if (Data.GetData(c_Target).GlobalAccess) { AddHtml(0, y += 20, width, HTML.Red + "<CENTER>" + General.Local(204)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.GIgnores); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.GIgnores); AddHtml(0, y += 20, width, HTML.Red + "<CENTER>" + General.Local(205)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.GListens); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.GListens); } if (c_Target.AccessLevel > AccessLevel.GameMaster) { AddHtml(0, y += 20, width, HTML.Red + "<CENTER>" + General.Local(54)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Bans); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Bans); AddHtml(0, y += 20, width, HTML.Red + "<CENTER>" + General.Local(269)); AddButton(20, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Notifications); AddButton(width - 30, y + 3, 0x2716, "Page", new GumpStateCallback(c_Gump.Page), ListPage.Notifications); } AddBackgroundZero(0, 0, width, y + 40, Data.GetData(c_Target).DefaultBack, false); }
public static void Load() { try { LoadGlobalOptions(); } catch (Exception e) { Errors.Report(General.Local(174), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { LoadPlayerOptions(); } catch (Exception e) { Errors.Report(General.Local(227), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { LoadFriends(); } catch (Exception e) { Errors.Report(General.Local(229), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { LoadIgnores(); } catch (Exception e) { Errors.Report(General.Local(231), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { LoadGlobalListens(); } catch (Exception e) { Errors.Report(General.Local(233), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } try { LoadMsgs(); } catch (Exception e) { Errors.Report(General.Local(235), e); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } }
private void ConnectTcp() { try{ c_Tcp = new TcpClient(Data.IrcServer, Data.IrcPort); } catch { BroadcastSystem(General.Local(106)); Reconnect(); return; } ConnectStream(); }
protected override void BuildGump() { int width = 150; int y = -10; AddHtml(0, y += 25, width, "<CENTER>" + General.Local(40)); AddImage(10, y + 2, 0x39); AddImage(width - 40, y + 2, 0x3B); AddHtml(0, y += 25, width, "<CENTER>" + General.Local(49)); AddButton(20, y + 3, 0x2716, "Colors", new GumpCallback(c_Gump.Colors)); AddButton(width - 30, y + 3, 0x2716, "Colors", new GumpCallback(c_Gump.Colors)); AddHtml(0, y += 20, width, "<CENTER>" + General.Local(56)); AddButton(20, y + 3, 0x2716, "Mail", new GumpCallback(c_Gump.Mail)); AddButton(width - 30, y + 3, 0x2716, "Mail", new GumpCallback(c_Gump.Mail)); if (Data.GetData(c_Target).GlobalAccess) { AddHtml(0, y += 20, width, HTML.Red + "<CENTER>" + General.Local(43)); AddButton(20, y + 3, 0x2716, "Global Menu", new GumpCallback(c_Gump.GlobalMenu)); AddButton(width - 30, y + 3, 0x2716, "Global Menu", new GumpCallback(c_Gump.GlobalMenu)); } if (c_Target.AccessLevel >= AccessLevel.Administrator) { AddHtml(0, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(207)); AddButton(20, y + 3, 0x2716, "General", new GumpCallback(c_Gump.GenOpt)); AddButton(width - 30, y + 3, 0x2716, "General", new GumpCallback(c_Gump.GenOpt)); AddHtml(0, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(237)); AddButton(20, y + 3, 0x2716, "Logging", new GumpCallback(c_Gump.Logging)); AddButton(width - 30, y + 3, 0x2716, "Logging", new GumpCallback(c_Gump.Logging)); AddHtml(0, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(208)); AddButton(20, y + 3, 0x2716, "Filter", new GumpCallback(c_Gump.Filter)); AddButton(width - 30, y + 3, 0x2716, "Filter", new GumpCallback(c_Gump.Filter)); AddHtml(0, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(209)); AddButton(20, y + 3, 0x2716, "Spam", new GumpCallback(c_Gump.Spam)); AddButton(width - 30, y + 3, 0x2716, "Spam", new GumpCallback(c_Gump.Spam)); AddHtml(0, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(210)); AddButton(20, y + 3, 0x2716, "Irc", new GumpCallback(c_Gump.Irc)); AddButton(width - 30, y + 3, 0x2716, "Irc", new GumpCallback(c_Gump.Irc)); AddHtml(0, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(287)); AddButton(20, y + 3, 0x2716, "Multi", new GumpCallback(c_Gump.Multi)); AddButton(width - 30, y + 3, 0x2716, "Multi", new GumpCallback(c_Gump.Multi)); AddHtml(0, y += 20, width, HTML.LightPurple + "<CENTER>" + General.Local(50)); AddButton(20, y + 3, 0x2716, "Channel", new GumpCallback(c_Gump.Channel)); AddButton(width - 30, y + 3, 0x2716, "Channel", new GumpCallback(c_Gump.Channel)); } AddBackgroundZero(0, 0, width, y + 40, Data.GetData(c_Target).DefaultBack, false); }
protected override void BuildGump() { int width = Data.GetData(Owner).ExtraPm ? 400 : 300; int y = 10; int field = Data.GetData(Owner).ExtraPm ? 300 : 150; if (c_MsgType == MsgType.System) { AddHtml(0, y, width, "<CENTER>" + General.Local(94)); } else if (c_MsgType == MsgType.Staff) { AddHtml(0, y, width, "<CENTER>" + General.Local(256)); } else { AddHtml(0, y, width, "<CENTER>" + General.Local(62) + " " + c_To.RawName); } AddImage(width / 2 - 120, y + 2, 0x39); AddImage(width / 2 + 90, y + 2, 0x3B); if (Data.GetData(Owner).Recording == this) { AddHtml(30, y += 20, width - 60, 25, c_Subject, true, false); AddHtml(20, y += 30, width - 40, field, c_Text, true, true); AddHtml(0, y += (field + 20), width, "<CENTER>" + General.Local(63)); } else { AddTextField(30, y += 20, width - 60, 21, Data.GetData(Owner).MsgC, 0xBBC, "Subject", c_Subject); AddTextField(20, y += 30, width - 40, field, Data.GetData(Owner).MsgC, 0xBBC, "Text", c_Text); y += (field + 15); if (Data.GetData(Owner).ExtraPm) { AddButton(20, y, 0x2333, "Record", new GumpCallback(Record)); } AddButton(50, y, Data.GetData(Owner).ExtraPm ? 0x25E4 : 0x25E8, Data.GetData(Owner).ExtraPm ? 0x25E5 : 0x25E9, "ExtraPm", new GumpCallback(ExtraPm)); } AddImage(width / 2 - 10, y, 0x2342, Data.GetData(Owner).MsgC); AddButton(width / 2 - 6, y + 4, 0x2716, "Channel Color", new GumpCallback(Color)); AddHtml(width - 85, y, 50, General.Local(252)); AddButton(width - 100, y + 3, 0x2716, "Send", new GumpCallback(Send)); AddBackgroundZero(0, 0, width, y + 30, Data.GetData(Owner).DefaultBack); }
private void Record() { Save(); if (c_Subject.Trim() == "") { c_Subject = "No Subject"; } Data.GetData(Owner).Recording = this; Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(65)); NewGump(); }
private void Goto() { if (c_Target.NetState == null) { Owner.SendMessage(Data.GetData(Owner).SystemC, c_Target.Name + " " + General.Local(83)); } else { Owner.Location = c_Target.Location; Owner.Map = c_Target.Map; } NewGump(); }
protected override void BuildGump() { int width = 300; int y = 10; AddHtml(0, y, width, "<CENTER>" + General.Local(214)); AddImage(width / 2 - 100, y + 2, 0x39); AddImage(width / 2 + 70, y + 2, 0x3B); AddHtml(0, y += 25, width, "<CENTER>" + General.Local(142)); AddButton(width / 2 - 120, y, Data.FilterSpeech ? 0x2343 : 0x2342, "Filter Speech", new GumpCallback(FilterSpeech)); AddButton(width / 2 + 100, y, Data.FilterSpeech ? 0x2343 : 0x2342, "Filter Speech", new GumpCallback(FilterSpeech)); AddHtml(0, y += 20, width, "<CENTER>" + General.Local(143)); AddButton(width / 2 - 120, y, Data.FilterMsg ? 0x2343 : 0x2342, "Filter Messages", new GumpCallback(FilterMsg)); AddButton(width / 2 + 100, y, Data.FilterMsg ? 0x2343 : 0x2342, "Filter Messages", new GumpCallback(FilterMsg)); AddHtml(0, y += 25, width, "<CENTER>" + General.Local(154) + ": " + General.Local(155 + (int)Data.FilterPenalty)); AddButton(width / 2 - 80, y + 4, 0x2716, "Filter Penalty", new GumpCallback(FilterPenalty)); AddButton(width / 2 + 70, y + 4, 0x2716, "Filter Penalty", new GumpCallback(FilterPenalty)); if (Data.FilterPenalty == Chat3.FilterPenalty.Ban) { AddHtml(0, y += 25, width / 2 - 10, "<DIV ALIGN=RIGHT>" + General.Local(147)); AddTextField(width / 2 + 15, y, 30, 21, 0x480, 0xBBA, "Ban Length", "" + Data.FilterBanLength); AddHtml(width / 2 + 45, y, 100, "m"); AddButton(width / 2 - 5, y + 4, 0x2716, "Submit", new GumpCallback(Submit)); } if (Data.FilterPenalty != Chat3.FilterPenalty.None) { AddHtml(0, y += 25, width / 2 - 10, "<DIV ALIGN=RIGHT>" + General.Local(254)); AddTextField(width / 2 + 15, y, 30, 21, 0x480, 0xBBA, "Warnings", "" + Data.FilterWarnings); AddButton(width / 2 - 5, y + 4, 0x2716, "Submit", new GumpCallback(Submit)); } AddHtml(0, y += 25, width / 2 - 10, "<DIV ALIGN=RIGHT>" + General.Local(148)); AddTextField(width / 2 + 15, y, 70, 21, 0x480, 0xBBA, "Add/Remove", ""); AddButton(width / 2 - 5, y + 4, 0x2716, "Add/Remove Filter", new GumpCallback(AddFilter)); string txt = General.Local(151) + " "; foreach (string filter in Data.Filters) { txt += filter + " "; } AddHtml(20, y += 25, width - 40, 60, txt, false, false); AddBackgroundZero(0, 0, width, y + 80, Data.GetData(Owner).DefaultBack); }
public void OnDataReceived(IAsyncResult asyn) { try { MultiPacket pak = (MultiPacket)asyn.AsyncState; byte[] buffer = new byte[1024]; int count = pak.Socket.Receive(buffer); char[] chars = new char[count]; System.Text.Encoding.ASCII.GetDecoder().GetChars(buffer, 0, count, chars, 0); string input = new System.String(chars).Trim(); //Console.WriteLine(pak.Socket + " " + input); if (c_Server) { if (input.ToLower().IndexOf("<") != 0) { c_Names[pak.Socket] = input; BroadcastSystem(input + General.Local(292)); } else { Broadcast(input); SendMaster(input); } } else { HandleInput(input); } WaitForData(pak.Socket); } catch { if (c_Server) { CloseMaster(); } else { CloseSlave(); } //Console.WriteLine(e.Message); //Console.WriteLine(e.StackTrace); } }
private void Reconnect() { c_Attempts++; if (!HasMoreAttempts) { c_Attempts = 1; BroadcastSystem(General.Local(104)); return; } BroadcastSystem(General.Local(105) + c_Attempts); Connect(); }
private void Force() { GumpInfo.ForceMenu = !GumpInfo.ForceMenu; if (GumpInfo.ForceMenu) { Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(242)); } else { Owner.SendMessage(Data.GetData(Owner).SystemC, General.Local(243)); } NewGump(); }