Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Immortal Idle Timeout

Immortal Idle Timeout

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Nexela   USA  (14 posts)  Bio
Date Fri 31 Jan 2003 03:40 AM (UTC)
Message
ok being fairly new to coding I gues Ill post my question here and let you guys do all the work *duck* errr I mean thanks for all help I get

ok Heres my dilema Running Smaug 1.4a Cygwin source and I want to stop the server from disconnecting Immortals I think I have narrowed it down to this bit of code in Comm.c

if ( (!d->character && d->idle > 360) /* 2 mins */
|| ( d->connected != CON_PLAYING && d->idle > 1200) /* 5 mins */
|| d->idle > 28800 ) /* 2 hrs */
{
write_to_descriptor( d->descriptor,
"Idle timeout... disconnecting.\n\r", 0 );
d->outtop = 0;
close_socket( d, TRUE );
continue;
}


how would rewrite that so It doesnt dissconnect Immortals?

wait! wait! I didnt want to format!
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 31 Jan 2003 04:51 AM (UTC)
Message

if ( (!d->character && d->idle > 360)	/* 2 mins */
|| ( d->connected != CON_PLAYING && d->idle > 1200) /* 5 mins */
|| d->idle > 28800 )	/* 2 hrs */
if (d->character && d->character->level < LEVEL_IMMORTAL)
  { 
  write_to_descriptor( d->descriptor,
           "Idle timeout... disconnecting.\n\r", 0 );
  d->outtop	= 0;
  close_socket( d, TRUE );
  continue;
  }


New line in bold.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #2 on Fri 31 Jan 2003 05:19 AM (UTC)
Message
Hey, I tried to insert that into the code, and boy... it put a terrible horrible lag on the executable. i couldn't even log in. it would load my character after about a minute and a half then it wouldn't do anything else. any thoughts? and did it happen to the first person who wrote this subject?

Ithildin

i took that line back out and it ran fine
Top

Posted by Nexela   USA  (14 posts)  Bio
Date Reply #3 on Fri 31 Jan 2003 05:37 AM (UTC)
Message
The first time I rebooted with this change it was a lil slower then usual but after that reboots and restarts are back up to there normal speed for me.

Didnt test the timeout yet though but I have a feeling it will work I'll be sure to let ya know sometime tommorow

wait! wait! I didnt want to format!
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Fri 31 Jan 2003 10:17 PM (UTC)

Amended on Fri 31 Jan 2003 10:21 PM (UTC) by Nick Gammon

Message
Whoops! Sorry, didn't notice it was a nested IF. Try this variation ...



if ( ((!d->character && d->idle > 360)	/* 2 mins */
|| ( d->connected != CON_PLAYING && d->idle > 1200) /* 5 mins */
|| d->idle > 28800 )	/* 2 hrs */
/* allow imms to stay on indefinitely */
&& !(d->character && d->character->level >= LEVEL_IMMORTAL)
  )
  { 
  write_to_descriptor( d->descriptor,
           "Idle timeout... disconnecting.\n\r", 0 );
  d->outtop	= 0;
  close_socket( d, TRUE );
  continue;
  }



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nexela   USA  (14 posts)  Bio
Date Reply #5 on Sat 01 Feb 2003 03:56 AM (UTC)
Message
Thanks for the help Nick worked like a charm the second time around.. maybe I wont ask questions when Im half alseep :P

wait! wait! I didnt want to format!
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #6 on Sun 16 Oct 2005 09:07 PM (UTC)
Message
when putting this in smaugfuss 1.6 you get many many errors, why might it do this?

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #7 on Sun 16 Oct 2005 09:27 PM (UTC)
Message
You sure you did exactly that? There is a bracket on a line on its own. Try pasting here what your code looks like with your change.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #8 on Sun 16 Oct 2005 09:30 PM (UTC)
Message
well first i tired to just change it and it didn't work so i copy and pasted and didnt work again, donno really... but because its and else if and not just an if have anything to do with it?

Everything turns around in the end
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Sun 16 Oct 2005 10:01 PM (UTC)
Message
If you show us the lines, I'm sure we'd be able to see what's wrong.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #10 on Mon 17 Oct 2005 12:31 AM (UTC)
Message
Well ok... nevermind i think i fixed it... not sure will seen later tonight, but i forgot to place the extra ( after the if in the first line of it. heh.

Everything turns around in the end
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


28,846 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.