c# - Minecraft 1.6.2 Custom Launcher -
i making launcher minecraft. 1.6.2 changed lot, way login different. if of have knowledge of logging minecraft using c#, appreciate it.
wclient.downloadstring("http://login.minecraft.net/?user=" + strusername + "&password=" + strpassword + "&version=13");
i believe used valid way of doing it, not quite sure anymore. appreciated, thanks.
in reply theunrealmegashark's comments rhys towey's answer. have been working hard launch, but. throwing me off bit. next update include 1.6 fix. got figure out.
the proper answer question web link fetches session still in use. nothing new there.
beware! must know
"http://login.minecraft.net/?user=" + strusername + "&password=" + strpassword + "&version=13"
is unsafe. sends password of user through internet in plain text. can subject "man in middle" attacks.
one of proper ways encrypt connection use https post. using post, avoid sending of data in request url , send data through post. using https, encrypt data sent after request url returns. https makes post encrypted, removing "man in middle" attacks.
you can use https , still secure (from have read). but, considered unsafe practice. although safe in accounts between computer , connected device, anywhere else might seen , subject "man behind attack". mean when send url, possible computer record url in sort of history, or, display in address bar in plain text. although, sense not making web browser , url not displayed, possibly forgotten.
but, if me, still play safe , use safer strategy.
to use https post.
here sample of code use in "atomlauncher." code send post data url , return string. goto http://www.minecraftwiki.net/wiki/minecraft.net more info on string returned.
string mcurldata = "error"; using (webclient client = new webclient()) // data minecraft username , password { // text control program, ignore commented line if wish. // this.invoke(new methodinvoker(delegate { homelabeltop.text = "connecting minecraft.net..."; })); try { system.collections.specialized.namevaluecollection urldata = new system.collections.specialized.namevaluecollection(); urldata.add("user", "username"); urldata.add("password", "mypa22w0rd"); urldata.add("version", "13"); byte[] responsebytes = client.uploadvalues("https://login.minecraft.net", "post", urldata); mcurldata = encoding.utf8.getstring(responsebytes); } catch { if (!system.net.networkinformation.networkinterface.getisnetworkavailable()) { mcurldata = "internet disconnected."; } else { mcurldata = "can't connect login.minecraft.net."; } } }
to use https get
change the
http
in code to
https
in other news.
i have fixed code. feel free (when uploaded) use it. information, need know when 1.6.x launches creates natives folder of starts using immediately. have done fix run 1.6.2 , copy natives folder created , removed number.
created "version/1.6.2/1.6.2-natives-###" copied "version/1.6.2/1.6.2.natives" point program "natives" folder created.
what i'll end doing in future automatically checking natives folder , if doesn't exist, i'll have download natives internet. (i love know minecraft getting current natives can same thing. unless, download internet every time launches. if true, that's kind of ugly. seeing have bandwidth usage limits.)
Comments
Post a Comment