internal void onLogin()
 {
     if (enableLagMonitor)
     {
         lock (smartFoxLock)
         {
             smartFox.EnableLagMonitor(enabled: true);
         }
     }
 }
Exemple #2
0
    private void OnLogin(BaseEvent evt)
    {
        User user = (Sfs2X.Entities.User)evt.Params["user"];

        trace("Login successful");
        trace("Username is: " + user.Name);

        // Enable lag monitor
        if (lagMonitorToggle.isOn)
        {
            sfs.EnableLagMonitor(true);
        }
    }
    private void OnLogin(BaseEvent evt)
    {
        User user = (User)evt.Params["user"];

        trace("Login successful");
        trace("Username is: " + user.Name);

        _room = new SFSRoom(0, "The Lobby");
        sfs.Send(new Sfs2X.Requests.JoinRoomRequest(_room));

        // Enable lag monitor
        if (lagMonitorToggle.isOn)
        {
            sfs.EnableLagMonitor(true);
        }
    }
Exemple #4
0
    /**
     * Displays the starship selection screen.
     * Also, the lag monitor is enabled: this is required to compensate the lag in order to show the starships
     * and other objects positions as near as possible to the current position in the server-side simulation.
     */
    public void OnLogin(BaseEvent evt)
    {
        // Enable lag monitor
        sfs.EnableLagMonitor(true, 1, 5);

        // Save username in case it was assigned by the server (guest login for example)
        User user = evt.Params["user"] as User;

        username = user.Name;

        ISFSObject data = evt.Params["data"] as ISFSObject;

        // Retrieve starship models and weapon models from custom data sent by the Zone Extension
        starshipModels = data.GetSFSObject("starships");
        weaponModels   = data.GetSFSObject("weapons");

        loginStep = 2;
    }