Thread: Opening Interface on Login

Results 1 to 5 of 5
  1. #1 Opening Interface on Login 
    Registered Member
    Join Date
    Feb 2019
    Posts
    2
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I am trying to make the Make-over mage interface appear when you log in.
    However, I want this to appear ONLY when it is your first time connecting to the server.

    Could I have some guidance please?

    - I am using Pimpscape source.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Arlo's Avatar
    Join Date
    Mar 2017
    Posts
    287
    Thanks given
    197
    Thanks received
    124
    Rep Power
    558
    not sure how it is on pimpscape but add this to the code when you login.

    c.getPA().showInterface(3559);
    c.canChangeAppearance = true;
    might be different on pimpscape.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2014
    Posts
    248
    Thanks given
    2
    Thanks received
    6
    Rep Power
    11
    public void initialize() {
    synchronized (this) {
    Search for the code and place under
    c.getPA().showInterface(3559);
    c.canChangeAppearance = true;

    Enjoy
    Owner of ThamenX
    Reply With Quote  
     

  4. #4  
    Registered Member Grant_'s Avatar
    Join Date
    Aug 2014
    Posts
    440
    Thanks given
    86
    Thanks received
    90
    Rep Power
    69
    Quote Originally Posted by blaxe View Post
    Search for the code and place under


    Enjoy
    This will open the interface every single time you login, regardless of if it is your first time.

    OT: Here are some options
    Code:
    public void initialize() {
    	if (!hasFirstLogin) {
    		//Code to open make-over-mage interface here
    		hasFirstLogin = !hasFirstLogin;
    	}
    ...
    }
    hasFirstLogin would be a player variable that is set to false initially and saved to the character file.

    I have no idea what 'pimpscape' consists of, but it may (doubtful) have a method that checks if a user's IP has logged in before and give starting gear. If this is the case you could display the interface after starter gear is given, as this is only done once on first login.
    Reply With Quote  
     

  5. #5  
    Registered Member Bambino's Avatar
    Join Date
    Feb 2019
    Posts
    13
    Thanks given
    0
    Thanks received
    1
    Rep Power
    25
    you need to set a variable to the player class for this and save it to the account and load it from the player file on save and load.

    something like

    public class Player
    {
    private boolean newPlayer = true;
    public boolean isNewPlayer()
    {
    return newPlayer;
    }
    public void setNewPlayer(boolean bool)
    {
    this.newPlayer = bool;
    }

    then on login authentication method (where username and pass are received) you could have

    Player player = new Player(args);
    File file = new File(pathToSaveFiles + username + ".dat");

    if (file.exists())
    player.deserialize(file); // in here, you will load a the boolean which will be false, and you have to add this boolean to your serialize method


    if (player.isNewPlayer()) // if this is their first login, file.exits() would be false, deserialize would not be called so this would be the next line and would return true
    player.setNewPlayer(false) // now when you logout, it will serialize that you are not new, and each new login file will exist, it will deserialize the false value and this will no longer be true

    now in your sendLogin() method you will add the interface if (player.isNewPlayer()) -> sendInterface(makeoverId)

    if you need help implementing something like this, or anything else, send me a pm
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [614] Opening Interface on login
    By ConspiracyRSPS in forum Help
    Replies: 1
    Last Post: 07-18-2013, 06:18 PM
  2. open interface on login (pi)
    By xx1hitkoxx in forum Help
    Replies: 2
    Last Post: 05-15-2012, 11:36 PM
  3. [508] Bulby open interface on login?
    By Khalym in forum Requests
    Replies: 4
    Last Post: 07-03-2010, 12:21 PM
  4. load interface on login [508]
    By Wicksyere in forum Help
    Replies: 0
    Last Post: 07-31-2009, 11:45 PM
  5. Interfaces on Login?
    By Snow Cat123 in forum Help
    Replies: 11
    Last Post: 07-04-2009, 01:46 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •