Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Attempting to Integrate
#1
Not Solved
So, im trying to get my Java game server to integrate with MyBB 1.6 forums, with logging in checking player user + passwords etc. the server sided code that reads the file online is perfect and it uses HTTP to connect, but when i try to login to the game i get a few errors, like the ones below:

[9/25/13 11:14 PM]: <br />
[9/25/13 11:14 PM]: <br />
[9/25/13 11:15 PM]: <br />
[9/25/13 11:15 PM]: <br />
[9/25/13 11:15 PM]: <br />
[9/25/13 11:15 PM]: <br />
[9/25/13 11:15 PM]: <br />
[9/25/13 11:16 PM]: java.net.ConnectException: Connection timed out: connect
[9/25/13 11:16 PM]:     at java.net.DualStackPlainSocketImpl.connect0(Native Met
hod)
[9/25/13 11:16 PM]:     at java.net.DualStackPlainSocketImpl.socketConnect(Unkno
wn Source)
[9/25/13 11:16 PM]:     at java.net.AbstractPlainSocketImpl.doConnect(Unknown So
urce)
[9/25/13 11:16 PM]:     at java.net.AbstractPlainSocketImpl.connectToAddress(Unk
nown Source)
[9/25/13 11:16 PM]:     at java.net.AbstractPlainSocketImpl.connect(Unknown Sour
ce)
[9/25/13 11:16 PM]:     at java.net.PlainSocketImpl.connect(Unknown Source)
[9/25/13 11:16 PM]:     at java.net.SocksSocketImpl.connect(Unknown Source)
[9/25/13 11:16 PM]:     at java.net.Socket.connect(Unknown Source)
[9/25/13 11:16 PM]:     at java.net.Socket.connect(Unknown Source)
[9/25/13 11:16 PM]:     at sun.net.NetworkClient.doConnect(Unknown Source)
[9/25/13 11:16 PM]:     at sun.net.www.http.HttpClient.openServer(Unknown Source
)
[9/25/13 11:16 PM]:     at sun.net.www.http.HttpClient.openServer(Unknown Source
)
[9/25/13 11:16 PM]:     at sun.net.www.http.HttpClient.<init>(Unknown Source)
[9/25/13 11:16 PM]:     at sun.net.www.http.HttpClient.New(Unknown Source)
[9/25/13 11:16 PM]:     at sun.net.www.http.HttpClient.New(Unknown Source)
[9/25/13 11:16 PM]:     at sun.net.www.protocol.http.HttpURLConnection.getNewHtt
pClient(Unknown Source)
[9/25/13 11:16 PM]:     at sun.net.www.protocol.http.HttpURLConnection.plainConn
ect(Unknown Source)
[9/25/13 11:16 PM]:     at sun.net.www.protocol.http.HttpURLConnection.connect(U
nknown Source)
[9/25/13 11:16 PM]:     at sun.net.www.protocol.http.HttpURLConnection.getInputS
tream(Unknown Source)
[9/25/13 11:16 PM]:     at server.Login.checkUser(Login.java:19)
[9/25/13 11:16 PM]:     at server.net.RS2LoginProtocolDecoder.load(RS2LoginProto
colDecoder.java:251)
[9/25/13 11:16 PM]:     at server.net.RS2LoginProtocolDecoder.doDecode(RS2LoginP
rotocolDecoder.java:167)
[9/25/13 11:16 PM]:     at org.apache.mina.filter.codec.CumulativeProtocolDecode
r.decode(CumulativeProtocolDecoder.java:133)
[9/25/13 11:16 PM]:     at org.apache.mina.filter.codec.ProtocolCodecFilter.mess
ageReceived(ProtocolCodecFilter.java:158)
[9/25/13 11:16 PM]:     at org.apache.mina.common.support.AbstractIoFilterChain.
callNextMessageReceived(AbstractIoFilterChain.java:299)
[9/25/13 11:16 PM]:     at org.apache.mina.common.support.AbstractIoFilterChain.
access$1100(AbstractIoFilterChain.java:53)
[9/25/13 11:16 PM]:     at org.apache.mina.common.support.AbstractIoFilterChain$
EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
[9/25/13 11:16 PM]:     at org.apache.mina.common.IoFilterAdapter.messageReceive
d(IoFilterAdapter.java:80)
[9/25/13 11:16 PM]:     at org.apache.mina.common.support.AbstractIoFilterChain.
callNextMessageReceived(AbstractIoFilterChain.java:299)
[9/25/13 11:16 PM]:     at org.apache.mina.common.support.AbstractIoFilterChain.
access$1100(AbstractIoFilterChain.java:53)
[9/25/13 11:16 PM]:     at org.apache.mina.common.support.AbstractIoFilterChain$
EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
[9/25/13 11:16 PM]:     at org.apache.mina.filter.executor.ExecutorFilter.proces
sEvent(ExecutorFilter.java:220)
[9/25/13 11:16 PM]:     at org.apache.mina.filter.executor.ExecutorFilter$Proces
sEventsRunnable.run(ExecutorFilter.java:264)
[9/25/13 11:16 PM]:     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unk
nown Source)
[9/25/13 11:16 PM]:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
known Source)
[9/25/13 11:16 PM]:     at org.apache.mina.util.NamePreservingRunnable.run(NameP
reservingRunnable.java:51)
[9/25/13 11:16 PM]:     at java.lang.Thread.run(Unknown Source)

Someone told me it was the PHP file i was using, im not good with php, here it is below:
<?php


$host = "";
$user = "";
$pass = "";
$name = "";
$_GET['name'] = str_replace("_"," ",$_GET['name']);
if($_GET['crypt'] != 53199413){
	echo '-1';
	exit;
}
if(!@mysql_connect($host, $user, $pass))  {
	die("error connecting to mysql server - " . mysql_error());	
}
if(!@mysql_select_db($name))  {
	die("error selecting mysql database - " . mysql_error());	
}

$query = mysql_query("SELECT * FROM mybb_users WHERE username = '".$_GET['name']."'");
if($row = mysql_fetch_array($query)){

$pass2 = md5(md5($row["salt"]).md5($_GET['pass']));
if($pass2 == $row["password"])
	echo ''.(2+$row["usergroup"]);
else
	echo '1';
} else
echo '0';
?>

Anyone tell me what i'm doing wrong?, Thank you.


Forum Jump:


Users browsing this thread: