Skip to main content
Jun 17, 2009 1:56 AM UTC
Question

How to replace a ClientID in username

Hello,

I wonder whether it is possible to replace FMS ClientID generated by a user name ?

If so how ?

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

    6 replies

    Jun 17, 2009 8:04 PM UTC

    ok,

    the code you give me should be added to a particular file, if so which ?

    I am sorry for all this question but I am still a beginner with FMS
    Translate
    Participating Frequently
    Jun 22, 2009 11:48 AM UTC

    Add that code to main.asc of you application. Say if your player/client is connecting to "myApp", you can put that code in application.onConnect handler of the main.asc

    like

    application.onConnect = function(client){

    this.clientObj = new Object;

    this.clientObj = client;

    this.clientObj.uName = username;

    }

    Translate
    Jun 17, 2009 2:35 PM UTC

    Thank you for your reply

    this.clientObj = new Object;

    this.clientObj = client;

    this.clientObj.uName = username;

    I do not know at all or place the code in FMS or JW Player ?

    Translate
    calmchessplayer
    Inspiring
    Jun 17, 2009 5:12 PM UTC

    Thats server side FMS code.

    Translate
    calmchessplayer
    Inspiring
    Jun 17, 2009 8:46 AM UTC

    you can say this.clientID = this.client; and add clientID to the client object....generally though you add the user name to a user object something like ..

    this.clientObj = new Object;

    this.clientObj = client;

    this.clientObj.uName = username;

    you might have to tweak the above to make it work i'm writing it from memory instead of looking at my notes.

    Translate
    Jun 17, 2009 12:47 PM UTC

    If you mean to change what's displayed in the admin console, I'm fairly certain you can't. That ID is generated by the server when the client object is created, and I recall reading that the id property is read only.

    Translate