Skip to main content
Participant
May 22, 2007
Question

Trap The Duplicate Logging On FMS, LoggOff Old One And Accept New Instance.

  • May 22, 2007
  • 2 replies
  • 326 views
Hi All,

I need help on the following topic of FMS 2.0.

On FMS Server I want to trap the duplicate logging, Logoff Old One and accept New Instance.

The scenario is like this, if a user logged in with the name “ wins” on FMS Application from his Office, after some time he came to his home and want to logging again.
I want to disconnect or logoff the instance of application which is logged in from his Office and allow him to logging from his home.

Actually I want to implement the functionality like Yahoo messenger.
Yahoo messenger gives the facility to login from another system and logoff the previous instance.

So, tell me what I have to do to achieve this.

Thanks
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    May 24, 2007
    onAppStart intitialize an object to hold all connected clients, maybe called userList:
    application.onAppStart = function(){
    this.userList = {};
    }

    Then when someone logs in, they of course pass in their username. Simply put that client in userList by its username.
    application.onConnect = function(newClient, username){
    this.acceptConnection(newClient);
    this.userList[username] = newClient;
    }

    Then you can easily modify that code to boot the old client if that username is already in use:

    application.onConnect = function(newClient, username){
    if(this.userList[username]){
    this.disconnect(this.userList[username]);
    }
    this.acceptConnection(newClient);
    this.userList[username] = newClient;
    }

    See if that works for ya.
    Vijay_SSAuthor
    Participant
    May 25, 2007
    Hi Abeall,

    Thanks for this,

    I had already solved this problem with the same process.
    But your code is much optimized so i am going to recode the main.asc as per your code.

    Thanks,