jtuu / tethealla-cherry

Cherry-flavored Tethealla
GNU General Public License v3.0
0 stars 1 forks source link

.beat time off, time always 00:00 at start of game #1

Open PalasX opened 3 years ago

PalasX commented 3 years ago

It looks like the call to servertime() fails somehow? or always return 00:00. this causes all games to start around .beat time 670 or so.

I cannot for the life of me figure out how to fix this in the ship_server source. Any suggestions?

compiled and running server on a raspberry pi 3

jtuu commented 3 years ago

It's because SendB1 in login is stubbed out. I'm not planning on fixing it. Maybe send this issue upstream?

PalasX commented 3 years ago

hey, gives me a place to start looking to impliment a fix :) THANKS!

PalasX commented 3 years ago

I have no idea how to make a pull request in github. so im just dumping the code here. This is for login_server.c @ line 1388. This will give the client the correct .BEAT time, though it still shows "00:00" for the normal time and counts up from there noce connected. I'll keep digging to repair that.

//FIXME: Dummied out time stuff
void SendB1 (BANANA* client)
{
//  SYSTEMTIME rawtime;
    time_t rawtime;

  if ((client->guildcard) && (client->slotnum != -1))
  {
//    GetSystemTime (&rawtime);
    rawtime = time(NULL);
    struct tm tm = *localtime(&rawtime);

    *(int64_t*) &client->encryptbuf[0] = *(int64_t*) &PacketB1[0];
    memset (&client->encryptbuf[0x08], 0, 28);
//    sprintf (&client->encryptbuf[8], "%u:%02u:%02u: %02u:%02u:%02u.%03u", rawtime.wYear, rawtime.wMonth, rawtime.wDay,
//      rawtime.wHour, rawtime.wMinute, rawtime.wSecond, rawtime.wMilliseconds );
    sprintf (&client->encryptbuf[8], "%u:%02u:%02u: %02u:%02u:%02u.%03u", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.t$
    cipher_ptr = &client->server_cipher;
    encryptcopy (client, &client->encryptbuf[0], 0x24 );
  }
  else
    client->todc = 1;
}

I think that 00:00 that shows before the internet beat time on the menu in game MIGHT be for current playtime this session, and not for "what time is it in normal time on the server". In which case, its working normally.

jtuu commented 3 years ago

You should use gmtime instead of localtime to get the correct time since .beat doesn't have time zones. Also one of your lines is cut off. You're correct about the other number being the duration of the current session.

You can create a pull request by forking this project and after you push commits to your fork there should be a button to create a new pull request somewhere in the web UI.

PalasX commented 3 years ago

oh lord, it must have cut off because i copied and pasted it out of the terminal window :) WHOOPS!

Thanks for the heads up on gmtime, i forgot about timezones. i should have a pull request coming your way in a few minutes. and i guess that goes up to theodis as well somwhow?

i have also added a handful of /commands to the ship server, just for showing and resetting material usage for now. i'll try to do a seperate pull request for those after i add /modname and /modsectionid.

also, thanks for even getting back to me after so long!

jtuu commented 3 years ago

Hey, no problem. I'm always happy to talk about PSO dev stuff but it's just that this particular project is not a high priority for me right now. If you'd like to get these changes merged to the original project you should send a pull request to Theodis on Gitlab and then I can pull the changes down to here.

PalasX commented 3 years ago

No worries! It probably shouldn't be getting as much of my time as it does anyway either, heh.

Thanks for the suggestion, I'll see about doing the pull on gitlab. Hope you get a chane to do some pso dev'ing on something soon :)

On Fri, Jun 4, 2021, 7:45 PM jtuu @.***> wrote:

Hey, no problem. I'm always happy to talk about PSO dev stuff but it's just that this particular project is not a high priority for me right now. If you'd like to get these changes merged to the original project you should send a pull request to Theodis on Gitlab and then I can pull the changes down to here.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jtuu/tethealla-cherry/issues/1#issuecomment-855129586, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI3PBFRRLAOTRMBNL5LMMRLTRFQTNANCNFSM4XDTPBXA .