Problem with Time32

09/08/2010 11:52 -Fáng-#1
I guess this is what I get for copying Impluse's Time packet ><
I'm getting an error in my console saying:

"The last value of Time32.Now was greater than the current value generated during this call. This is likely due to a reset in the 49.71 days period. See [Only registered and activated users can see links. Click Here To Register...] for more information."

It says it way too often. Maybe every few minutes if not every other minute. If you're not familiar with Impluse's time32 packet, this is what it looks like (taken from Impluse's source so it's easier to understand!):

PHP Code:
public struct Time32
    
{
        private 
uint value;
        private static 
uint lastValue;
        private const 
string nowDebug =
            
"The last value of Time32.Now was greater than the current value generated during this call. " +
            
"This is likely due to a reset in the 49.71 days period. " +
            
"See http://msdn.microsoft.com/en-us/library/dd757629(VS.85).aspx for more information.";

        public static 
Time32 Now
        
{
            
get
            
{
                
Time32 current timeGetTime();
                if (
lastValue current.value)
                    throw new 
InvalidOperationException(nowDebug);
                
lastValue current.value;
                return 
current;
            }
        }

        public 
Time32(int Value)
        {
            
value = (uint)Value;
        }
        public 
Time32(uint Value)
        {
            
value = (uint)Value;
        }
        public 
Time32(long Value)
        {
            
value = (uint)Value;
        }

        public 
Time32 AddMilliseconds(int Amount)
        {
            return new 
Time32(this.value Amount);
        }
        public 
Time32 AddSeconds(int Amount)
        {
            return 
AddMilliseconds(Amount 1000);
        }
        public 
Time32 AddMinutes(int Amount)
        {
            return 
AddSeconds(Amount 60);
        }
        public 
Time32 AddHours(int Amount)
        {
            return 
AddMinutes(Amount 60);
        }
        public 
Time32 AddDays(int Amount)
        {
            return 
AddHours(Amount 24);
        }

        public 
override bool Equals(object obj)
        {
            if (
obj is Time32)
                return ((
Time32)obj == this);
            return 
base.Equals(obj);
        }
        public 
override string ToString()
        {
            return 
value.ToString();
        }
        public 
override int GetHashCode()
        {
            return (int)
value;
        }

        public static 
bool operator ==(Time32 t1Time32 t2)
        {
            return (
t1.value == t2.value);
        }
        public static 
bool operator !=(Time32 t1Time32 t2)
        {
            return (
t1.value != t2.value);
        }
        public static 
bool operator >(Time32 t1Time32 t2)
        {
            return (
t1.value t2.value);
        }
        public static 
bool operator <(Time32 t1Time32 t2)
        {
            return (
t1.value t2.value);
        }
        public static 
bool operator >=(Time32 t1Time32 t2)
        {
            return (
t1.value >= t2.value);
        }
        public static 
bool operator <=(Time32 t1Time32 t2)
        {
            return (
t1.value <= t2.value);
        }
        [
DllImport("winmm.dll")]
        public static 
extern Time32 timeGetTime(); 
Help is greatly appreciated! Thank you! =]
Sincerely,
Fang
09/08/2010 12:15 Korvacs#2
Why do you need any of that?
09/08/2010 14:06 ~Master#3
I'm having same problem .
09/08/2010 17:44 _DreadNought_#4
It's not a packet btw.
09/08/2010 17:47 Korvacs#5
Indeed, doesnt have anything packet related in it, but why would you need any of that?
09/08/2010 18:14 -Fáng-#6
I need it because of the miliseconds and seconds. I know that seems stupid but I need it for an event that I'm going to make on my server. I called it a packet because it collects information and executes a function. I'm self taught so give me a break. #00 << If you know what that means in Conquer than good for you =]

EDIT: Wait... I'm being stupid... I can just use DateTime... lol :facepalm: