Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 09-01-2004, 03:49 AM   #1 (permalink)
Forum Newbie
 
Join Date: Apr 2003
Posts: 22
Default Timestamp in Console

Hi all.

I was wondering if it is possible for the next release of RunUO, to have the console timestamp each line, and for this to be of a customisable format?

also it would be very useful to be able to force the client to save, restart and shutdown from the console, instead of logging in via a client.

Perhaps this could be done with a taskbar icon.

I have seen a similar request back from 22/4/2003, but nothing much came of it, so I thought I might post my own request.

thanks all.
Stese is offline   Reply With Quote
Old 09-01-2004, 10:27 AM   #2 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by Stese
Hi all.

I was wondering if it is possible for the next release of RunUO, to have the console timestamp each line, and for this to be of a customisable format?

also it would be very useful to be able to force the client to save, restart and shutdown from the console, instead of logging in via a client.

Perhaps this could be done with a taskbar icon.

I have seen a similar request back from 22/4/2003, but nothing much came of it, so I thought I might post my own request.

thanks all.
Looking forward to your submission
Phantom is offline   Reply With Quote
Old 09-01-2004, 01:31 PM   #3 (permalink)
Forum Newbie
 
Join Date: Apr 2003
Posts: 22
Default

Immensely helpful phantom...

I wouldn't know where to start with coding this.

Since it is in the console, I would assume that it's written into the RunUO.exe file...

Meh i'll have a look, if I create something, i'll post it
Stese is offline   Reply With Quote
Old 09-01-2004, 01:33 PM   #4 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

This is not my code, and I really don't remeber who made it but here it is. It stamps the time on each line of the console.

Code:
using System;
using System.IO;
using System.Text;

namespace System
{
	public class ConsoleHook : TextWriter
	{
		public override Encoding Encoding
		{
			get { return Encoding.ASCII; }
		}

		private string Timestamp
		{
			get { return String.Format( "{0:D2}/{1:D2}-{2:D2}:{3:D2} ",DateTime.Now.Day,DateTime.Now.Month,DateTime.Now.Hour,DateTime.Now.Minute ); }
		}

		private static Stream m_OldOutput;
		private static bool m_Newline;

		public static void Initialize()
		{
			m_OldOutput = Console.OpenStandardOutput();
			Console.SetOut( new ConsoleHook() );
			m_Newline = true;
		}

		public override void WriteLine( string value )
		{
			if ( m_Newline )
			{
				value = Timestamp + value;
			}

			byte[] data = Encoding.GetBytes( value );
			m_OldOutput.Write( data,0,data.Length );
			m_OldOutput.WriteByte( 10 );
			m_Newline = true;
		}

		public override void Write( string value )
		{
			if ( m_Newline )
			{
				value = Timestamp + value;
			}

			byte[] data = Encoding.GetBytes( value );
			m_OldOutput.Write( data,0,data.Length );
			m_Newline = false;
		}
	}
}
Atomic is offline   Reply With Quote
Old 09-01-2004, 01:50 PM   #5 (permalink)
Forum Newbie
 
Join Date: Apr 2003
Posts: 22
Default

Ohh thankies!
Stese is offline   Reply With Quote
Old 09-01-2004, 02:07 PM   #6 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by Stese
Immensely helpful phantom...

I wouldn't know where to start with coding this.

Since it is in the console, I would assume that it's written into the RunUO.exe file...

Meh i'll have a look, if I create something, i'll post it
No reason you can't learn how to do it.

But my statment still is valid,
Phantom is offline   Reply With Quote
Old 09-04-2004, 11:49 PM   #7 (permalink)
 
Join Date: Feb 2003
Posts: 269
Default Here you go

Bankstone complete with bank,withdraw and balance commands
thegrandmystic is offline   Reply With Quote
Old 09-05-2004, 06:02 PM   #8 (permalink)
Forum Newbie
 
Join Date: Apr 2003
Posts: 22
Default hmm

Funny, I know that poster well... he's me!
Stese is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5