[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Immortal Idle Timeout

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Immortal Idle Timeout
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Mon 17 Oct 2005 12:31 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Sun 16 Oct 2005 10:01 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Sun 16 Oct 2005 09:30 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 16 Oct 2005 09:27 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Sun 16 Oct 2005 09:07 PM (UTC)  quote  ]
Message
when putting this in smaugfuss 1.6 you get many many errors, why might it do this?

Everything turns around in the end
[Go to top] top

Posted by Nexela   USA  (14 posts)  [Biography] bio
Date Sat 01 Feb 2003 03:56 AM (UTC)  quote  ]
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!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 31 Jan 2003 10:17 PM (UTC)  quote  ]

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
[Go to top] top

Posted by Nexela   USA  (14 posts)  [Biography] bio
Date Fri 31 Jan 2003 05:37 AM (UTC)  quote  ]
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!
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Fri 31 Jan 2003 05:19 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 31 Jan 2003 04:51 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nexela   USA  (14 posts)  [Biography] bio
Date Fri 31 Jan 2003 03:40 AM (UTC)  quote  ]
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!
[Go to top] 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.


2,929 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]