Thread: Client Help

Results 1 to 14 of 14
  1. #1
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish

    Client Help

    Ok. I am... Stuck. Out of options.
    What ive done is created and hosted a text file with five characters in it. Nothing else. (0.1.4)
    Ive got 2 classes in the client.
     

    Code:
    public class Update {
    	private static Blood main;
    	private static URLReader urlr;
    	public static String var1;
    	
    	public static void update() {
    		if(main.CLIENT_VERSION == urlr.versionFromUrl) {
    			var1 = "Client is up to date.";
    		} else {
    			var1 = "New update is available.";
    		}
    	}
    }

     

    Code:
    import java.net.*;
    import java****.*;
    
    public class URLReader {
    	public static String versionFromUrl;
    	public static void main(String[] args) throws Exception {
            URL versionurl = new URL("https://pastehtml.com/view/d7dry29db.txt");
            URLConnection vu = versionurl.openConnection();
            BufferedReader in = new BufferedReader(new InputStreamReader(vu.getInputStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null) {
            	versionFromUrl = in.readLine();
                System.out.println(inputLine);
            }
            in.close();
        }
    }


    I want java to read the 0.1.4 into a string called versionFromUrl, then the string goes through an if statement. If this string is equal to that string then set var1 to be blah, else, blahblah. However, no matter what I do, the outcome is always "New update available". No idea where I should call the URLReader void. Or even how, Im kinda useless at network programming :P Any help will be awesome

  2. #2
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    spent a good hour since I came back from a night out... I gave up. Screw this. Messed with all.. Scanners, BufferedReaders, parsing, regex.. I cant even seem to split a line into 2 strings without getting an outofbounds array exception.. Imma go sleep. Night mpgh.

  3. #3
    hackroj's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    442
    Reputation
    10
    Thanks
    2,545
    My Mood
    Fine
    Quote Originally Posted by Wampwire View Post
    spent a good hour since I came back from a night out... I gave up. Screw this. Messed with all.. Scanners, BufferedReaders, parsing, regex.. I cant even seem to split a line into 2 strings without getting an outofbounds array exception.. Imma go sleep. Night mpgh.
    I used Notches premium check in 1.2.5 i.e
    Code:
       String parameters = "https://*******.com/blblbalbllal.txt";
     String result = openUrl(parameters);
    then
    Code:
    if (resul*****ntains("Version 0.1.4"))
                    {
    System.out.println("Update was found!");
    open a new gui with would you like to update.
    }
    if it cant find Version 0.1.4 in text
    Code:
     if (!resul*****ntains("Version 0.1.4"))
                 {
                    System.out.println("Couldn't find an update");
                    
                     return;
                 }
    Code:
      if (result == null)
                 {
                     System.out.println("Failed to connect to internet");
                     return;
                 }
    Last edited by hackroj; 06-30-2013 at 07:13 AM.

  4. The Following User Says Thank You to hackroj For This Useful Post:

    Wampwire (06-30-2013)

  5. #4
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    Ill try that later, work around with it.. Thanks @hackroj .I couldnt think earlier

  6. #5
    hackroj's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    442
    Reputation
    10
    Thanks
    2,545
    My Mood
    Fine
    Quote Originally Posted by Wampwire View Post
    Ill try that later, work around with it.. Thanks @hackroj .I couldnt think earlier
    No problem,you will have to modify the code abit too if you are going to put it in start.java but i tested and it works fine.

  7. #6
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    well, Ive tried my method before yours. I can get the contents of the page to print out in the console, I just cant seem to figure out how to get the first line into a string so then I could use the if check. .-. Any ideas? @hackroj

  8. #7
    hackroj's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    442
    Reputation
    10
    Thanks
    2,545
    My Mood
    Fine
    Quote Originally Posted by Wampwire View Post
    well, Ive tried my method before yours. I can get the contents of the page to print out in the console, I just cant seem to figure out how to get the first line into a string so then I could use the if check. .-. Any ideas? @hackroj
    Hmm im not sure since i basicly just modified notches code but couldn't you use something similiar to the result string like since you put that versionurl is inputline this should work ?
    Code:
    if (inputLine.contains("Version 0.1.4"))
                    {
    (whatever you want it to do)
    }


    ---------- Post added at 09:30 AM ---------- Previous post was at 08:59 AM ----------

    Also to addon I use my3gb since i can upload txts on an acc and just edit the txt directly without reuploading and it makes everything easier also I was playing around with booleans and just made so if an update is availble it says so in the splash text and it creates a button the button sucks since i did it in 2 secs and it can just replace quit button.

  9. #8
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    You can see how I want my thing to be. If the value on the web page does not equal to the value in the client, then display that there is an update available. If not then the client is up to date. You can see at the bottom that I get the 0.1.4 from the client but I think the string includes the html comments (<!-- -->) aswell. Im not quite sure on how to make it so that the first line is the String and the rest just get ignored. I tried split string, but get errors :/ @hackroj
     

  10. #9
    hackroj's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    442
    Reputation
    10
    Thanks
    2,545
    My Mood
    Fine
    Quote Originally Posted by Wampwire View Post
    You can see how I want my thing to be. If the value on the web page does not equal to the value in the client, then display that there is an update available. If not then the client is up to date. You can see at the bottom that I get the 0.1.4 from the client but I think the string includes the html comments (<!-- -->) aswell. Im not quite sure on how to make it so that the first line is the String and the rest just get ignored. I tried split string, but get errors :/ @hackroj
     
    Sorry then i have absolutly no idea.Can i ask why do you use the client and web to verify the version tho ? You could just make it if the txt has Update in it that the update is available appears.So basicly make a gui when you press yes it redirects you to the client download link. In my mind its much simpler like this because i can just make my link always the same and then when i go to my website i just edit the txt file to update and it gives you the gui and if i don't want it to update i just remove the update from the text.

  11. #10
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    Well, I honestly have no idea. I wanted something new, and I found the problem. The line string is parsing everything from the website including the comments, so Ill look to split them appart. Ill stick with what Ive got. im just experimenting with this client atm so ideas just pop in and out

  12. #11
    hackroj's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    442
    Reputation
    10
    Thanks
    2,545
    My Mood
    Fine
    Quote Originally Posted by Wampwire View Post
    Well, I honestly have no idea. I wanted something new, and I found the problem. The line string is parsing everything from the website including the comments, so Ill look to split them appart. Ill stick with what Ive got. im just experimenting with this client atm so ideas just pop in and out
    Oh i would prompt you to try my3gb again since well it doesnt use all that shit and its pretty simple

    Like mine if you do view page source its simply 0.1.4 and no mumbo jumbo -lol
    page source on my3gb :
    Code:
    0.1.4
    Page source on pastehtml:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" id='view_iframe'>
    	<head>
    		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    		<title></title>
    		<link href="https://i.pastehtml.com/stylesheets/cache/all.css" media="screen" rel="stylesheet" type="text/css" />
    		<script type="text/javascript">
    	window.google_analytics_uacct = "UA-83599-25";
    </script>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-83599-25']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    
    	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    	<script>
    		 google.load("jquery", "1.7.1");
      	</script>
    <script src="https://i.pastehtml.com/javascripts/cache/all.js" type="text/javascript"></script>
    
    
    
    
    	</head>
    	<body>
    		<div id="wrapper">
    			<iframe src="/raw/d7dry29db.txt" frameBorder="0"></iframe>
    		</div>
    		<div id="controls">
    			This page was viewed <b id="view_count">17</b> times and has <a target="_top" href="https://pastehtml.com/info/d7dry29db.txt#disqus_thread" class="disqus_comment_count" ></a>.
    			<span class='st_twitter' displayText=''></span>
    			<span class='st_facebook' displayText=''></span>
    			<span class='st_googleplus' displayText=''></span>
    				Sponsored by: <a href='https://search-logs.com/k/map%20of%20new%20york'>map of new york</a>
    			<div id="hosted_on">Hosted on</div>
    			<img alt="" class="rounded" src="https://i.pastehtml.com/images/design/iframe/rounded.png" />
    			<a href="/" class="logo" target="_top"><img alt="PasteHTML.com" src="https://i.pastehtml.com/images/design/iframe/logo.png" /></a>
    		</div>
    
    		<script>
    		
    			// $("#view_count").smartupdater({
    			// 	url : "/api/counts/d7dry29db",
    			// 	minTimeout: 2000 // 5 seconds
    			// 	}, function (data) {
    			// 		$("#view_count").html(data);
    			// 	}
    			// );
    		</script>
    		<script type="text/javascript" src="https://w.sharethis.com/button/buttons.js"></script>
    		<script type="text/javascript">stLight.options({publisher: "88ec1cfc-eb15-46e5-ae80-479238f71642"}); </script>
    		<script type="text/javascript">
    		    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    		    var disqus_url="https://pastehtml.com/info/d7dry29db.txt";
    			var disqus_shortname = 'pastehtmlpastehtml';
    
    		    /* * * DON'T EDIT BELOW THIS LINE * * */
    		    (function () {
    		        var s = document.createElement('script'); s.async = true;
    		        s.type = 'text/javascript';
    		        s.src = 'https://' + disqus_shortname + '.disqus.com/count.js';
    		        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    		    }());
    		</script>
    	</body>
    </html>

  13. #12
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    @hackroj Nothing to worry anymore. I made the client download the contents of the web page and save it as a txt file and then read from it. If version = to the version in the txt, then set var1 to be client up to date. Thanks for your suggestions anyways ^_^

  14. #13
    hackroj's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    442
    Reputation
    10
    Thanks
    2,545
    My Mood
    Fine
    Quote Originally Posted by Wampwire View Post
    @hackroj Nothing to worry anymore. I made the client download the contents of the web page and save it as a txt file and then read from it. If version = to the version in the txt, then set var1 to be client up to date. Thanks for your suggestions anyways ^_^
    Smart just sry i couldnt help more lol i guess networking and guis were always my weakpoints.

  15. #14
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    Yeah same :P

Similar Threads

  1. [Help Request] MCP Hacked Client Help
    By blkjock in forum Minecraft Help
    Replies: 3
    Last Post: 06-22-2013, 04:58 AM
  2. [Help Request] Feed The Beast Client [Help Needed]
    By XEraden in forum Minecraft Help
    Replies: 2
    Last Post: 12-28-2012, 04:10 AM
  3. INVALID VERSION CLIENT..HELP
    By skeptron89 in forum CrossFire Help
    Replies: 2
    Last Post: 04-01-2011, 11:40 AM
  4. {Help} Lt Client Help
    By justiniscool5 in forum Combat Arms Coding Help & Discussion
    Replies: 2
    Last Post: 01-24-2011, 09:01 AM
  5. [Release] packetix vpn client help..
    By mkti1[BANNED] in forum WarRock Korea Hacks
    Replies: 0
    Last Post: 12-04-2010, 01:25 AM

Tags for this Thread