topaz-next / topaz

💎 A server emulator for Final Fantasy XI.
GNU General Public License v3.0
56 stars 81 forks source link

Using os.date("%j") for "after midnight" checks has slim-but-possible chance to fail, exactly 1 year later #2532

Closed Gradius2 closed 3 years ago

Gradius2 commented 3 years ago

Additional Information (Steps to reproduce/Expected behavior) :

Well, I'm on Dawn (PM8-4).

After I killed Promathia-the-weaker I did get Tear of Altana (key item), BUT...

It says to wait "Japanese Midnight", before to continue with the CSes.

Well, I went to sleep, I know perfectly well when J.M. is (yes, real time), of course I had to shutdown my computer. Then when I decided to check (after over 16 hours IRL) I still didn't get any CS. Then I decided to use !time command. I used well over 24 hours (realtime world) to the game, and I'm still unable to get any CS.

What now? Another bug?

wrenffxi commented 3 years ago

When you get the key item, a charVar "Promathia_kill_day" is saved with the server's current day.

The next set of cutscenes all check the server's current day to see if it's different from the day stored in your "Promathia_kill_day" variable.

So rather than "JP midnight" the quest should let you progress at your local midnight. Did your initial 16-hour wait cross midnight?

If you want to skip the wait, the simplest way is to change the value of your variable. For example !setplayervar gradius Promathia_kill_day 1

I'm not certain what the !time command does under the hood, so I can't speak to that.

Gradius2 commented 3 years ago

"Did your initial 16-hour wait cross midnight?" Yes. I have to shutdown the server though. I just my desktop, playing for fun, and trying to catch/fix bugs.

As for Promathia_kill_day I have 29 on my DB.

PromathiaStatus is 3.

Promathia_CID_timer as 337.

As for !time means !time ahead (1 = 2.4s on game). If negative (-) is added, it goes back on time.

cocosolos commented 3 years ago

The !time command moves the current Vana'diel time, and has no effect on anything relying on real life time. It is also extremely experimental and the client does not like when you change the time (though it does have its uses for testing/screenshots).

cocosolos commented 3 years ago

Promathia_kill_day is the day of the year, local time, that you finished the BCNM. This is incorrect and should be adjusted for JP time, but you can change it to 28 or wait till its Jan 30 in your time zone.

wrenffxi commented 3 years ago

As for Promathia_kill_day I have 29 on my DB

Okay, so changing it to 1 should let you continue. However, this implementation is problematic, if it's only storing the day-of-the-month. Because if someone get the KI on the 15th of Jan, then attempts to do the next step of the quest on the 15th of Feb, it won't progress them.

Edit to add: coco points out that it's checking day of the year rather than day of the month. That's better but still (extremely unlikely but possible) problematic.

Thanks for the heads up!

Gradius2 commented 3 years ago

!setplayervar gradius Promathia_kill_day 1 did the trick.

But yeah, I new approach should be used.

Gradius2 commented 3 years ago

After doing every CS, until Mhaura, everything is fine.

Now when I go to Ru'Lude Gardens, and "approach the palace for a cutscene"... nothing happens.

Zoned, logged off, etc. No CS. This is the last CS before the rings (Rajas or Sattva or Tamas).

Gradius2 commented 3 years ago

After restarting the server, I'm getting: [Warning] SmallPacket0x03C instead that CS.

3C = 60

EpicTaru commented 3 years ago

@Gradius2, stupid question because I've had multiple people forget to do this (myself included, hence why I REALLY never forget it now) but did you return back to the old lady in South Sandy after the cutscene in Uleg? Soooooo many people forget to and it is a required step.

Screenshot_20210130-075623_Chrome

Gradius2 commented 3 years ago

Hi,

Yes, I did that part too. I wonder what is missing.

wrenffxi commented 3 years ago

Here you can see the charVars that are checked for this cutscene. https://github.com/topaz-next/topaz/blob/50de651768a6a259656af6c16937461a45e2653a/scripts/zones/RuLude_Gardens/Zone.lua#L55-L63

Use !checkvar command, e.g. !checkvar gradius COP_3-taru_story, to check each of these 5 variables. The one that doesn't match the checked value indicates the step you're not credited with.

Gradius2 commented 3 years ago

Thanks for pointing that out.

louverance was 1 for some reason, but I did got all those CSs (checked more than once for that guy).

Pretty strange. Now is fixed.

Btw, I'm now totally naked, in full glory on CSs. So funny. 💯

Nostalgia note: I beat CoP around 2004 or 2005, when the cap was 75. Man, it was really hard on those days, and took like a month to complete, and I don't recall how many millions (gil) on preparations. Bahamut fight (storm of fate) took another month to gather the people (alliance). That fight was really fun.

Anyway, thanks wrenffxi.