Results 1 to 8 of 8

Thread: [RESOLVED] How to detect process closing???

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2014
    Posts
    428

    Resolved [RESOLVED] How to detect process closing???

    Hello Guys,

    I have been developing an anti-cheat software for couple of months. Now the problem I am facing is that my anti-cheat has a login system. And when a users login in the database his status becomes status=1. Now if for some reason the application becomes not responding or the client quits the process from task manager end process then nxt time when he tries to login he gets the msg of no multiple logins as the status remains 1 instead of 0. So how can I track the event of end process to make end process as logout.

    Please help me...

    Thanks in advance....

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    35,241

    Re: How to detect process closing???

    I'm thinking that you probably can't. After all, there are scenarios, such as somebody pulling the plug, where you have NO chance to write anything or do anything. Therefore, I would suggest that you have to think of a way to manage around that. For example, perhaps you could have something in My.Settings that you write as soon as the user logs in, and which will be erased if the user exits normally. If you run the app again, and the status = 1, but that setting remains in My.Settings, then you know that the user didn't exit normally. Something like that might work.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2014
    Posts
    428

    Re: How to detect process closing???

    Only If I detect then the total purpose is not served. Is there any way in which I can reset the database value from detecting???

  4. #4
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: How to detect process closing???

    This is a problem without a clean resolution.

    Several ways to do it: have a TCP or UDP keep alive message. If the message isn't received within a given time then the client is no longer present and act appropriately. Perform a periodic database update with a timestamp. If the client hasn't updated the database within a given time then the client is not connected and act appropriately.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2014
    Posts
    428

    Re: How to detect process closing???

    I can do the timestamp. But have to do it for all clients. Is there any system in phpmyadmin so that I can configure timestamp for each client? Suppose when a user logs in his timer will will start and his timer will make the status 0 after every 60 seconds. Can this be done in phpmyadmin for separate users because all the users not log in at the same time...

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2014
    Posts
    428

    Re: How to detect process closing???

    Bump

  7. #7
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,390

    Re: How to detect process closing???

    You have been warned about bumping before. Why do you keep doing it? The whole solution is obvious. If the program shuts down correctly set a flag.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2014
    Posts
    428

    Re: How to detect process closing???

    Ok bro will not bump again...Got it...thanks for the solution guys....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width