Thread: Players Online Via Website (No MYSQL)

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34
  1. #11  
    Registered Member
    Uavix's Avatar
    Join Date
    Apr 2011
    Posts
    360
    Thanks given
    72
    Thanks received
    173
    Rep Power
    119
    Quote Originally Posted by Sk8rdude462 View Post
    Wait, I'm confused how do we call it to the website??
    Code:
    count(file("http://www.website.com/vps/players.txt"))
    That is counting the number of players in the file, then showing it.

    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. #12  
    Registered Member
    Join Date
    Aug 2008
    Posts
    2,418
    Thanks given
    721
    Thanks received
    595
    Rep Power
    1220
    Quote Originally Posted by vial View Post
    I'm more of an in-game person.
    Ok, and..?
    Reply With Quote  
     

  3. #13  
    looking for partnership

    Satan's Avatar
    Join Date
    Oct 2010
    Posts
    833
    Thanks given
    287
    Thanks received
    68
    Rep Power
    269
    [1/8/12 12:23 PM]: java.lang.IllegalThreadStateException
    [1/8/12 12:23 PM]: at java.lang.Thread.start(Thread.java:682
    [1/8/12 12:23 PM]: at server.Server.main(Server.java:213)
    [1/8/12 12:23 PM]: A fatal exception has been thrown!

    Help

    [/url]
    Reply With Quote  
     

  4. #14  
    Registered Member
    Uavix's Avatar
    Join Date
    Apr 2011
    Posts
    360
    Thanks given
    72
    Thanks received
    173
    Rep Power
    119
    Quote Originally Posted by Johan View Post
    Help
    You put some code somewhere wrong, that happens when you try to start the thread more than once.

    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  
     

  5. #15  
    Registered Member
    Join Date
    Jun 2011
    Posts
    476
    Thanks given
    57
    Thanks received
    43
    Rep Power
    17
    [SPOIL]
    Quote Originally Posted by Jili X I View Post
    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://vengeance-x.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://vengeance-x.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:
    Players Online Files
    You have to call it somehow to count players, like this:
    Code:
    count(file("http://www.website.com/vps/players.txt"))
    Credits:
    Matt123337
    Me
    [/SPOIL]

    Thanks
    Reply With Quote  
     

  6. #16  
    Registered Member
    Join Date
    Jun 2011
    Posts
    71
    Thanks given
    9
    Thanks received
    8
    Rep Power
    9
    Thanks will use.
    Reply With Quote  
     

  7. #17  
    Registered Member
    Join Date
    Jan 2010
    Posts
    466
    Thanks given
    259
    Thanks received
    77
    Rep Power
    43
    Well, It's a good idea and all, but I personally don't like the way you are calling it.

    Here's a nice, clean way to load it. You can add it to the main post if you like.

    Code:
    <?php 
    $fileName = FOLDNAME/players.txt"; 
    $countOnline = count(file($fileName)); 
    	echo "$countOnline players online."; 
    ?>
    Reply With Quote  
     

  8. #18  
    Registered Member
    Uavix's Avatar
    Join Date
    Apr 2011
    Posts
    360
    Thanks given
    72
    Thanks received
    173
    Rep Power
    119
    Quote Originally Posted by Onlyme View Post
    Well, It's a good idea and all, but I personally don't like the way you are calling it.

    Here's a nice, clean way to load it. You can add it to the main post if you like.

    Code:
    <?php 
    $fileName = FOLDNAME/players.txt"; 
    $countOnline = count(file($fileName)); 
    	echo "$countOnline players online."; 
    ?>
    I gave that only as example, I call it differently.
    Going to add this to main post.

    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. #19  
    Registered Member rockarocka's Avatar
    Join Date
    May 2010
    Posts
    978
    Thanks given
    27
    Thanks received
    7
    Rep Power
    20
    okat so i added everything.. So ok.. the code
    count(file("http://www.website.com/vps/players.txt"))
    show up only this line (im so bad at php) can you please post full code i should add?
    Reply With Quote  
     

  10. #20  
    Registered Member
    Uavix's Avatar
    Join Date
    Apr 2011
    Posts
    360
    Thanks given
    72
    Thanks received
    173
    Rep Power
    119
    Quote Originally Posted by rockarocka View Post
    okat so i added everything.. So ok.. the code
    count(file("http://www.website.com/vps/players.txt"))
    show up only this line (im so bad at php) can you please post full code i should add?
    Use grammar so I can understand you, please.

    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  
     

Page 2 of 4 FirstFirst 1234 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [PI] Website Players Online [ NO MYSQL]
    By ItsGoml in forum Selling
    Replies: 26
    Last Post: 01-08-2012, 08: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
  •