Results 1 to 5 of 5
  1. #1
    silentrunner2's Avatar
    Join Date
    Jun 2008
    Gender
    male
    Posts
    629
    Reputation
    110
    Thanks
    2,870
    My Mood
    Busy

    Online Statistics?

    Hi im not sure if this has been discussed before did I quick search but could not find anything. Is there a simple way of keeping track of say how many people are using your program so say implement a a feature so when using your program it will display users online now or what im more interested in is having a feature in my account creator so it will say accounts created so far then have a number. I would imagine you would need a server for this? hope im making sense

    Thanks
    My Projects


    Don't Ask For Thanks Earn It
    You: "Please Give Thanks"
    Me: "...................No"

  2. #2
    xBear Grylls's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    Maryland
    Posts
    198
    Reputation
    14
    Thanks
    27
    My Mood
    Psychedelic
    You would need an SQL server database

  3. The Following User Says Thank You to xBear Grylls For This Useful Post:

    silentrunner2 (05-20-2013)

  4. #3
    silentrunner2's Avatar
    Join Date
    Jun 2008
    Gender
    male
    Posts
    629
    Reputation
    110
    Thanks
    2,870
    My Mood
    Busy
    Quote Originally Posted by xBear Grylls View Post
    You would need an SQL server database
    Ok thanks will look into that.
    My Projects


    Don't Ask For Thanks Earn It
    You: "Please Give Thanks"
    Me: "...................No"

  5. #4
    atom0s's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    403
    Reputation
    139
    Thanks
    104
    Create a web service that your application connects to, which will create a unique session id for each connection made. The service could be written in basically any web language that will allow post/get requests and such. So something like C#/WPF, PHP, etc. will work fine.

    The service will have some basic things such as:
    - createSessionToken(); [Returns string] - Creates a new token for the unique application connection. (Call when the app is started.)
    - deleteSessionToken( token ); - Deletes the session token for this application. (Call when the app is closed.)
    - updateSessionToken( token ); - Updates the timeout for the given token. (Called to keep the session active.)
    - getActiveTokenCount(); [Returns integer] - Obtains a count of all active connections.

    On the web-service, you'd have some sort of cron-job running every so often to automatically remove stale sessions that are not being updated properly. Such as having a server-sided timeout of 15minutes or something, but have the application update the session once every 5-10 minutes to avoid being removed.

    Then your database the service uses could be something simple like:
    - session_token : text (primary key) (Store the created session id.)
    - session_timeout : BIGINT (Stores a unix timestamp of the last pinged update.)
    - session_owner : text (Stores the owner IP of the session. Can be used to prevent the same IP from creating multiple sessions.)

    So then a quick rundown of what would happen would be:
    - Application starts; calls the web service 'createSessionToken()' function.
    - Application obtains a unique session token from the service.
    - Application calls the web service 'updateSessionToken( token )' function to keep the session marked as active.
    - Application closes; calls the web service 'deleteSessionToken( token )' function to remove the session gracefully.

    On the service end, you'd have things setup like:

    createSessionToken would check the current session table for any sessions active by the requesting IP address. If found is found, update the timeout on it then return that already created session string instead of making a new one. This way you have 1 session per-IP. (If you want it that way of course.)

    deleteSessionToken would delete the session from the database that matches the string given.

    updateSessionToken would locate the session in the database and update the timeout for it with the current system timestamp.

    getActiveTokenCount would just return a count of all sessions in the session table.

  6. The Following 2 Users Say Thank You to atom0s For This Useful Post:

    Cryptonic (05-20-2013),silentrunner2 (05-20-2013)

  7. #5
    silentrunner2's Avatar
    Join Date
    Jun 2008
    Gender
    male
    Posts
    629
    Reputation
    110
    Thanks
    2,870
    My Mood
    Busy
    I have decided to just keep it simple and just have it client sided so it will tell the user how many accounts they have ever created, one problem though. Im just adding 1 to a label everytime a account is made pretty simple right works fine. Then to save it i just use the application settings method and save the text but it does not seem to save?? any ideas can you not save the text in labels or something

    My Projects


    Don't Ask For Thanks Earn It
    You: "Please Give Thanks"
    Me: "...................No"

Similar Threads

  1. how about Tantra Online Game
    By scoutranger in forum General Gaming
    Replies: 2
    Last Post: 09-25-2018, 06:57 AM
  2. SilkRoad Online
    By fl0 in forum General Gaming
    Replies: 20
    Last Post: 01-27-2006, 03:49 AM
  3. Space Cowboy Online
    By wardo1926 in forum General Gaming
    Replies: 3
    Last Post: 12-30-2005, 10:15 AM
  4. WW2 Online :Battleground over Europe
    By Joe.. in forum General Game Hacking
    Replies: 0
    Last Post: 12-30-2005, 02:40 AM