IkovPS

Thread: Players Online Via Website (No MYSQL)

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1 Players Online Via Website (No MYSQL) 
    I'm back

    Uavix's Avatar
    Join Date
    Apr 2011
    Posts
    359
    Thanks given
    71
    Thanks received
    172
    Time Online
    6 h 8 m
    Avg. Time Online
    20 m
    Rep Power
    117
    Since keep selling this stuff, figured I would release my old server's one from months ago.



    First:
    Go into your Server class and under:
    Code:
    public class Server {
    add
    Code:
    	public static boolean forceWebUpdate = false;
    
    	public static Thread WebCommThread = new Thread (
    		new Runnable(){
    			long lastUpdate = 0;
    			@Override
    			public void run(){
    				while(true){
    					try{
    						if(System.currentTimeMillis() - lastUpdate > 1000 * 60 * 5 || Server.forceWebUpdate){
    							lastUpdate = System.currentTimeMillis();
    							new URL("http://website.com/vps/reset.php?pass=jilixpie").openStream().close();
    							for(Player p1: PlayerHandler.players){
    								if(p1 != null){
    									Client p = (Client)p1;
    									if(!p.properLogout)
    									new URL("http://website.com/vps/add.php?pass=jilixpie&u=" + p.playerName.replaceAll(" ","%20")).openStream().close();
    								}
    							}
    							if(Server.forceWebUpdate)
    								Server.forceWebUpdate = false;
    						System.gc();
    						}
    					}catch(Exception e){}
    				}
    			}
    		}
    	);
    then under main add:
    Code:
    WebCommThread.start();
    Then make sure to import:
    Code:
    import java.net.*;
    Second:
    In your Client class somewhere under logout add:
    Code:
    Server.forceWebUpdate = true;
    then declare this somewhere:
    Code:
    	public boolean runOnce = true;
    then under process add:
    Code:
    		if(runOnce){
    			Server.forceWebUpdate = true;
    			runOnce = false;
    		}
    Third:
    Download these files and add them to your webhost:
    [Only registered and activated users can see links. ]
    You have to call it somehow to count players, like this:
    Code:
    <?php 
    $fileName = FOLDNAME/players.txt"; 
    $countOnline = count(file($fileName)); 
    	echo "$countOnline players online."; 
    ?>
    Credits:
    Matt123337
    Me

    Quote Originally Posted by Blood View Post
    im 9 lol I can't get a job
    Rune-Server Userbase ^


    Vault proving what we have all known all along: he is a 9faggot.
    Reply With Quote  
     


  2. #2  
    Registered Member

    Join Date
    Sep 2011
    Posts
    5,128
    Thanks given
    1,337
    Thanks received
    1,797
    Time Online
    53 m
    Avg. Time Online
    3 m
    Rep Power
    1696
    Good job.
    Retired for now.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2011
    Posts
    72
    Thanks given
    0
    Thanks received
    3
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    14
    I'm more of an in-game person.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    May 2011
    Posts
    2,169
    Thanks given
    1,616
    Thanks received
    365
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    0
    Great job, thank you!
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Sep 2011
    Posts
    5,128
    Thanks given
    1,337
    Thanks received
    1,797
    Time Online
    53 m
    Avg. Time Online
    3 m
    Rep Power
    1696
    Quote Originally Posted by vial View Post
    I'm more of an in-game person.
    That has no relevance?
    Retired for now.
    Reply With Quote  
     

  6. #6  
    Registered Member Paulius,'s Avatar
    Join Date
    Aug 2011
    Posts
    72
    Thanks given
    1
    Thanks received
    2
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    31
    Nice
    Reply With Quote  
     

  7. #7  
    Registered Member Paulius,'s Avatar
    Join Date
    Aug 2011
    Posts
    72
    Thanks given
    1
    Thanks received
    2
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    31
    Fix:
    In server.java
    add this import
    import java.net.*;
    Reply With Quote  
     

  8. #8  
    I'm back

    Uavix's Avatar
    Join Date
    Apr 2011
    Posts
    359
    Thanks given
    71
    Thanks received
    172
    Time Online
    6 h 8 m
    Avg. Time Online
    20 m
    Rep Power
    117
    Quote Originally Posted by Paulius, View Post
    Fix:
    In server.java
    add this import
    import java.net.*;
    Forgot that, thanks.
    Though if people are using an IDE (like they should), it wouldn't be a problem :P

    Quote Originally Posted by Blood View Post
    im 9 lol I can't get a job
    Rune-Server Userbase ^


    Vault proving what we have all known all along: he is a 9faggot.
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    Dec 2011
    Posts
    49
    Thanks given
    8
    Thanks received
    3
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    0
    Very Nice Chris May use bro
    Reply With Quote  
     

  10. #10  

    Skarred-Lands



    Join Date
    Jun 2011
    Posts
    219
    Thanks given
    22
    Thanks received
    17
    Time Online
    2 h 34 m
    Avg. Time Online
    8 m
    Rep Power
    15
    Wait, I'm confused how do we call it to the website??
    Reply With Quote  
     

Page 1 of 4 123 ... LastLast

Thread Information
Users Browsing this Thread

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

Similar Threads

  1. [PI] Website Players Online [ NO MYSQL]
    By ItsGoml in forum Selling
    Replies: 26
    Last Post: 01-08-2012, 07:05 PM
  2. Players Online -MySQL-
    By Goth Wolf in forum Help
    Replies: 1
    Last Post: 07-04-2009, 01:09 PM
  3. Players online [No MYSQL]
    By PeeHPee in forum Tutorials
    Replies: 34
    Last Post: 09-15-2008, 01:27 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •