[Bobbot-cvs] Plugins/Sphere/Messages PlayerPunishedMessage.cs,NONE,1.1 ResKillingMessage.cs,NONE,1.1
Status: Alpha
Brought to you by:
iainmckay
From: Mr S. C. <mrs...@us...> - 2005-07-17 21:09:09
|
Update of /cvsroot/bobbot/Plugins/Sphere/Messages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24008/Sphere/Messages Modified Files: HouseKillingMessage.cs SkillNukeMessage.cs Added Files: PlayerPunishedMessage.cs ResKillingMessage.cs Log Message: - Added Accounting.AccountsReader for reading accounts directly from a Sphere Accounts File - Added Accounting.MultiAccountSearch for finding accounts with matching IPs or Passwords. - Added more log messages to find with 'log list' - Added ability o disable Jail and Bans systems by placing '-1' as their database file paths. - Updated Messages from sphere console. Index: SkillNukeMessage.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/Messages/SkillNukeMessage.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SkillNukeMessage.cs 20 Feb 2005 18:41:34 -0000 1.2 --- SkillNukeMessage.cs 17 Jul 2005 21:08:56 -0000 1.3 *************** *** 41,47 **** #region Members ! protected Regex m_Regex = new Regex( @"^([0-9]{2}:[0-9]{2}):\((.+)\)'(.+)' \((.+)\) nukes their (.+) skill from (.+)", RegexOptions.Compiled ); --- 41,52 ---- #region Members ! /* protected Regex m_Regex = new Regex( @"^([0-9]{2}:[0-9]{2}):\((.+)\)'(.+)' \((.+)\) nukes their (.+) skill from (.+)", RegexOptions.Compiled + );*/ + + protected Regex m_Regex = new Regex( + @"^([0-9]{2}:[0-9]{2}):\((.+)\)'(.+)' \((.+)\) nukes 10% from their (.+) skill from (.+)", + RegexOptions.Compiled ); Index: HouseKillingMessage.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/Messages/HouseKillingMessage.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HouseKillingMessage.cs 21 Feb 2005 03:52:11 -0000 1.3 --- HouseKillingMessage.cs 17 Jul 2005 21:08:56 -0000 1.4 *************** *** 42,46 **** protected Regex m_Regex = new Regex( ! @"^([0-9]{2}:[0-9]{2}):\((.+)\)\(Confirmed\) (.+) house killing\? \(Victim=(.+) Uid=(.+) P=(.+) \((.+)\), Aggressor=(.+) Uid=(.+) P=(.+) \((.+)\)\)", RegexOptions.Compiled ); --- 42,46 ---- protected Regex m_Regex = new Regex( ! @"^([0-9]{2}:[0-9]{2}):\((.+)\)\(Confirmed\) (.+) house killing \(Victim=(.+) Uid=(.+) P=(.+) \((.+)\), Aggressor=(.+) Uid=(.+) P=(.+) \((.+)\), DamageFlags=(.+)\)", RegexOptions.Compiled ); *************** *** 57,60 **** --- 57,62 ---- protected string m_AggressorP; + protected string m_DamageFlags; + #endregion *************** *** 103,106 **** --- 105,113 ---- } + public string DamageFlags + { + get { return m_DamageFlags; } + } + #endregion *************** *** 137,140 **** --- 144,149 ---- m_AggressorUid = match.Groups[9].Value; m_AggressorP = String.Format("{0} ({1})", match.Groups[10].Value, match.Groups[11].Value); + + m_DamageFlags = match.Groups[12].Value; } --- NEW FILE: PlayerPunishedMessage.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.Globalization; using System.Text.RegularExpressions; using Bot.Plugins.Sphere; using Bot.Other.Sphere; using Bot.Other.Sphere.Messages; namespace Bot.Plugins.Sphere.Messages { public delegate void PlayerPunishedEventHandler(object sender, PlayerPunishedEventArgs args); /// <summary> /// Summary description for PlayerPunishedMessage. /// </summary> public class PlayerPunishedMessage : BaseMessage { #region Members protected Regex m_Regex = new Regex( @"^([0-9]{2}:[0-9]{2}):\(.+\)(.+) \((.+)\) jails (.+) \((.+)\) for (.+). \(Jailed From: (.+)\)", RegexOptions.Compiled ); //08:43:(msc_punish_system.scp,199)Admin Pilz-e (Pilz-eGM) jails Drake (vaughan) for 72 hours. protected DateTime m_Time; // 1 protected string m_GMName; // 2 protected string m_GMAccount; // 3 protected string m_PlayerName; // 4 protected string m_PlayerAccount; // 5 protected string m_Length; // 6 protected string m_Position; // 7 #endregion #region Public properties /// <summary> /// The time this message was sent. /// </summary> public DateTime Time { get { return m_Time; } } public string GMName { get { return m_GMName; } } public string GMAccount { get { return m_GMAccount; } } public string PlayerName { get { return m_PlayerName; } } public string PlayerAccount { get { return m_PlayerAccount; } } public string Length { get { return m_Length; } } public string Position { get { return m_Position; } } #endregion public PlayerPunishedMessage() { } public override bool CanParse(string message) { if(m_Regex.IsMatch(message)) return true; return false; } public override void Parse(string message) { if(!CanParse(message)) throw new MessageParserException("Cannot parse this message.", message); Match match = m_Regex.Match(message); if(!match.Success) return; m_Time = DateTime.Parse(match.Groups[1].Value); m_GMName = match.Groups[2].Value; m_GMAccount = match.Groups[3].Value; m_PlayerName = match.Groups[4].Value; m_PlayerAccount = match.Groups[5].Value; m_Length = match.Groups[6].Value; m_Position = match.Groups[7].Value; } public override void Notify(SphereConnection server) { server.OnCustomEvent(new PlayerPunishedEventArgs(this)); } } public class PlayerPunishedEventArgs : System.EventArgs { protected PlayerPunishedMessage m_Message; /// <summary> /// Gets the <see cref="Plugin.Messages.PlayerPunishedMessage"/> object of this event. /// </summary> public PlayerPunishedMessage Message { get { return m_Message; } } /// <summary> /// Instanciates the <see cref="PlayerPunishedEventArgs"/> class with a <see cref="PlayerPunishedMessage"/> object. /// </summary> /// <param name="msg"></param> public PlayerPunishedEventArgs(PlayerPunishedMessage msg) { m_Message = msg; } } } --- NEW FILE: ResKillingMessage.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.Globalization; using System.Text.RegularExpressions; using Bot.Plugins.Sphere; using Bot.Other.Sphere; using Bot.Other.Sphere.Messages; namespace Bot.Plugins.Sphere.Messages { public delegate void ResKillingEventHandler(object sender, ResKillingEventArgs args); /// <summary> /// Summary description for ResKillingMessage. /// </summary> public class ResKillingMessage : BaseMessage { #region Members protected Regex m_Regex = new Regex( @"^([0-9]{2}:[0-9]{2}):\((.+)\)(.+) \((.+)\ is jailed for 24 hours for Res-Killing!", RegexOptions.Compiled ); protected DateTime m_Time; protected string m_PlayerName; protected string m_PlayerAccount; #endregion #region Public properties /// <summary> /// The time this message was sent. /// </summary> public DateTime Time { get { return m_Time; } } public string PlayerName { get { return m_PlayerName; } } public string PlayerAccount { get { return m_PlayerAccount; } } #endregion public ResKillingMessage() { } public override bool CanParse(string message) { if(m_Regex.IsMatch(message)) return true; return false; } public override void Parse(string message) { if(!CanParse(message)) throw new MessageParserException("Cannot parse this message.", message); Match match = m_Regex.Match(message); if(!match.Success) return; m_Time = DateTime.Parse(match.Groups[1].Value); m_PlayerName = match.Groups[2].Value; m_PlayerAccount = match.Groups[3].Value; } public override void Notify(SphereConnection server) { server.OnCustomEvent(new ResKillingEventArgs(this)); } } public class ResKillingEventArgs : System.EventArgs { protected ResKillingMessage m_Message; /// <summary> /// Gets the <see cref="Plugin.Messages.ResKillingMessage"/> object of this event. /// </summary> public ResKillingMessage Message { get { return m_Message; } } /// <summary> /// Instanciates the <see cref="ResKillingEventArgs"/> class with a <see cref="ResKillingMessage"/> object. /// </summary> /// <param name="msg"></param> public ResKillingEventArgs(ResKillingMessage msg) { m_Message = msg; } } } |