Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers  (Read 5661 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile

Pretty much self-explanatory. CampaignClockAPI's getElapsedDaysSince(time) returns a float, but for some reason it's only ever a whole number (as in it jumps directly from 118.0 to 119.0).

Is it supposed to be accurate to less than a day, or should this method return an int instead?
Logged

RoseLinda

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #1 on: August 20, 2012, 04:49:59 AM »

According to me this should return an int,well if still you not able to fix you problem better Google it,well if it jumps from 118.0 to 119.0 then whats wrong with this,don't you think Answer is correct.
<link removed>
« Last Edit: August 20, 2012, 07:04:18 AM by Alex »
Logged

Upgradecap

  • Admiral
  • *****
  • Posts: 5422
  • CEO of the TimCORP
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #2 on: August 20, 2012, 05:06:47 AM »

According to me this should return an int,well if still you not able to fix you problem better Google it,well if it jumps from 118.0 to 119.0 then whats wrong with this,don't you think Answer is correct.
<link removed> -- SeaBee

Whatisthisidon'teven.jpg

I'm confused. A somewhat legit answer mixed with an ad, hmmm...
« Last Edit: August 20, 2012, 09:47:21 AM by SeaBee »
Logged

arcibalde

  • Admiral
  • *****
  • Posts: 1730
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #3 on: August 20, 2012, 05:13:37 AM »

Bots get smarter and smarter!
Logged
Creator of:
Relics MOD - vanilla balanced - Campaign integrated
Vanilla addon MOD - vanilla balanced - Campaign integrated
Project ONI MOD - mission only

Faiter119

  • Admiral
  • *****
  • Posts: 1402
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #4 on: August 20, 2012, 05:15:23 AM »

According to me this should return an int,well if still you not able to fix you problem better Google it,well if it jumps from 118.0 to 119.0 then whats wrong with this,don't you think Answer is correct.
<link removed> -- SeaBee

Dafuq? What is the deal with that ad?
« Last Edit: August 20, 2012, 09:47:51 AM by SeaBee »
Logged

Upgradecap

  • Admiral
  • *****
  • Posts: 5422
  • CEO of the TimCORP
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #5 on: August 20, 2012, 05:20:06 AM »


Well, considering the user who posted that ad (or bot?) went offline precisely 11 minutes and 6 seconds after registering, i can probably say that it is an bot. Goddamn them all.



According to me this should return an int,well if still you not able to fix you problem better Google it,well if it jumps from 118.0 to 119.0 then whats wrong with this,don't you think Answer is correct.

Alot of spelling errors too, for example i have bolted those parts out.

1st bolt: He states that according to him, it should return a int. This may or may not be true, as i have not alot of experience in this field.

2nd bolt: He says that if LW still can't fix his problems, he should google it, denying that his answer of it returning an int is correct.

3rd bolt: He asks what the problem is with it jumping from 118 to 119 is, despite LW clearly stating his problems and issues.

4th bolt: He says: "don't you think answer is correct." well, his only answer was to say that he should google his problem.

based on that evidence and fact, i can only presume it is an bot.
« Last Edit: August 20, 2012, 05:25:14 AM by Upgradecap »
Logged

Faiter119

  • Admiral
  • *****
  • Posts: 1402
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #6 on: August 20, 2012, 05:27:12 AM »

Forum needs some security against those. But I guess banning them kinda helps.
Logged

Upgradecap

  • Admiral
  • *****
  • Posts: 5422
  • CEO of the TimCORP
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #7 on: August 20, 2012, 05:30:20 AM »

Forum needs some security against those. But I guess banning them kinda helps.

Range ban on them, perhaps?
Logged

Faiter119

  • Admiral
  • *****
  • Posts: 1402
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #8 on: August 20, 2012, 05:33:03 AM »

Forum needs some security against those. But I guess banning them kinda helps.

Range ban on them, perhaps?

Bots like that usually gets banned and gets their posts removed within a short timespan. Not sure how to prevent bots, maybe a recaptcha or something at the registration.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: CampaignClockAPI.getElapsedDaysSince() only returns whole numbers
« Reply #9 on: August 20, 2012, 07:55:47 AM »

Pretty much self-explanatory. CampaignClockAPI's getElapsedDaysSince(time) returns a float, but for some reason it's only ever a whole number (as in it jumps directly from 118.0 to 119.0).

Is it supposed to be accurate to less than a day, or should this method return an int instead?

Should be more accurate - forgot a few casts in there. Thanks for reporting it - fixed.
Logged