Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: loked on December 05, 2014, 12:36:51 am

Title: [Question] Time multiplicator
Post by: loked on December 05, 2014, 12:36:51 am
Hi everybody! I'm there because I've a important question for my 3.3.5 Trinity server.

For more cycles of days and nights, I want an accelerated time but I have no idea where and how can I change this. If anyone has any information to help me, that would be awesome.

P.S. : Sorry if my english is bad.
Title: Re: [Question] Time multiplicator
Post by: kojak488 on December 06, 2014, 03:58:29 am
My previous research indicates it's hardcoded into the client.  You can change the time the sun and moon rise and set, but not accelerate it per se.
Title: Re: [Question] Time multiplicator
Post by: Amaroth on December 06, 2014, 11:38:04 am
Fuh, really? Game time is taken from server and server takes it from its machine's system time. You might want to look at that. But don't ask where will you find this in core, I am no core developer.
Title: Re: [Question] Time multiplicator
Post by: Eatos on December 06, 2014, 12:39:14 pm
SMSG_LOGIN_SETTIMESPEED - controls timespeed of game, server time.
See where it is handled in emulator and add value to it
WorldPacket data(SMSG_LOGIN_SETTIMESPEED, 4+4+4);
data << uint32( MAKE_GAME_TIME() );
data << float(0.0166666669777748f) * 2.0f   // Makes Normal Game Speed x2 faster
data << uint32(0);   // 3.1.2
Title: Re: [Question] Time multiplicator
Post by: loked on December 06, 2014, 04:59:47 pm
Thanks Eatos! This is run and work really nice.

But, now I've a new problem...when a player connects, the game time start with local time. Is there a specific value for change it? If you have an idea.

I think what I search is in World.cpp or not?
Title: Re: [Question] Time multiplicator
Post by: kojak488 on December 06, 2014, 08:40:41 pm
Quote from: "Eatos"
SMSG_LOGIN_SETTIMESPEED - controls timespeed of game, server time.
See where it is handled in emulator and add value to it
WorldPacket data(SMSG_LOGIN_SETTIMESPEED, 4+4+4);
data << uint32( MAKE_GAME_TIME() );
data << float(0.0166666669777748f) * 2.0f   // Makes Normal Game Speed x2 faster
data << uint32(0);   // 3.1.2

Can't wait to compile and try this.  If it works, then I love you long time.
Title: Re: [Question] Time multiplicator
Post by: stoneharry on December 10, 2014, 01:54:44 pm
Quote from: "Eatos"
SMSG_LOGIN_SETTIMESPEED - controls timespeed of game, server time.
See where it is handled in emulator and add value to it
WorldPacket data(SMSG_LOGIN_SETTIMESPEED, 4+4+4);
data << uint32( MAKE_GAME_TIME() );
data << float(0.0166666669777748f) * 2.0f   // Makes Normal Game Speed x2 faster
data << uint32(0);   // 3.1.2

This works, e.g: my code for 20 minute day starting at 7am:

Code: [Select]
-- Set time to 7am
local p = CreatePacket(66, 12)
p:WriteULong(GetHungerGamesInitialTime()) -- time
p:WriteFloat(1.20000024) -- speed
p:WriteULong(0)
count = count + 1
rPlr:SendPacket(p)
Title: Re: [Question] Time multiplicator
Post by: kojak488 on December 13, 2014, 04:27:46 am
What bugs does it give you?  Someone earlier indicated a bug that would allow different players to be at different times of day depending on when they logged in as it goes out of sync.