Hey,
I’ve made a flash game that uses the loadVariables method of getting data. However, I’m looking to make it faster and so I turned my attention to Socket Servers.
I first tried making it in Java, and while I was understanding it, it got pretty complicated, and I hadn’t coded in Java before; so progress was really slow to say the least >_<.
I gave up for a short while, until I heard you could do the same with PHP. Now, I’m fairly decent at PHP, but I didn’t know it could be coded as a socket server. So I gave it a try, and I’m finding it much easier to code than when I wanted to do the equivalent in Java.
BUT!! - I’m kind of stuck now. What I’ve written is a simple socket server that allows multiple clients to connect, and send messages to each other. I figured if I could make an advanced chat client, than I would understand the features of sockets enough to transfer my turn based game into sockets.
The tasks I need help with understanding are:
- Authenticating a connection.
What I want to be able to do, is to login through a PHP form and add the ID to session. Which I already can do and have done. But the next step comes from, How does the socket server read a clients session? How does it know that the user has logged in?
- Assigning a class to a socket.
Say I wanted to give the socket connection things like, screen-name, email address, last login etc. How can I assign a socket connection, to a class that holds this information?
- Security.
I know it’s difficult to get anything as secure as we’d all like, but I’m talking about basic security. What possible flaws/doors does a typical newbie socket coder tend to overlook?
Any help would be appreciated.
Thanks again,
- CrimsonHEART