Thread: Highscore Log out

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 Highscore Log out 
    Officially Retired


    Join Date
    Oct 2007
    Age
    26
    Posts
    5,460
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    when i add Highscores.save(this); on my log out void. And people try to log out mass click it will give other people lagg and server crash..how do i fix?

    Here my code.
    Code:
    	public void logout() {
    		ConnectedFrom.addConnectedFrom(this, connectedFrom);
    		Highscores.save(this);
    		synchronized (this) {
    			if(System.currentTimeMillis() - logoutDelay > 20000) {
    				outStream.createFrame(109);
    				properLogout = true;
    			} else {
    				sendMessage("You must wait a few seconds from being out of combat to logout.");
    			}
    		}
    	}
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Banned
    Join Date
    Jul 2010
    Age
    24
    Posts
    1,144
    Thanks given
    7
    Thanks received
    47
    Rep Power
    0
    Try adding a method to where they cant mass click it? sorry I am not 100% up to coding & I just try giving my best ideas.
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Officially Retired


    Join Date
    Oct 2007
    Age
    26
    Posts
    5,460
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    Thank for idea..same to me im not 100% coder i hope galkon are online can post help here
    Reply With Quote  
     

  6. #4  
    Banned
    Join Date
    Jul 2010
    Age
    24
    Posts
    1,144
    Thanks given
    7
    Thanks received
    47
    Rep Power
    0
    Yeah I need help with my problems to but it seems no one wants to attend to them
    Reply With Quote  
     

  7. #5  
    Donator

    Kickyamom's Avatar
    Join Date
    Jul 2010
    Posts
    1,606
    Thanks given
    208
    Thanks received
    155
    Rep Power
    835
    Try moving it somewhere before or after clicking the logout button instead. Like up a line or down a line or 2.
    [Only registered and activated users can see links. ]

    Spoiler for Respect for the Truest:

    [Only registered and activated users can see links. ] GANG 4 LYFE
    Reply With Quote  
     

  8. #6  
    Officially Retired


    Join Date
    Oct 2007
    Age
    26
    Posts
    5,460
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    Code:
    	public void logout() {
    		ConnectedFrom.addConnectedFrom(this, connectedFrom);
    		synchronized (this) {
    			if(System.currentTimeMillis() - logoutDelay > 20000) {
    				outStream.createFrame(109);
    				properLogout = true;
    		                Highscores.save(this);
    			} else {
    				sendMessage("You must wait a few seconds from being out of combat to logout.");
    			}
    		}
    	}
    i added like this also the same.
    Reply With Quote  
     

  9. #7  
    Registered Member
    natsu's Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    3,452
    Thanks given
    1,084
    Thanks received
    676
    Rep Power
    1096
    public void logout() {
    ConnectedFrom.addConnectedFrom(this, connectedFrom);
    synchronized (this) {
    if(System.currentTimeMillis() - logoutDelay > 20000) {
    outStream.createFrame(109);
    properLogout = true;
    Highscores.save(this);
    } else {
    sendMessage("You must wait a few seconds from being out of combat to logout.");
    }
    }
    }
    look you saved it under logout but do you see where it save player stuff in that void? no..
    so look for logout() if am right its under the logout button case 2458: and paste it under there

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #8  
    Officially Retired


    Join Date
    Oct 2007
    Age
    26
    Posts
    5,460
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    my logout case button

    Code:
    			case 9154:
    			long buttonDelay = 0;
    			if(System.currentTimeMillis() - buttonDelay > 2000) 
    			{
    				c.logout();
    				buttonDelay = System.currentTimeMillis();
    			}
    			break;
    Code:
    	public void logout() {
    		ConnectedFrom.addConnectedFrom(this, connectedFrom);
    		synchronized (this) {
    			if(System.currentTimeMillis() - logoutDelay > 20000) {
    				outStream.createFrame(109);
    				properLogout = true;
    		Highscores.save(this);
    			} else {
    				sendMessage("You must wait a few seconds from being out of combat to logout.");
    			}
    		}
    	}
    it still the same..when people mass log out click it will crash server.
    Reply With Quote  
     

  11. #9  
    Registered Member
    natsu's Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    3,452
    Thanks given
    1,084
    Thanks received
    676
    Rep Power
    1096
    well look where it saves the data cuz i only see logout nothing is saved..

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  12. #10  
    Officially Retired


    Join Date
    Oct 2007
    Age
    26
    Posts
    5,460
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    What are you trying to say about safe?

    Code:
    Highscores.save(this);
    That save my highscores.

    Code:
        public static boolean save(Client c) {
            try
            {
                query("DELETE FROM `skills` WHERE playerName = '"+c.playerName+"';");
    	    query("DELETE FROM `skillsoverall` WHERE playerName = '"+c.playerName+"';");
    	    query("INSERT INTO `skills` (`playerName`,`Attacklvl`,`Attackxp`,`Defencelvl`,`Defencexp`,`Strengthlvl`,`Strengthxp`,`Hitpointslvl`,`Hitpointsxp`,`Rangelvl`,`Rangexp`,`Prayerlvl`,`Prayerxp`,`Magiclvl`,`Magicxp`,`Cookinglvl`,`Cookingxp`,`Woodcuttinglvl`,`Woodcuttingxp`,`Fletchinglvl`,`Fletchingxp`,`Fishinglvl`,`Fishingxp`,`Firemakinglvl`,`Firemakingxp`,`Craftinglvl`,`Craftingxp`,`Smithinglvl`,`Smithingxp`,`Mininglvl`,`Miningxp`,`Herblorelvl`,`Herblorexp`,`Agilitylvl`,`Agilityxp`,`Thievinglvl`,`Thievingxp`,`Slayerlvl`,`Slayerxp`,`Farminglvl`,`Farmingxp`,`Runecraftlvl`,`Runecraftxp`) VALUES ('"+c.playerName+"',"+c.playerLevel[0]+","+c.playerXP[0]+","+c.playerLevel[1]+","+c.playerXP[1]+","+c.playerLevel[2]+","+c.playerXP[2]+","+c.playerLevel[3]+","+c.playerXP[3]+","+c.playerLevel[4]+","+c.playerXP[4]+","+c.playerLevel[5]+","+c.playerXP[5]+","+c.playerLevel[6]+","+c.playerXP[6]+","+c.playerLevel[7]+","+c.playerXP[7]+","+c.playerLevel[8]+","+c.playerXP[8]+","+c.playerLevel[9]+","+c.playerXP[9]+","+c.playerLevel[10]+","+c.playerXP[10]+","+c.playerLevel[11]+","+c.playerXP[11]+","+c.playerLevel[12]+","+c.playerXP[12]+","+c.playerLevel[13]+","+c.playerXP[13]+","+c.playerLevel[14]+","+c.playerXP[14]+","+c.playerLevel[15]+","+c.playerXP[15]+","+c.playerLevel[16]+","+c.playerXP[16]+","+c.playerLevel[17]+","+c.playerXP[17]+","+c.playerLevel[18]+","+c.playerXP[18]+","+c.playerLevel[19]+","+c.playerXP[19]+","+c.playerLevel[20]+","+c.playerXP[20]+");");
    	    query("INSERT INTO `skillsoverall` (`playerName`,`lvl`,`xp`) VALUES ('"+c.playerName+"',"+(c.getLevelForXP(c.playerXP[0]) + c.getLevelForXP(c.playerXP[1]) + c.getLevelForXP(c.playerXP[2]) + c.getLevelForXP(c.playerXP[3]) + c.getLevelForXP(c.playerXP[4]) + c.getLevelForXP(c.playerXP[5]) + c.getLevelForXP(c.playerXP[6]) + c.getLevelForXP(c.playerXP[7]) + c.getLevelForXP(c.playerXP[8]) + c.getLevelForXP(c.playerXP[9]) + c.getLevelForXP(c.playerXP[10]) + c.getLevelForXP(c.playerXP[11]) + c.getLevelForXP(c.playerXP[12]) + c.getLevelForXP(c.playerXP[13]) + c.getLevelForXP(c.playerXP[14]) + c.getLevelForXP(c.playerXP[15]) + c.getLevelForXP(c.playerXP[16]) + c.getLevelForXP(c.playerXP[17]) + c.getLevelForXP(c.playerXP[18]) + c.getLevelForXP(c.playerXP[19]) + c.getLevelForXP(c.playerXP[20]))+","+((c.playerXP[0]) + (c.playerXP[1]) + (c.playerXP[2]) + (c.playerXP[3]) + (c.playerXP[4]) + (c.playerXP[5]) + (c.playerXP[6]) + (c.playerXP[7]) + (c.playerXP[8]) + (c.playerXP[9]) + (c.playerXP[10]) + (c.playerXP[11]) + (c.playerXP[12]) + (c.playerXP[13]) + (c.playerXP[14]) + (c.playerXP[15]) + (c.playerXP[16]) + (c.playerXP[17]) + (c.playerXP[18]) + (c.playerXP[19]) + (c.playerXP[20]))+");");
    		}
            catch(Exception e)
            {
                e.printStackTrace();
                return false;
            }
            return true;
        }
    	public static String Driver = "com.mysql.jdbc.Driver";
    }
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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

Similar Threads

  1. [PI] Highscore
    By david4444 in forum Help
    Replies: 1
    Last Post: 07-28-2010, 06:07 PM
  2. [PHP] Highscore
    By Segadora in forum Website Development
    Replies: 126
    Last Post: 03-15-2010, 11:30 PM
  3. Highscore Need Help
    By RuneTrip in forum Help
    Replies: 6
    Last Post: 04-13-2009, 07:36 PM
  4. Highscore help
    By I Am Me I in forum Help
    Replies: 5
    Last Post: 04-09-2009, 11:51 PM
  5. Highscore
    By Segadora in forum RS2 Server
    Replies: 8
    Last Post: 01-05-2009, 04:19 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
  •