Created
April 30, 2011 23:19
-
-
Save TobiX/950083 to your computer and use it in GitHub Desktop.
Minecraft Authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
user=$1 | |
pass=$2 | |
echo "Login..." | |
oldIFS="$IFS" | |
IFS=':' | |
set -- `curl -d "user=$user&password=$pass&version=9999" https://login.minecraft.net/` | |
IFS="$oldIFS" | |
if [ $# -ne 4 ] | |
then | |
echo "ERR: $@" | |
exit 1 | |
fi | |
sid=$4 | |
user=$3 | |
hash=$RANDOM | |
echo "Now I'm the client ($user)..." | |
curl -L "http://www.minecraft.net/game/joinserver.jsp?user=$user&sessionId=$sid&serverId=$hash" | |
echo | |
echo "Now I'm the server..." | |
curl -L "http://www.minecraft.net/game/checkserver.jsp?user=$user&serverId=$hash" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment