Пример #1
0
 public static void PluginText(StringBuilder sb, Plugin pl, BinLogFlags flags, int fileid)
 {
     if (HasFlag(flags, BinLogFlags.Show_PlugId) &&
         HasFlag(flags, BinLogFlags.Show_PlugFile))
     {
         sb.Append("\"");
         sb.Append(pl.File);
         if (pl.IsDebug())
         {
             sb.Append(", ");
             sb.Append(pl.FindFile(fileid));
         }
         sb.Append("\"");
         sb.Append(" (");
         sb.Append(pl.Index);
         sb.Append(")");
     }
     else if (HasFlag(flags, BinLogFlags.Show_PlugId))
     {
         sb.Append(pl.Index);
     }
     else if (HasFlag(flags, BinLogFlags.Show_PlugFile))
     {
         sb.Append("\"");
         sb.Append(pl.File);
         if (pl.IsDebug())
         {
             sb.Append(", ");
             sb.Append(pl.FindFile(fileid));
         }
         sb.Append("\"");
     }
 }
Пример #2
0
		public static void PluginText(StringBuilder sb, Plugin pl, BinLogFlags flags, int fileid)
		{
			if (HasFlag(flags, BinLogFlags.Show_PlugId)
				&& HasFlag(flags, BinLogFlags.Show_PlugFile))
			{
				sb.Append("\"");
				sb.Append(pl.File);
				if (pl.IsDebug())
				{
					sb.Append(", ");
					sb.Append(pl.FindFile(fileid));
				}
				sb.Append("\"");
				sb.Append(" (");
				sb.Append(pl.Index);
				sb.Append(")");
			} 
			else if (HasFlag(flags, BinLogFlags.Show_PlugId))
			{
				sb.Append(pl.Index);
			} 
			else if (HasFlag(flags, BinLogFlags.Show_PlugFile))
			{
				sb.Append("\"");
				sb.Append(pl.File);
				if (pl.IsDebug())
				{
					sb.Append(", ");
					sb.Append(pl.FindFile(fileid));
				}
				sb.Append("\"");
			}
		}
Пример #3
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Plugin ");
     BinLogEntry.PluginText(sb, plugin, flags, fileid);
     sb.Append(" hit line ");
     sb.Append(Line);
     sb.Append(".");
 }
Пример #4
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Plugin ");
     BinLogEntry.PluginText(sb, plugin, flags, fileid);
     sb.Append(" had public function \"");
     sb.Append(Public);
     sb.Append("\" (");
     sb.Append(pubidx);
     sb.Append(") called.");
 }
Пример #5
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Retrieving string (addr ");
     sb.AppendFormat("0x{0:X}", address);
     sb.Append(") from Plugin ");
     BinLogEntry.PluginText(sb, plugin, flags);
     sb.Append(".  String:");
     sb.Append("\n\t ");
     sb.Append(text);
 }
Пример #6
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Plugin ");
     BinLogEntry.PluginText(sb, pl, flags);
     sb.Append(" registered as (\"");
     sb.Append(_title);
     sb.Append("\", \"");
     sb.Append(_version);
     sb.Append("\")");
 }
Пример #7
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Plugin ");
     BinLogEntry.PluginText(sb, pl, flags);
     sb.Append(" formatted parameter ");
     sb.Append(parm);
     sb.Append(" (maxlen ");
     sb.Append(maxlen);
     sb.Append("), result: \n\t");
     sb.Append(text);
 }
Пример #8
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Setting string (addr ");
     sb.Append(address);
     sb.Append(") (maxlen ");
     sb.Append(maxlen);
     sb.Append(") from Plugin ");
     BinLogEntry.PluginText(sb, plugin, flags);
     sb.Append(".  String:");
     sb.Append("\n\t ");
     sb.Append(text);
 }
Пример #9
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Plugin ");
     BinLogEntry.PluginText(sb, plugin, flags, fileid);
     sb.Append(" called native \"");
     sb.Append(Native);
     sb.Append("\" (");
     sb.Append(nativeidx);
     sb.Append(") with ");
     sb.Append(numparams);
     sb.Append(" parameters.");
 }
Пример #10
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Native parameters: (");
     if (plist != null)
     {
         for (int i = 0; i < plist.Count; i++)
         {
             sb.Append(plist[i].ToString());
             if (i < plist.Count - 1)
             {
                 sb.Append(", ");
             }
         }
     }
     sb.Append(")");
 }
Пример #11
0
        private void UpdateViews(ViewAreas v, BinLogFlags b)
        {
            ClearViews(v);

            if (v == ViewAreas.Update_All ||
                ((v & ViewAreas.Update_Plugins) == ViewAreas.Update_Plugins) &&
                (binlog.GetPluginDB() != null))
            {
                PluginDb plugdb = binlog.GetPluginDB();
                PluginList.View = View.Details;
                PluginList.Columns.Add("Number", 60, HorizontalAlignment.Left);
                PluginList.Columns.Add("File", 100, HorizontalAlignment.Left);
                PluginList.Columns.Add("Title", 120, HorizontalAlignment.Left);
                PluginList.Columns.Add("Version", 60, HorizontalAlignment.Left);
                PluginList.Columns.Add("Status", 60, HorizontalAlignment.Left);

                int            num   = plugdb.Count;
                ListViewItem[] items = new ListViewItem[num];
                for (int i = 0; i < num; i++)
                {
                    Plugin       pl   = plugdb.GetPluginById(i);
                    ListViewItem item = new ListViewItem(i.ToString());
                    item.SubItems.Add(pl.File);
                    item.SubItems.Add(pl.Title);
                    item.SubItems.Add(pl.Version);
                    item.SubItems.Add(pl.Status);
                    items[i] = item;
                }
                PluginList.Items.AddRange(items);
            }
            if (v == ViewAreas.Update_Text ||
                ((v & ViewAreas.Update_Text) == ViewAreas.Update_Text) &&
                (binlog != null))
            {
                ArrayList     al = binlog.OpList;
                BinLogEntry   ble;
                StringBuilder sb    = new StringBuilder(al.Count * 10);
                BinLogFlags   flags = (BinLogFlags.Show_GameTime | BinLogFlags.Show_PlugFile | BinLogFlags.Show_PlugId);
                for (int i = 0; i < al.Count; i++)
                {
                    ble = (BinLogEntry)al[i];
                    BinLogEntry.BinLogString(sb, ble, flags);
                    sb.Append("\n");
                }
                TextLog.Text = sb.ToString();
            }
        }
Пример #12
0
		public static void PluginText(StringBuilder sb, Plugin pl, BinLogFlags flags)
		{
			if (HasFlag(flags, BinLogFlags.Show_PlugId)
				&& HasFlag(flags, BinLogFlags.Show_PlugFile))
			{
				sb.Append("\"");
				sb.Append(pl.File);
				sb.Append("\"");
				sb.Append(" (");
				sb.Append(pl.Index);
				sb.Append(")");
			} 
			else if (HasFlag(flags, BinLogFlags.Show_PlugId))
			{
				sb.Append(pl.Index);
			} 
			else if (HasFlag(flags, BinLogFlags.Show_PlugFile))
			{
				sb.Append("\"");
				sb.Append(pl.File);
				sb.Append("\"");
			}
		}
Пример #13
0
        public override void ToLogString(StringBuilder sb, BinLogFlags flags)
        {
            switch (my_op)
            {
            case BinLogOp.BinLog_Start:
            {
                sb.Append("Binary log started.");
                break;
            }

            case BinLogOp.BinLog_End:
            {
                sb.Append("Binary log ended.");
                break;
            }

            case BinLogOp.BinLog_Invalid:
            {
                sb.Append("Binary log corrupt past this point.");
                break;
            }
            }
        }
Пример #14
0
 public static void PluginText(StringBuilder sb, Plugin pl, BinLogFlags flags)
 {
     if (HasFlag(flags, BinLogFlags.Show_PlugId) &&
         HasFlag(flags, BinLogFlags.Show_PlugFile))
     {
         sb.Append("\"");
         sb.Append(pl.File);
         sb.Append("\"");
         sb.Append(" (");
         sb.Append(pl.Index);
         sb.Append(")");
     }
     else if (HasFlag(flags, BinLogFlags.Show_PlugId))
     {
         sb.Append(pl.Index);
     }
     else if (HasFlag(flags, BinLogFlags.Show_PlugFile))
     {
         sb.Append("\"");
         sb.Append(pl.File);
         sb.Append("\"");
     }
 }
Пример #15
0
        public static void BinLogString(StringBuilder sb, BinLogEntry ble, BinLogFlags flags)
        {
            bool realtime = false;

            if (HasFlag(flags, BinLogFlags.Show_RealTime))
            {
                sb.Append(ble.realtime.ToString());
                realtime = true;
            }
            if (HasFlag(flags, BinLogFlags.Show_GameTime))
            {
                if (realtime)
                {
                    sb.Append(", ");
                    sb.Append(ble.gametime.ToString());
                }
                else
                {
                    sb.Append(ble.gametime.ToString());
                }
            }
            sb.Append(": ");
            ble.ToLogString(sb, flags);
        }
Пример #16
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Setting string (addr ");
			sb.Append(address);
			sb.Append(") (maxlen ");
			sb.Append(maxlen);
			sb.Append(") from Plugin ");
			BinLogEntry.PluginText(sb, plugin, flags);
			sb.Append(".  String:");
			sb.Append("\n\t ");
			sb.Append(text);
		}
Пример #17
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Plugin ");
			BinLogEntry.PluginText(sb, plugin, flags, fileid);
			sb.Append(" had public function \"");
			sb.Append(Public);
			sb.Append("\" (");
			sb.Append(pubidx);
			sb.Append(") called.");
		}
Пример #18
0
 public static bool HasFlag(BinLogFlags a, BinLogFlags b)
 {
     return((a & b) == b);
 }
Пример #19
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Retrieving string (addr ");
			sb.AppendFormat("0x{0:X}", address);
			sb.Append(") from Plugin ");
			BinLogEntry.PluginText(sb, plugin, flags);
			sb.Append(".  String:");
			sb.Append("\n\t ");
			sb.Append(text);
		}
Пример #20
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Plugin ");
			BinLogEntry.PluginText(sb, plugin, flags, fileid);
			sb.Append(" called native \"");
			sb.Append(Native); 
			sb.Append("\" (");
			sb.Append(nativeidx);
			sb.Append(") with ");
			sb.Append(numparams);
			sb.Append(" parameters.");
		}
Пример #21
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Native returned: ");
			sb.Append(returnval);
		}
Пример #22
0
 public override void ToLogString(StringBuilder sb, BinLogFlags flags)
 {
     sb.Append("Native returned: ");
     sb.Append(returnval);
 }
Пример #23
0
		public abstract void ToLogString(StringBuilder sb, BinLogFlags flags);
Пример #24
0
		public static bool HasFlag(BinLogFlags a, BinLogFlags b)
		{
			return ( (a & b) == b );
		}
Пример #25
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Native parameters: (");
			if (plist != null)
			{
				for (int i=0; i<plist.Count; i++)
				{
					sb.Append(plist[i].ToString());
					if (i < plist.Count - 1)
						sb.Append(", ");
				}
			}
			sb.Append(")");
		}
Пример #26
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Plugin ");
			BinLogEntry.PluginText(sb, pl, flags);
			sb.Append(" formatted parameter ");
			sb.Append(parm);
			sb.Append(" (maxlen ");
			sb.Append(maxlen);
			sb.Append("), result: \n\t");
			sb.Append(text);
		}
Пример #27
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Plugin "); 
			BinLogEntry.PluginText(sb, pl, flags);
			sb.Append(" registered as (\"");
			sb.Append(_title);
			sb.Append("\", \"");
			sb.Append(_version);
			sb.Append("\")");
		}
Пример #28
0
 public abstract void ToLogString(StringBuilder sb, BinLogFlags flags);
Пример #29
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			sb.Append("Plugin ");
			BinLogEntry.PluginText(sb, plugin, flags, fileid);
			sb.Append(" hit line ");
			sb.Append(Line);
			sb.Append(".");
		}
Пример #30
0
		public override void ToLogString(StringBuilder sb, BinLogFlags flags)
		{
			switch (my_op)
			{
				case BinLogOp.BinLog_Start:
				{
					sb.Append("Binary log started.");
					break;
				}
				case BinLogOp.BinLog_End:
				{
					sb.Append("Binary log ended.");
					break;
				}
				case BinLogOp.BinLog_Invalid:
				{
					sb.Append("Binary log corrupt past this point.");
					break;
				}
			}
		}
Пример #31
0
		public static void BinLogString(StringBuilder sb, BinLogEntry ble, BinLogFlags flags)
		{
			bool realtime = false;
			if (HasFlag(flags, BinLogFlags.Show_RealTime))
			{
				sb.Append(ble.realtime.ToString());
				realtime = true;
			}
			if (HasFlag(flags, BinLogFlags.Show_GameTime))
			{
				if (realtime)
				{
					sb.Append(", ");
					sb.Append(ble.gametime.ToString());
				}
				else
				{
					sb.Append(ble.gametime.ToString());
				}
			}
			sb.Append(": ");
			ble.ToLogString(sb, flags);
		}
Пример #32
0
		private void UpdateViews(ViewAreas v, BinLogFlags b)
		{
			ClearViews(v);

			if (v == ViewAreas.Update_All || 
				((v & ViewAreas.Update_Plugins) == ViewAreas.Update_Plugins)
				&& (binlog.GetPluginDB() != null))
			{
				PluginDb plugdb = binlog.GetPluginDB();
				PluginList.View = View.Details;
				PluginList.Columns.Add("Number", 60, HorizontalAlignment.Left);
				PluginList.Columns.Add("File", 100, HorizontalAlignment.Left);
				PluginList.Columns.Add("Title", 120, HorizontalAlignment.Left);
				PluginList.Columns.Add("Version", 60, HorizontalAlignment.Left);
				PluginList.Columns.Add("Status", 60, HorizontalAlignment.Left);

				int num = plugdb.Count;
				ListViewItem[] items = new ListViewItem[num];
				for (int i=0; i<num; i++)
				{
					Plugin pl = plugdb.GetPluginById(i);
					ListViewItem item = new ListViewItem(i.ToString());
					item.SubItems.Add(pl.File);
					item.SubItems.Add(pl.Title);
					item.SubItems.Add(pl.Version);
					item.SubItems.Add(pl.Status);
					items[i] = item;
				}
				PluginList.Items.AddRange(items);
			}
			if (v == ViewAreas.Update_Text || 
				((v & ViewAreas.Update_Text) == ViewAreas.Update_Text)
				&& (binlog != null))
			{
				ArrayList al = binlog.OpList;
				BinLogEntry ble;
				StringBuilder sb = new StringBuilder(al.Count * 10);
				BinLogFlags flags = (BinLogFlags.Show_GameTime | BinLogFlags.Show_PlugFile | BinLogFlags.Show_PlugId);
				for (int i=0; i<al.Count; i++)
				{
					ble = (BinLogEntry)al[i];
					BinLogEntry.BinLogString(sb, ble, flags);
					sb.Append("\n");
				}
				TextLog.Text = sb.ToString();
			}
		}