bobbot-cvs Mailing List for BoB (Page 6)
Status: Alpha
Brought to you by:
iainmckay
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(66) |
Feb
(31) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(18) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
From: Iain M. <iai...@us...> - 2004-12-30 03:36:37
|
Update of /cvsroot/bobbot/Bob/Core/Irc/Messages/Commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9060/Core/Irc/Messages/Commands Removed Files: ClientNoticeMessage.cs Log Message: No longer needed. Replaced by NoticeMessage.cs --- ClientNoticeMessage.cs DELETED --- |
From: Iain M. <iai...@us...> - 2004-12-30 03:34:10
|
Update of /cvsroot/bobbot/Bob/Core/RemoteAdmin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8381/Core/RemoteAdmin Modified Files: RemoteConnection.cs RemoteService.cs Log Message: Many new changes. Most notably host-based recognition. Index: RemoteService.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/RemoteAdmin/RemoteService.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RemoteService.cs 23 Dec 2004 23:03:38 -0000 1.1 --- RemoteService.cs 30 Dec 2004 03:33:28 -0000 1.2 *************** *** 28,31 **** --- 28,34 ---- using Bot.Core.Events; + using Bot.Core.Irc; + using Bot.Core.Irc.Messages; + namespace Bot.Core.RemoteAdmin { *************** *** 57,60 **** --- 60,65 ---- { m_Users = new ArrayList(); + + Kernel.Instance.Network.PrivateMessage += new PrivateMessageEventHandler(OnPrivateMessage); } #endregion *************** *** 113,116 **** --- 118,124 ---- { m_Users.Add(sender); + + if(UserAuthenticated != null) + UserAuthenticated(sender, args); } *************** *** 146,149 **** --- 154,171 ---- MessageReceived(sender, args); } + + private void OnPrivateMessage(NetworkConnection sender, PrivateMessageEventArgs args) + { + // HACK - Add real ctcp support + string findIn = args.Message.Message.ToLower(); + + if((findIn[0] != 0x001) || (findIn[findIn.Length - 1] != 0x001) + || (findIn.IndexOf("chat") == -1)) + return; + + Console.Write(new DccChatRequestMessage(args.Message.From, IPAddress.Loopback, Kernel.Instance.RemoteAdmin.m_Port).ToString()); + + sender.Send(new DccChatRequestMessage(args.Message.From, IPAddress.Loopback, Kernel.Instance.RemoteAdmin.m_Port)); + } #endregion } Index: RemoteConnection.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/RemoteAdmin/RemoteConnection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RemoteConnection.cs 23 Dec 2004 23:03:38 -0000 1.1 --- RemoteConnection.cs 30 Dec 2004 03:33:28 -0000 1.2 *************** *** 220,224 **** else { ! if(((bool) thisUser.GetProperty("IsAdmin")) == true) { Log.WriteLine("Admin", "{0} successfully authenticated as {1}", this.RemoteEndPoint, m_TempUser); --- 220,224 ---- else { ! if((thisUser.HasProperty("IsAdmin") == true) && ((bool) thisUser.GetProperty("IsAdmin")) == true) { Log.WriteLine("Admin", "{0} successfully authenticated as {1}", this.RemoteEndPoint, m_TempUser); |
From: Iain M. <iai...@us...> - 2004-12-30 03:34:09
|
Update of /cvsroot/bobbot/Bob/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8381/Core Modified Files: IStore.cs Kernel.cs KernelHelper.cs User.cs Log Message: Many new changes. Most notably host-based recognition. Index: User.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/User.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** User.cs 23 Dec 2004 22:56:11 -0000 1.1 --- User.cs 30 Dec 2004 03:33:28 -0000 1.2 *************** *** 22,25 **** --- 22,29 ---- using System; using System.Collections; + using System.Collections.Specialized; + using System.Text.RegularExpressions; + + using Bot.Core.Collections; namespace Bot.Core *************** *** 31,44 **** { #region Public properties ! public virtual object this[string key] { ! get { return GetProperty(key); } ! set ! { ! if(HasProperty(key)) ! SetProperty(key, value, ((PropertyEntry) m_Properties[key]).Type); ! else ! AddProperty(key, value, value.GetType()); ! } } --- 35,48 ---- { #region Public properties ! public virtual PropertyCollection Properties { ! get { return m_Properties; } ! set { m_Properties = value; } ! } ! ! public virtual StringCollection Hosts ! { ! get { return m_Hosts; } ! set { m_Hosts = value; } } *************** *** 69,73 **** { get { return (bool) GetProperty("IsAdmin"); } ! set { SetProperty("IsAdmin", true, typeof(bool)); } } #endregion --- 73,77 ---- { get { return (bool) GetProperty("IsAdmin"); } ! set { SetProperty("IsAdmin", true); } } #endregion *************** *** 79,83 **** protected DateTime m_Created; ! protected Hashtable m_Properties; #endregion --- 83,88 ---- protected DateTime m_Created; ! protected StringCollection m_Hosts; ! protected PropertyCollection m_Properties; #endregion *************** *** 86,94 **** { m_Created = DateTime.Now; ! m_Properties = new Hashtable(); } #endregion ! #region Public methods public int ComparePassword(string password) { --- 91,100 ---- { m_Created = DateTime.Now; ! m_Hosts = new StringCollection(); ! m_Properties = new PropertyCollection(); } #endregion ! #region Public methods public int ComparePassword(string password) { *************** *** 96,127 **** } ! public virtual void AddProperty(string key, object value, Type type) { ! m_Properties[key] = new PropertyEntry(key, value, type); } ! public virtual void RemoveProperty(string key) { ! if(m_Properties.ContainsKey(key)) ! m_Properties.Remove(key); } ! public virtual void SetProperty(string key, object value, Type type) { ! ((PropertyEntry) m_Properties[key]).Type = type; ! ((PropertyEntry) m_Properties[key]).Value = value; } ! public virtual object GetProperty(string key) { ! if(!m_Properties.ContainsKey(key)) ! return ""; ! return ((PropertyEntry) m_Properties[key]).Value; } ! public virtual bool HasProperty(string key) { ! return m_Properties.ContainsKey(key); } #endregion --- 102,167 ---- } ! public virtual void AddProperty(string name, object value, Type type) { ! m_Properties.AddProperty(name, value, type); } ! public virtual void RemoveProperty(string name) { ! m_Properties.RemoveProperty(name); } ! public virtual void SetProperty(string name, object value) { ! m_Properties.SetProperty(name, value); } ! public virtual object GetProperty(string name) { ! if(m_Properties.ContainsProperty(name) == false) ! return null; ! return m_Properties[name].Value; } ! public virtual bool HasProperty(string name) { ! return m_Properties.ContainsProperty(name); ! } ! ! public virtual void AddHost(string host) ! { ! if(m_Hosts.Contains(host)) ! return; ! ! m_Hosts.Add(host); ! } ! ! public virtual void RemoveHost(string host) ! { ! m_Hosts.Remove(host); ! } ! ! public virtual bool HasHost(string host) ! { ! return m_Hosts.Contains(host); ! } ! ! public virtual bool HasMatchingHost(string matchHost) ! { ! Regex r = new Regex(matchHost.Replace("*", ".*"), RegexOptions.Singleline); ! ! lock(m_Hosts) ! { ! foreach(string host in m_Hosts) ! { ! Console.WriteLine("Matching {0} against {1}, is match {2}", matchHost.Replace("*", ".*"), host.Replace("*", ".*"), r.IsMatch(host.Replace("*", ".*"))); ! ! if(r.IsMatch(host.Replace("*", ".*"))) ! return true; ! } ! } ! ! return false; } #endregion Index: KernelHelper.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/KernelHelper.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** KernelHelper.cs 23 Dec 2004 23:03:38 -0000 1.1 --- KernelHelper.cs 30 Dec 2004 03:33:28 -0000 1.2 *************** *** 21,25 **** --- 21,27 ---- using System; + using System.Net; using System.Text; + using System.Globalization; using System.Security.Cryptography; *************** *** 39,42 **** --- 41,70 ---- return hashedString; } + + #region Borrowed from thresher + public static string IPAddressToLong( IPAddress ipAddress ) + { + if( ipAddress == null ) + { + throw new ArgumentException("Address cannot be null"); + } + return NetworkUnsignedLong( ipAddress.Address ).ToString( CultureInfo.InvariantCulture ); + } + + private static long NetworkUnsignedLong( long hostOrderLong ) + { + long networkLong = IPAddress.HostToNetworkOrder( hostOrderLong ); + //Network order has the octets in reverse order starting with byte 7 + //To get the correct string simply shift them down 4 bytes + //and zero out the first 4 bytes. + return (networkLong >> 32 ) & 0x00000000ffffffff; + } + + public static IPAddress GetLocalHost() + { + IPHostEntry localhost = Dns.Resolve( Dns.GetHostName() ); + return localhost.AddressList[0]; + } + #endregion } } \ No newline at end of file Index: Kernel.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/Kernel.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Kernel.cs 23 Dec 2004 22:56:11 -0000 1.3 --- Kernel.cs 30 Dec 2004 03:33:28 -0000 1.4 *************** *** 151,155 **** #endregion ! #region Private methods private void LoadStorageSolution() { --- 151,155 ---- #endregion ! #region Private methods private void LoadStorageSolution() { *************** *** 162,166 **** if(type == null) ! throw new TypeLoadException("xyz"); m_DataStore = (IStore) asm.CreateInstance(type.ToString(), true); --- 162,166 ---- if(type == null) ! throw new TypeLoadException(); m_DataStore = (IStore) asm.CreateInstance(type.ToString(), true); *************** *** 409,413 **** { int index = 0; ! string comStr = ""; ArrayList chanParts = new ArrayList(); --- 409,414 ---- { int index = 0; ! string comStr = ""; ! bool validCommand = false; ArrayList chanParts = new ArrayList(); *************** *** 436,442 **** --- 437,448 ---- } ); + + validCommand = true; } } } + + if(!validCommand) + RemoteAdmin.Broadcast("[{0}] {1}", ((RemoteConnection) sender).Data.Name, args.Message); } #endregion Index: IStore.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/IStore.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IStore.cs 23 Dec 2004 22:56:11 -0000 1.3 --- IStore.cs 30 Dec 2004 03:33:28 -0000 1.4 *************** *** 39,43 **** User GetUser(string name); User CreateUser(string name); ! void DeleteUser(string name); bool UserExists(string name); --- 39,43 ---- User GetUser(string name); User CreateUser(string name); ! bool DeleteUser(string name); bool UserExists(string name); *************** *** 49,52 **** --- 49,55 ---- IChannelCollection FindChannelsWithProperty(string prop); IChannelCollection FindChannelsWithProperty(string prop, object value); + + User FindClosestUser(string toHost); + IUserCollection FindUsersWithHost(string host); } } |
From: Iain M. <iai...@us...> - 2004-12-30 03:34:09
|
Update of /cvsroot/bobbot/Bob/Core/Irc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8381/Core/Irc Modified Files: NetworkConnection.cs NetworkPump.cs NetworkUser.cs Log Message: Many new changes. Most notably host-based recognition. Index: NetworkConnection.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/Irc/NetworkConnection.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NetworkConnection.cs 23 Dec 2004 22:56:12 -0000 1.5 --- NetworkConnection.cs 30 Dec 2004 03:33:28 -0000 1.6 *************** *** 218,229 **** public event NickInUseReplyEventHandler NickInUse; - public event JoinChannelMessageEventHandler Join; public event PartMessageEventHandler Part; public event PingMessageEventHandler Ping; public event NickMessageEventHandler NickChanged; public event ModeMessageEventHandler ModeChanged; ! public event PrivateMessageEventHandler PrivateMessage; ! public event ClientNoticeMessageEventHandler ClientNotice; public event ChannelMessageEventHandler ChannelMessage; public event MessageReceivedEventHandler MessageReceived; --- 218,229 ---- public event NickInUseReplyEventHandler NickInUse; public event PartMessageEventHandler Part; public event PingMessageEventHandler Ping; + public event NoticeMessageEventHandler Notice; public event NickMessageEventHandler NickChanged; public event ModeMessageEventHandler ModeChanged; ! public event JoinChannelMessageEventHandler Join; public event ChannelMessageEventHandler ChannelMessage; + public event PrivateMessageEventHandler PrivateMessage; public event MessageReceivedEventHandler MessageReceived; *************** *** 337,341 **** { if(nick == null) ! throw new ArgumentNullException("nick cannot be null", "nick"); if(Nickname.ToLower() == nick.ToLower()) --- 337,341 ---- { if(nick == null) ! throw new ArgumentNullException("nick", "nick cannot be null"); if(Nickname.ToLower() == nick.ToLower()) *************** *** 348,352 **** { if(user == null) ! throw new ArgumentNullException("user cannot be null", "user"); return IsMe(user.Nickname); --- 348,352 ---- { if(user == null) ! throw new ArgumentNullException("user", "user cannot be null"); return IsMe(user.Nickname); *************** *** 358,362 **** throw new InvalidChannelNameException(); if(message == null) ! throw new ArgumentNullException("message cannot be null", "message"); Send(new ChannelMessage(dest, String.Format(message, args))); --- 358,362 ---- throw new InvalidChannelNameException(); if(message == null) ! throw new ArgumentNullException("message", "message cannot be null"); Send(new ChannelMessage(dest, String.Format(message, args))); *************** *** 366,372 **** { if(dest == null) ! throw new ArgumentNullException("dest cannot be null", "dest"); if(message == null) ! throw new ArgumentNullException("message cannot be null", "message"); Send(new ChannelMessage(dest, String.Format(message, args))); --- 366,372 ---- { if(dest == null) ! throw new ArgumentNullException("dest", "dest cannot be null"); if(message == null) ! throw new ArgumentNullException("message", "message cannot be null"); Send(new ChannelMessage(dest, String.Format(message, args))); *************** *** 378,382 **** throw new InvalidNicknameException(); if(message == null) ! throw new ArgumentNullException("message cannot be null", "message"); Send(new PrivateMessage(dest, String.Format(message, args))); --- 378,382 ---- throw new InvalidNicknameException(); if(message == null) ! throw new ArgumentNullException("message", "message cannot be null"); Send(new PrivateMessage(dest, String.Format(message, args))); *************** *** 386,414 **** { if(dest == null) ! throw new ArgumentNullException("dest cannot be null", "dest"); if(message == null) ! throw new ArgumentNullException("message cannot be null", "message"); Send(new PrivateMessage(dest, String.Format(message, args))); } ! public void SendClientNotice(string dest, string message, params object[] args) { if(!IrcHelper.IsValidNickname(dest)) throw new InvalidNicknameException(); if(message == null) ! throw new ArgumentNullException("message cannot be null", "message"); ! Send(new ClientNoticeMessage(dest, String.Format(message, args))); } ! public void SendClientNotice(NetworkUser dest, string message, params object[] args) { if(dest == null) ! throw new ArgumentNullException("dest cannot be null", "dest"); if(message == null) ! throw new ArgumentNullException("message cannot be null", "message"); ! Send(new ClientNoticeMessage(dest, String.Format(message, args))); } --- 386,414 ---- { if(dest == null) ! throw new ArgumentNullException("dest", "dest cannot be null"); if(message == null) ! throw new ArgumentNullException("message", "message cannot be null"); Send(new PrivateMessage(dest, String.Format(message, args))); } ! public void SendNotice(string dest, string message, params object[] args) { if(!IrcHelper.IsValidNickname(dest)) throw new InvalidNicknameException(); if(message == null) ! throw new ArgumentNullException("message", "message cannot be null"); ! Send(new NoticeMessage(dest, String.Format(message, args))); } ! public void SendNotice(NetworkUser dest, string message, params object[] args) { if(dest == null) ! throw new ArgumentNullException("dest", "dest cannot be null"); if(message == null) ! throw new ArgumentNullException("message", "message cannot be null"); ! Send(new NoticeMessage(dest, String.Format(message, args))); } *************** *** 426,432 **** { if(dest == null) ! throw new ArgumentNullException("dest cannot be null", "dest"); if(reason == null) ! throw new ArgumentNullException("reason cannot be null", "reason"); Send(new PartMessage(dest, String.Format(reason, args))); --- 426,432 ---- { if(dest == null) ! throw new ArgumentNullException("dest", "dest cannot be null"); if(reason == null) ! throw new ArgumentNullException("reason", "reason cannot be null"); Send(new PartMessage(dest, String.Format(reason, args))); *************** *** 436,442 **** { if(dest == null) ! throw new ArgumentNullException("dest cannot be null", "dest"); if(reason == null) ! throw new ArgumentNullException("reason cannot be null", "reason"); Send(new PartMessage(dest, String.Format(reason, args))); --- 436,442 ---- { if(dest == null) ! throw new ArgumentNullException("dest", "dest cannot be null"); if(reason == null) ! throw new ArgumentNullException("reason", "reason cannot be null"); Send(new PartMessage(dest, String.Format(reason, args))); *************** *** 451,457 **** { if(dest == null) ! throw new ArgumentNullException("dest cannot be null", "dest"); if(key == null) ! throw new ArgumentNullException("key cannot be null", "key"); Send(new JoinChannelMessage(dest, key)); --- 451,457 ---- { if(dest == null) ! throw new ArgumentNullException("dest", "dest cannot be null"); if(key == null) ! throw new ArgumentNullException("key", "key cannot be null"); Send(new JoinChannelMessage(dest, key)); *************** *** 466,472 **** { if(dest == null) ! throw new ArgumentNullException("dest cannot be null", "dest"); if(key == null) ! throw new ArgumentNullException("key cannot be null", "key"); Send(new JoinChannelMessage(dest, key)); --- 466,472 ---- { if(dest == null) ! throw new ArgumentNullException("dest", "dest cannot be null"); if(key == null) ! throw new ArgumentNullException("key", "key cannot be null"); Send(new JoinChannelMessage(dest, key)); *************** *** 663,671 **** if(args.Message.IsClient) { ! ClientNoticeMessage msg = new ClientNoticeMessage(args.Message.Destination, args.Message.Message); msg.From = args.Message.From; ! if(ClientNotice != null) ! ClientNotice(this, new ClientNoticeMessageEventArgs(msg)); } } --- 663,671 ---- if(args.Message.IsClient) { ! NoticeMessage msg = new NoticeMessage(args.Message.Destination, args.Message.Message); msg.From = args.Message.From; ! if(Notice != null) ! Notice(this, new NoticeMessageEventArgs(msg)); } } *************** *** 681,684 **** --- 681,686 ---- { args.Message.From.Channels.Remove(args.Message.Channel.Name); + + // TODO: If a user parts all channels remove all records of the user. } Index: NetworkPump.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/Irc/NetworkPump.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NetworkPump.cs 23 Dec 2004 22:56:12 -0000 1.2 --- NetworkPump.cs 30 Dec 2004 03:33:28 -0000 1.3 *************** *** 216,220 **** if(subMessages[i].EndsWith("\r")) { ! Console.WriteLine(subMessages[i]); if(MessageReceived != null) MessageReceived(m_Network, new MessageReceivedEventArgs(subMessages[i].Trim('\r', '\n', ' '))); --- 216,220 ---- if(subMessages[i].EndsWith("\r")) { ! //Console.WriteLine(subMessages[i]); if(MessageReceived != null) MessageReceived(m_Network, new MessageReceivedEventArgs(subMessages[i].Trim('\r', '\n', ' '))); Index: NetworkUser.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Core/Irc/NetworkUser.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NetworkUser.cs 9 Dec 2004 19:43:17 -0000 1.1 --- NetworkUser.cs 30 Dec 2004 03:33:28 -0000 1.2 *************** *** 87,91 **** #endregion ! #region Public methods public override string ToString() { --- 87,101 ---- #endregion ! #region Public methods ! public void SendMessage(string format, params object[] args) ! { ! Kernel.Instance.Network.SendPrivateMessage(this.Nickname, format, args); ! } ! ! public void SendNotice(string format, params object[] args) ! { ! Kernel.Instance.Network.SendNotice(this.Nickname, format, args); ! } ! public override string ToString() { |
From: Iain M. <iai...@us...> - 2004-12-30 03:33:53
|
Update of /cvsroot/bobbot/Bob/Storage/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8381/Storage/Xml Modified Files: StorageEngine.cs XmlUser.cs Log Message: Many new changes. Most notably host-based recognition. Index: XmlUser.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Storage/Xml/XmlUser.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XmlUser.cs 24 Dec 2004 00:36:36 -0000 1.2 --- XmlUser.cs 30 Dec 2004 03:33:42 -0000 1.3 *************** *** 77,84 **** type = Type.GetType(xmlProp.GetAttribute("type")); ! m_Properties.Add(xmlProp.GetAttribute("key"), new PropertyEntry( xmlProp.GetAttribute("key"), Convert.ChangeType(xmlProp.GetAttribute("value"), type), ! type)); } } --- 77,97 ---- type = Type.GetType(xmlProp.GetAttribute("type")); ! AddProperty( xmlProp.GetAttribute("key"), Convert.ChangeType(xmlProp.GetAttribute("value"), type), ! type); ! } ! } ! ! if(xmlElement["Hosts"] != null) ! { ! XmlNodeList xmlList = xmlElement["Hosts"].GetElementsByTagName("Host"); ! ! foreach(XmlElement xmlHost in xmlList) ! { ! if(xmlHost.InnerText == String.Empty) ! continue; ! ! m_Hosts.Add(xmlHost.InnerText); } } *************** *** 104,107 **** --- 117,123 ---- xmlElement.AppendChild(propGroup); + XmlNode hostGroup = xmlElement.OwnerDocument.CreateElement("Hosts"); + xmlElement.AppendChild(hostGroup); + foreach(DictionaryEntry entry in m_Properties) { *************** *** 116,119 **** --- 132,143 ---- } + foreach(string host in m_Hosts) + { + XmlElement hostElement = xmlElement.OwnerDocument.CreateElement("Host"); + hostElement.InnerXml = host; + + hostGroup.AppendChild(hostElement); + } + return true; } Index: StorageEngine.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Storage/Xml/StorageEngine.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StorageEngine.cs 23 Dec 2004 22:56:12 -0000 1.2 --- StorageEngine.cs 30 Dec 2004 03:33:29 -0000 1.3 *************** *** 114,123 **** } ! public void DeleteUser(string name) { if(!UserExists(name)) ! return; m_Users.Remove(name); } --- 114,124 ---- } ! public bool DeleteUser(string name) { if(!UserExists(name)) ! return false; m_Users.Remove(name); + return true; } *************** *** 167,170 **** --- 168,189 ---- } + public User FindClosestUser(string toHost) + { + if(toHost == null) + throw new ArgumentNullException("toHost", "toHost cannot be null"); + + IUserCollection possibleUsers = FindUsersWithHost(toHost); + IUserCollection secondStage = new IUserCollection(); + IUserCollection thirdStage = new IUserCollection(); + + if((possibleUsers.Count == 0) || (possibleUsers.Count > 1)) + return null; + + IEnumerator myEnu = possibleUsers.GetEnumerator(); + myEnu.MoveNext(); + + return (User) ((DictionaryEntry) myEnu.Current).Value; + } + public IChannelCollection FindChannelsWithProperty(string prop) { *************** *** 202,205 **** --- 221,242 ---- return chanCollection; } + + public IUserCollection FindUsersWithHost(string host) + { + IUserCollection userCollection = new IUserCollection(); + + lock(m_Users) + { + foreach(DictionaryEntry entry in m_Users) + { + User user = (User) entry.Value; + + if(user.HasMatchingHost(host)) + userCollection.Add(user); + } + } + + return userCollection; + } #endregion |
From: Iain M. <iai...@us...> - 2004-12-30 03:33:38
|
Update of /cvsroot/bobbot/Bob/Core/Irc/Messages/Commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8381/Core/Irc/Messages/Commands Added Files: DccChatRequestMessage.cs NoticeMessage.cs Log Message: Many new changes. Most notably host-based recognition. --- NEW FILE: DccChatRequestMessage.cs --- #region LGPL License /* Bastard of a Bot Library Copyright (C) 2004 Bastard of a Bot Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; using System.Net; using System.Text; using Bot.Core.Irc; using Bot.Core.Irc.Exceptions; namespace Bot.Core.Irc.Messages { /// <summary> /// Summary description for DccChatRequestMessage. /// </summary> public class DccChatRequestMessage : BaseMessage { #region Public properties public override string Command { get { return "DCC CHAT"; } } #endregion #region Private members #endregion #region Constructors public DccChatRequestMessage() : base() { } public DccChatRequestMessage(string dest, IPAddress address, int port) : this(new NetworkUser(dest), address, port) { } public DccChatRequestMessage(NetworkUser dest, IPAddress address, int port) { Parameters.Add(dest); Parameters.Add(address); Parameters.Add(port); } #endregion #region Public methods public override void Notify(NetworkConnection toNotify) { //toNotify.OnJoinChannel(new JoinChannelMessageEventArgs(this)); } public override string ToString() { string msgPart = String.Format( "\x0001DCC CHAT chat {0} {1}\x0001", KernelHelper.IPAddressToLong(KernelHelper.GetLocalHost()), Parameters[2]); return String.Format("PRIVMSG {0} :{1}", ((NetworkUser) Parameters[0]).Nickname, msgPart); } #endregion } public delegate void DccChatRequestMessageEventHandler(NetworkConnection network, DccChatRequestMessageEventArgs args); public class DccChatRequestMessageEventArgs : EventArgs { #region Public properties public DccChatRequestMessage Message { get { return m_Message; } } #endregion #region Channel members private DccChatRequestMessage m_Message; #endregion #region Constructor public DccChatRequestMessageEventArgs(DccChatRequestMessage message) { m_Message = message; } #endregion } } --- NEW FILE: NoticeMessage.cs --- #region LGPL License /* Bastard of a Bot Library Copyright (C) 2004 Bastard of a Bot Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; using Bot.Core.Irc; using Bot.Core.Irc.Exceptions; namespace Bot.Core.Irc.Messages { /// <summary> /// Summary description for NoticeMessage. /// </summary> public class NoticeMessage : BaseMessage { #region Public properties public override string Command { get { return "NOTICE"; } } public string Destination { get { return ((string) Parameters[0]); } set { if(!IrcHelper.IsValidNickname(value)) throw new InvalidNicknameException(); Parameters[0] = value; } } public string Message { get { return ((string) Parameters[1]); } set { Parameters[1] = value; } } #endregion #region Constructors public NoticeMessage() : base() { } public NoticeMessage(string dest, string message) : base() { if(!IrcHelper.IsValidNickname(dest)) throw new InvalidNicknameException(); Parameters.Add(dest); Parameters.Add(message); } public NoticeMessage(NetworkUser dest, string message) : this(dest.Nickname, message) { } #endregion #region Public methods public override void Notify(NetworkConnection toNotify) { //toNotify.OnNotice(new NoticeMessageEventArgs(this)); } #endregion } public delegate void NoticeMessageEventHandler(NetworkConnection network, NoticeMessageEventArgs args); public class NoticeMessageEventArgs : EventArgs { #region Public properties public NoticeMessage Message { get { return m_Message; } } #endregion #region Private members private NoticeMessage m_Message; #endregion #region Constructor public NoticeMessageEventArgs(NoticeMessage message) { m_Message = message; } #endregion } } |
From: Iain M. <iai...@us...> - 2004-12-30 03:33:38
|
Update of /cvsroot/bobbot/Bob/Core/Collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8381/Core/Collections Added Files: PropertyCollection.cs Log Message: Many new changes. Most notably host-based recognition. --- NEW FILE: PropertyCollection.cs --- #region LGPL License /* Bastard of a Bot Library Copyright (C) 2004 Bastard of a Bot Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; using System.Collections; using Bot.Core; namespace Bot.Core.Collections { public class PropertyCollection { #region Public properties public PropertyEntry this[string name] { get { return (m_Table[name] as PropertyEntry); } } public ICollection Keys { get { return m_Table.Keys; } } public ICollection Values { get { return m_Table.Values; } } public int Count { get { return m_Table.Count; } } #endregion #region Private members private Hashtable m_Table; #endregion #region Constructor public PropertyCollection() { m_Table = new Hashtable(); } #endregion #region Public methods public void AddProperty(string name, object value, Type type) { if(name == null) throw new ArgumentNullException("name", "name cannot be null"); if(type == null) throw new ArgumentNullException("type", "type cannot be null"); try { m_Table[name] = new PropertyEntry(name, ChangeType(value, type), type); } catch(FormatException ex) { throw new FormatException(ex.Message, ex); } } public void RemoveProperty(string name) { m_Table.Remove(name); } public bool ContainsProperty(string name) { return (m_Table[name] != null); } public void SetProperty(string name, object value) { PropertyEntry toSet = this[name]; if(toSet == null) return; try { toSet.Value = ChangeType(value, toSet.Type); } catch(FormatException ex) { throw new FormatException(ex.Message, ex); } } public void Clear() { m_Table.Clear(); } public IEnumerator GetEnumerator() { return new Enumerator(this); } #endregion #region Private methods private object ChangeType(object value, Type type) { try { return Convert.ChangeType(value, type); } catch(FormatException ex) { throw new FormatException(ex.Message, ex); } } #endregion #region Enumerator public sealed class Enumerator : IEnumerator { #region Private members private IDictionaryEnumerator m_InternalEnum; #endregion #region Constructor internal Enumerator(PropertyCollection target) { m_InternalEnum = target.m_Table.GetEnumerator(); } #endregion #region IEnumerator implementation public object Current { get { return (PropertyEntry) m_InternalEnum.Value; } } public void Reset() { m_InternalEnum.Reset(); } public bool MoveNext() { return m_InternalEnum.MoveNext(); } #endregion } #endregion } } |
From: Mr S. C. <mrs...@us...> - 2004-12-24 20:27:41
|
Update of /cvsroot/bobbot/Plugins/Sphere In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12404/Sphere Modified Files: SpherePlugin.cs Log Message: - Added 'Jail Edit <Account> <Length> [<Reason>]' as a private command. Edits an account entry by adding the <Length> (Can be a negative value) and amending the Reason set. - Added bool JailSystem.JailEdit(string[] args) - Added bool JailSystem.JailEdit(string account, string gm, string length, string reason) - Added bool JailSystem.EditEntry(string account, string gm, string length, string reason) Index: SpherePlugin.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/SpherePlugin.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SpherePlugin.cs 24 Dec 2004 01:25:56 -0000 1.4 --- SpherePlugin.cs 24 Dec 2004 20:27:32 -0000 1.5 *************** *** 466,469 **** --- 466,470 ---- Kernel.Instance.Network.SendClientNotice(user, "Jail Add Jails an account."); Kernel.Instance.Network.SendClientNotice(user, "Jail Del Releases an account from jail."); + Kernel.Instance.Network.SendClientNotice(user, "Jail Edit Edits an account entry."); Kernel.Instance.Network.SendClientNotice(user, "Jail Info Displays jail entry information"); Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); *************** *** 481,484 **** --- 482,492 ---- return; } + + if (m_JailSystem.IsJailed(args[1])) + { + Kernel.Instance.Network.SendClientNotice(user, "Account '{0}' is already jailed!", args[1]); + return; + } + string jailargs = ""; for (int i = 3; i < args.Length; i++) *************** *** 489,492 **** --- 497,501 ---- else Kernel.Instance.Network.SendClientNotice(user, "Unable to jail '{0}'", args[1]); + return; } *************** *** 510,513 **** --- 519,549 ---- else Kernel.Instance.Network.SendClientNotice(user, "Unable to release '{0}'", args[1]); + + return; + } + + case "edit": + { + if (args.Length < 3) + { + Kernel.Instance.Network.SendClientNotice(user, "Incorrect Arguments: 'Jail Edit <Account> <Length> [<Reason>]'"); + return; + } + + if (!m_JailSystem.IsJailed(args[1])) + { + Kernel.Instance.Network.SendClientNotice(user, "Account '{0}' wasn't jailed!", args[1]); + return; + } + + string jailargs = ""; + for (int i = 3; i < args.Length; i++) + jailargs += " " + args[i]; + + if (m_JailSystem.EditJail(args[1], user.Nickname, args[2], jailargs.Trim())) + Kernel.Instance.Network.SendClientNotice(user, "'{0}'s jail entry is edited!", args[1]); + else + Kernel.Instance.Network.SendClientNotice(user, "Unable to edit jail entry '{0}'!", args[1]); + return; } *************** *** 548,551 **** --- 584,588 ---- else Kernel.Instance.Network.SendClientNotice(user, "Account '{0}' Not Jailed!", args[1]); + return; } *************** *** 557,560 **** --- 594,598 ---- else Kernel.Instance.Network.SendClientNotice(user, "Database Failed to Save!"); + return; } *************** *** 593,596 **** --- 631,648 ---- } + case "edit": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Edit <Account> <Length> [<Reason>]", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Edits the entry for <Account> in the database, exchanging the"); + Kernel.Instance.Network.SendClientNotice(user, "entry's length to <Length> hours."); + Kernel.Instance.Network.SendClientNotice(user, "If [<Reason>] is provided then this will also be amended."); + Kernel.Instance.Network.SendClientNotice(user, "The 'Jailed By' property of the jail entry will be amended to "); + Kernel.Instance.Network.SendClientNotice(user, "indicate that the entry has been amended by another staff"); + Kernel.Instance.Network.SendClientNotice(user, "member if that is the case."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Edit myAccount 24", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, " /msg {0} Jail Edit myAccount 24 Jailed for bug abuse.", Kernel.Instance.Network.Nickname); + return; + } + case "save": { *************** *** 628,633 **** } - - return; } --- 680,683 ---- *************** *** 640,643 **** --- 690,694 ---- Kernel.Instance.Network.SendClientNotice(user, "Jail Add Jails an account."); Kernel.Instance.Network.SendClientNotice(user, "Jail Del Releases an account from jail."); + Kernel.Instance.Network.SendClientNotice(user, "Jail Edit Edits an account entry."); Kernel.Instance.Network.SendClientNotice(user, "Jail Info Displays jail entry information"); Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); |
From: Mr S. C. <mrs...@us...> - 2004-12-24 20:27:41
|
Update of /cvsroot/bobbot/Plugins/Sphere/JailSystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12404/Sphere/JailSystem Modified Files: JailSystem.cs Log Message: - Added 'Jail Edit <Account> <Length> [<Reason>]' as a private command. Edits an account entry by adding the <Length> (Can be a negative value) and amending the Reason set. - Added bool JailSystem.JailEdit(string[] args) - Added bool JailSystem.JailEdit(string account, string gm, string length, string reason) - Added bool JailSystem.EditEntry(string account, string gm, string length, string reason) Index: JailSystem.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/JailSystem/JailSystem.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JailSystem.cs 24 Dec 2004 01:25:47 -0000 1.2 --- JailSystem.cs 24 Dec 2004 20:27:32 -0000 1.3 *************** *** 217,220 **** --- 217,252 ---- } + public bool EditEntry(string account, string gm, TimeSpan length, string reason) + { + try + { + if (!IsJailed(account)) + return false; + + JailEntry entry = GetJailEntry(account); + + if (entry.JailedBy.IndexOf(" (Amended by ") > -1) + entry.JailedBy = entry.JailedBy.Substring(0, entry.JailedBy.IndexOf(' ')); + if (gm != entry.JailedBy) + entry.JailedBy += " (Amended by " + gm + ")"; + + if (length.TotalMilliseconds > DateTime.Now.Subtract(entry.JailedUntil).TotalMilliseconds) + entry.JailedUntil = entry.JailedUntil.Add(length); + + if (reason != null) + entry.Reason = reason; + + entry.StartSentence(); + + if (!DelEntry(account)) + return false; + + m_JailEntryList.Add(entry); + return true; + } + + catch { return false; } + } + public JailEntry[] GetJailEntryList() { *************** *** 255,259 **** m_Server.Write(String.Format("account {0} jail 1", account), true); ! AddEntry(account, character, gm, TimeSpan.FromHours(double.Parse(length)), reason); Log.WriteLine("Sphere (JailDB)", "Account '{0}' is jailed by {1}! ({2} hours) (Reason: {3})", account, gm, length, reason); return true; --- 287,294 ---- m_Server.Write(String.Format("account {0} jail 1", account), true); ! ! if (!AddEntry(account, character, gm, TimeSpan.FromHours(double.Parse(length)), reason)) ! return false; ! Log.WriteLine("Sphere (JailDB)", "Account '{0}' is jailed by {1}! ({2} hours) (Reason: {3})", account, gm, length, reason); return true; *************** *** 263,266 **** --- 298,331 ---- } + public bool EditJail(string[] args) + { + if (args.Length < 5) + return false; + + return EditJail(args[0], args[1], args[2], args[3]); + } + + public bool EditJail(string account, string gm, string length, string reason) + { + if (!m_Server.IsConnected) { return false; } + + try + { + if (!IsJailed(account)) + return false; + + if (reason == null || reason == "") + reason = null; + + if (!EditEntry(account, gm, TimeSpan.FromHours(double.Parse(length)), reason)) + return false; + + Log.WriteLine("Sphere (JailDB)", "Account Entry '{0}' is edited by {1}! ({2} hours) (Reason: {3})", account, gm, (double.Parse(length) != 0? length : "Unedited"), (reason == null || reason == ""? "Unedited" : reason )); + return true; + } + + catch { return false; } + } + public bool Release(string[] args) { *************** *** 283,287 **** m_Server.Write(String.Format("account {0} jail 0", account), true); ! DelEntry(account); Log.WriteLine("Sphere (JailDB)", "Account '{0}' is released from jail!", account); return true; --- 348,355 ---- m_Server.Write(String.Format("account {0} jail 0", account), true); ! ! if (!DelEntry(account)) ! return false; ! Log.WriteLine("Sphere (JailDB)", "Account '{0}' is released from jail!", account); return true; |
From: Mr S. C. <mrs...@us...> - 2004-12-24 01:26:34
|
Update of /cvsroot/bobbot/Plugins/Sphere/JailSystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29920/Sphere/JailSystem Modified Files: JailEntry.cs JailSystem.cs Log Message: - Corrected a Spelling Mistake. - Added a 500ms delay between sending the login code and password when connecting the sphere to prevent losing the connection. - Added 'Jail Help <Command>' private command. Gives a more detailed description for each of the Jail Commands and provides examples. - Changed the command list (When providing unknown command for Jail) to display less detail for commands. - Put more spaces in the code. (so silly people like Jock can read it :D) Index: JailEntry.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/JailSystem/JailEntry.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JailEntry.cs 23 Dec 2004 23:02:28 -0000 1.1 --- JailEntry.cs 24 Dec 2004 01:25:47 -0000 1.2 *************** *** 90,94 **** if (m_JailTimer == null || !m_JailTimer.Enabled) return "Sentence Disabled"; ! return String.Format("{0} seconds left", m_JailTimer.Interval / 1000); } } --- 90,97 ---- if (m_JailTimer == null || !m_JailTimer.Enabled) return "Sentence Disabled"; ! ! TimeSpan sentence = m_JailEnd.Subtract(DateTime.Now); ! ! return String.Format("{0} hours left", Convert.ToInt32(sentence.TotalHours)); } } *************** *** 105,113 **** --- 108,119 ---- m_JailTimer.Dispose(); } + TimeSpan sentence = m_JailEnd.Subtract(DateTime.Now); + if (sentence.TotalMilliseconds < 30) m_JailTimer = new Timer(30); else m_JailTimer = new Timer(sentence.TotalMilliseconds); + m_JailTimer.AutoReset = false; m_JailTimer.Elapsed += new ElapsedEventHandler(this.OnSentenceServed); *************** *** 178,182 **** try { - //Bot.Core.Log.WriteLine("Sphere (JailDB)", "Attempting to release '{0}'", m_Account); if (!m_JailSystem.Release(this)) { --- 184,187 ---- *************** *** 187,193 **** return; } ! //Bot.Core.Log.WriteLine("Sphere (JailDB)", "Account '{0}' *SHOULD* be released :)", m_Account); return; } catch (System.Exception ex) { --- 192,199 ---- return; } ! return; } + catch (System.Exception ex) { Index: JailSystem.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/JailSystem/JailSystem.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JailSystem.cs 23 Dec 2004 23:02:28 -0000 1.1 --- JailSystem.cs 24 Dec 2004 01:25:47 -0000 1.2 *************** *** 43,50 **** --- 43,52 ---- private string JailDatabase = "JailDatabase.xml"; private SphereConnection m_Server; + private JailEntry[] m_JailEntries { get { return (JailEntry[]) m_JailEntryList.ToArray(typeof(JailEntry)); } } + private ArrayList m_JailEntryList; #endregion *************** *** 120,125 **** --- 122,129 ---- m_JailEntryList.Add(entry); } + return true; } + catch(Exception ex) { *************** *** 159,162 **** --- 163,167 ---- return true; } + catch(Exception ex) { *************** *** 174,177 **** --- 179,183 ---- if (IsJailed(account)) return false; + JailEntry entry = new JailEntry( this ); entry.Account = account; *************** *** 185,188 **** --- 191,195 ---- return true; } + catch { return false; } } *************** *** 194,197 **** --- 201,205 ---- if (!IsJailed(account)) return false; + for (int i = 0; i < m_JailEntryList.Count; i++) { *************** *** 201,207 **** --- 209,217 ---- return true; } + } return false; } + catch { return false; } } *************** *** 218,222 **** --- 228,234 ---- if (i.Account.ToLower() == account.ToLower()) return i; + } + return null; } *************** *** 226,229 **** --- 238,242 ---- if (args.Length < 5) return false; + return Jail(args[0], args[1], args[2], args[3], args[4]); } *************** *** 232,241 **** --- 245,257 ---- { if (!m_Server.IsConnected) { return false; } + try { if (reason == null || reason == "") reason = "None Set"; + if (character == null || character == "") character = "All"; + m_Server.Write(String.Format("account {0} jail 1", account), true); AddEntry(account, character, gm, TimeSpan.FromHours(double.Parse(length)), reason); *************** *** 243,246 **** --- 259,263 ---- return true; } + catch { return false; } } *************** *** 259,266 **** --- 276,285 ---- { if (!m_Server.IsConnected) { return false; } + try { if (!IsJailed(account)) return false; + m_Server.Write(String.Format("account {0} jail 0", account), true); DelEntry(account); *************** *** 268,271 **** --- 287,291 ---- return true; } + catch { return false; } } *************** *** 277,284 **** --- 297,306 ---- if (((JailEntry) m_JailEntryList[i]).Account.ToLower() == account.ToLower()) return true; + } return false; } + #endregion |
From: Mr S. C. <mrs...@us...> - 2004-12-24 01:26:21
|
Update of /cvsroot/bobbot/Plugins/Sphere In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29920/Sphere Modified Files: SphereConnection.cs SpherePlugin.cs Log Message: - Corrected a Spelling Mistake. - Added a 500ms delay between sending the login code and password when connecting the sphere to prevent losing the connection. - Added 'Jail Help <Command>' private command. Gives a more detailed description for each of the Jail Commands and provides examples. - Changed the command list (When providing unknown command for Jail) to display less detail for commands. - Put more spaces in the code. (so silly people like Jock can read it :D) Index: SpherePlugin.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/SpherePlugin.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SpherePlugin.cs 23 Dec 2004 23:00:05 -0000 1.3 --- SpherePlugin.cs 24 Dec 2004 01:25:56 -0000 1.4 *************** *** 302,306 **** private void OnTimerElapsed(object sender, ElapsedEventArgs e) { ! Kernel.Instance.Network.SendChannelMessage(m_Config.OutputChannel, "Resyncing Bot"); if (m_Server.IsConnected) --- 302,306 ---- private void OnTimerElapsed(object sender, ElapsedEventArgs e) { ! //Kernel.Instance.Network.SendChannelMessage(m_Config.OutputChannel, "Resyncing Bot"); if (m_Server.IsConnected) *************** *** 461,469 **** { Kernel.Instance.Network.SendClientNotice(user, "Incorrect Usage. (Jail <command> [<arguments>])"); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Add <Account> <Length> [<Reason>]' - Jails <Account> and enters the information into the database. <Length> is in hours. <Reason> is optional."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Del <Account>' - Releases <Account> from jail and removes the database entry."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Info <Account>' - Displays jail entry information for <Account>"); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail List' - Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Save' - Forces the Jail Database to be saved."); return; } --- 461,472 ---- { Kernel.Instance.Network.SendClientNotice(user, "Incorrect Usage. (Jail <command> [<arguments>])"); ! Kernel.Instance.Network.SendClientNotice(user, "Following commands are available to you"); ! Kernel.Instance.Network.SendClientNotice(user, "Use 'Jail Help <command>' for more information"); ! Kernel.Instance.Network.SendClientNotice(user, "------------------------------------------------"); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Add Jails an account."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Del Releases an account from jail."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Info Displays jail entry information"); ! Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Save Forces the Jail Database to be saved."); return; } *************** *** 557,568 **** } default: { Kernel.Instance.Network.SendClientNotice(user, "Unknown Command '{0}'", args[0]); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Add <Account> <Length> [<Reason>]' - Jails <Account> and enters the information into the database. <Length> is in hours. <Reason> is optional."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Del <Account>' - Releases <Account> from jail and removes the database entry."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Info <Account>' - Displays jail entry information for <Account>"); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail List' - Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Save' - Forces the Jail Database to be saved."); return; } --- 560,646 ---- } + case "help": + { + if (args.Length < 2) + { + Kernel.Instance.Network.SendClientNotice(user, "Incorrect Arguments: 'Jail Help <Command>'"); + return; + } + + switch (args[1].ToLower()) + { + case "add": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Add <Account> <Length> [<Reason>]", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Adds a new jail database entry for <Account>. The account will"); + Kernel.Instance.Network.SendClientNotice(user, "automatically be jailed ingame."); + Kernel.Instance.Network.SendClientNotice(user, "The release date will be set <Length> hours after the jail"); + Kernel.Instance.Network.SendClientNotice(user, "time, and will automatically released from jail at that time."); + Kernel.Instance.Network.SendClientNotice(user, "The <Reason> argument is saved into the database for all users"); + Kernel.Instance.Network.SendClientNotice(user, "to view. This is optional and can be left out if not desired."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Add myAccount 24", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, " /msg {0} Jail Add myAccount 24 Jailed for bug abuse.", Kernel.Instance.Network.Nickname); + return; + } + + case "del": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Del <Account>", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Deletes the entry for <Account> from the database. The account"); + Kernel.Instance.Network.SendClientNotice(user, "will automatically released ingame."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Del myAccount", Kernel.Instance.Network.Nickname); + return; + } + + case "save": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Save", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Forces the Jail Database to be saved immediately. Unsaved jail"); + Kernel.Instance.Network.SendClientNotice(user, "entries will result in players not being released if the Bot"); + Kernel.Instance.Network.SendClientNotice(user, "is restarted."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Save", Kernel.Instance.Network.Nickname); + return; + } + + case "list": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail List", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Displays a list of all the currently jailed accounts, along with"); + Kernel.Instance.Network.SendClientNotice(user, "their release dates. For more information on a jail entry, use"); + Kernel.Instance.Network.SendClientNotice(user, "Jail Info"); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail List", Kernel.Instance.Network.Nickname); + return; + } + + case "info": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Info <Account>", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Displays information on <Account>'s jail entry."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Info myAccount", Kernel.Instance.Network.Nickname); + return; + } + + default: + { + Kernel.Instance.Network.SendClientNotice(user, "No help is available for this command."); + return; + } + + } + + return; + } + default: { Kernel.Instance.Network.SendClientNotice(user, "Unknown Command '{0}'", args[0]); ! Kernel.Instance.Network.SendClientNotice(user, "Following commands are available to you"); ! Kernel.Instance.Network.SendClientNotice(user, "Use 'Jail Help <command>' for more information"); ! Kernel.Instance.Network.SendClientNotice(user, "------------------------------------------------"); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Add Jails an account."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Del Releases an account from jail."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Info Displays jail entry information"); ! Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Save Forces the Jail Database to be saved."); return; } Index: SphereConnection.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/SphereConnection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SphereConnection.cs 11 Dec 2004 14:19:24 -0000 1.1 --- SphereConnection.cs 24 Dec 2004 01:25:48 -0000 1.2 *************** *** 236,239 **** --- 236,242 ---- Write(new byte[] {1}); + + Thread.Sleep( 500 ); // Pause between login code & password to ensure connection success. + Write(Password); |
From: Iain M. <iai...@us...> - 2004-12-24 00:36:46
|
Update of /cvsroot/bobbot/Bob/Storage/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20194/Storage/Xml Modified Files: XmlUser.cs Log Message: Update? Index: XmlUser.cs =================================================================== RCS file: /cvsroot/bobbot/Bob/Storage/Xml/XmlUser.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlUser.cs 23 Dec 2004 22:56:12 -0000 1.1 --- XmlUser.cs 24 Dec 2004 00:36:36 -0000 1.2 *************** *** 59,63 **** Log.WriteLine("Xml", "Account '{0}' has no password set", m_Name); else ! m_Password = xmlElement["Password"].Value; if(xmlElement["Properties"] != null) --- 59,63 ---- Log.WriteLine("Xml", "Account '{0}' has no password set", m_Name); else ! m_Password = xmlElement["Password"].InnerText; if(xmlElement["Properties"] != null) |
From: Iain M. <iai...@us...> - 2004-12-24 00:23:31
|
Update of /cvsroot/bobbot/Bob/Core/Irc/Messages/Replies In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17540/Core/Irc/Messages/Replies Removed Files: WelcomeRelpy.cs Log Message: Old file. Deleted. --- WelcomeRelpy.cs DELETED --- |