java server client socket sending and reading data HELP!
Hello there i need help im making a mmorpg and i want to use sockets to send data to and from the client to my server so for example:
username is sent from client to server
server validates username then sends x and y location data
i was thinking of using POST or GET type things like you do on html or PHP but have no idea how to do this on java also i am new to java sockets and if any one has some code on how to do the sending of data through sockets can u please post :)
Re: java server client socket sending and reading data HELP!
)) Just read about sockets protocols and http protocol. You will understand what you want to do. ) Because now you just don't understand what sockets is and http is. ))
Regard.
Re: java server client socket sending and reading data HELP!
ok so i have made some code for the socket data will be sent like this "cmd=login,user=uname,pass=pwd" i know how to split the "," in the string but i am trying to split the "=" using this code:
String[] msg = clientCommand.split(",");
String temp_cmd1 = msg[0];
String[] temp_cmd2 = temp_cmd1.split("=");
String cmd = temp_cmd2[0];
Re: java server client socket sending and reading data HELP!
You must do some code, which we can run. Can you tell what is clientCommand and what value does it have?
Re: java server client socket sending and reading data HELP!
clientCommand is just a string which looks like this "cmd=login,user=username,pass=password"