[ Login | Register ]

The Shining Source

« previous next »
Pages: 1 [2] 3 Print
Networking   (Read 153080 times)
Old Post August 05, 2005, 05:23:38 am
#16
Job
Shining Light *

Posts: 230

Logged
Networking
I already have the code that gets the peers in a given peer group, so i want to put up a simple interface that allows a user to choose which peer to connect to, and then bring up a simple chat app. I just need some time to put it together, but i'm not expecting any complications.

I also download the latest BABS release and it looks pretty sweet, good job Dev.


Old Post August 05, 2005, 02:42:30 pm
#17
Administrator
Shining Spammer *

Posts: 1,208

Logged
Networking
Thanks Wink. Hopefully the source code isn't overly filthy and messy for your taste Smiley.

Devlyn

Great news for Shining fangame developers! Wink

Correcting your non-working <img> tags since 1982 Wink


Old Post August 05, 2005, 06:39:40 pm
#18
Job
Shining Light *

Posts: 230

Logged
Networking
It's all right, i'm pretty good at cleaning up and organizing code. I'm glad i can use your engine because, though i'm very confortable with the language, i have zero experience in dealing with graphics in Java, so it saves me the time of going through the API.
By the way, here is a P2P chess game built in Java using the JXTA protocol:
http://chess.jxta.org/
If they can do it, we can do it. Smiley


Old Post August 06, 2005, 04:36:42 am
#19
Job
Shining Light *

Posts: 230

Logged
Networking
Seeing as peers will be represented by a username, and in order to guarantee username uniqueness, i'll have to implement a login system.
I was thinking of having the application authenticate at the Shining Source, this way YOB members won't have to register to test the game and i won't have to build a login/registration system.
Ty is it possible for you to write a script that takes in a username and password (via POST), tries to login and prints true/false if the login succeeds/fails? This would be as secure as a regular browser login.


Old Post August 06, 2005, 10:05:56 am
#20
Ty
Administrator
Shining Sideburns *

Posts: 837

Logged
Networking
Yep, that's no problem.


Old Post August 07, 2005, 01:27:08 pm
#21
Administrator Shining Spammer *

Posts: 1,129

Logged
Networking
Wow things are progressing really well Cheesy

~Elvenfyre


Old Post August 07, 2005, 07:05:37 pm
#22
Ty
Administrator
Shining Sideburns *

Posts: 837

Logged
Networking
Done.

This page takes two POST vars - "username" and "password", and will verify them. It will either return "true", or "false" followed by a line break and an error message. Both fields should be sent plain text (i.e. the password should not be encrypted), but this can change at a later date should you wish.

Any problems, let me know.


Old Post August 07, 2005, 08:48:39 pm
#23
Job
Shining Light *

Posts: 230

Logged
Networking
Great, i'll put it to use soon. I suffered a setback when i found out that the same application can't be running both a client and a server, hence it can't both be listening for connections and attempting to connect to some peer. To solve this peers will choose to either connect to waiting peers or wait for peers to connect, but this can be changed at any time.
I had to recode some stuff, but i think it was for the best since now i have my own custom client/server sockets, i made them really easy to use:
ServerSocket:
void listen()
void send(String msg)

ClientSocket:
void connect(Peer)
void send(String msg)

I also created the interface SocketListener:
void onConnect()
void onReceive(String data)

(I even worked out a handshake protocol so that each peer can be certain that the other peer is running the right application)
The above works very nicely so a chat app is really easy to make. The things that i need to get done before we have a P2P Chat app are:
. Figure out how to send Post data with a socket. Tongue
. Create a login interface
. Create an interface that shows waiting peers, and allows users to choose one to connect to
. Create a chat interface
. Compile the program.


Old Post August 09, 2005, 03:27:14 pm
#24
Job
Shining Light *

Posts: 230

Logged
Networking
Of the above all that is left to do is:
. Create the chat interface.
. Compile the program.

If everything goes smoothly i'll have this ready either today or tomorrow.


Old Post August 10, 2005, 08:33:27 pm
#25
Job
Shining Light *

Posts: 230

Logged
Networking
I got it working. I'm going to wait to release a demo because there's some bugs i need to fix and some behaviors i want to add (connection timeout for example).
The chat worked fine between my computer and my brother's.
I have two screenshots of it here (the interface was roughly put together):



By the way, i created a user DemoUser with password "demo" just for testing purposes, in case your wondering who that is. Tongue

Ty edit: Made post pretty Wink


Old Post August 11, 2005, 12:00:18 am
#26
Administrator Shining Spammer *

Posts: 1,129

Logged
Networking
That's so cool!

Good stuff!  

One new thing I've thought about, especially with testing - is to time sync everyone, and give an idea of what's possible.

Let's talk about time in GMT, since I'm not sure what zone you're in.

So my day starts around 2200GMT  and ends 1400GMT

I can take time out of the beginning, middle OR end of the day usually just not all three Wink  

I can also stay up late or wake early if it's important, and just move my stuff around cos I really want to see this go somewhere. Smiley

Well done, once again, I'm getting excited!

~Elvenfyre


Old Post August 17, 2005, 01:58:47 am
#27
Administrator Shining Spammer *

Posts: 1,129

Logged
Networking
Smiley

~Elvenfyre


Old Post August 17, 2005, 03:16:35 am
#28
Job
Shining Light *

Posts: 230

Logged
Networking
I've been trying to eliminate some of the bugs in the prgoram. I just fixed a rough one that was causing the program to deadlock. Apparently if you use threads with Swing components there's a chance the program might deadlock.
An interesting thing came out of this. There was another bug that prevented the chat window from scrolling down whenever text was appended if the chat window did not have the focus. I later found out that this is a bug in Java 1.5.0 (so not my fault), and that there's no current workaround for it. Here's the link to the bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5003402
The interesting thing is that the code that i used to fix the bug that was causing the deadlock also fixed the scrolling bug. I posted a comment in the link above with the code i used, to let other developers know.
But there's still some other stuff to fix.


Old Post August 23, 2005, 05:28:31 pm
#29
Job
Shining Light *

Posts: 230

Logged
Networking
I've gotten to a state right now where everything is running pretty smoothly. The chat app supports multiple connections, it can detect when a connection is remotely closed, it can restart a connection, etc.
I'm thinking of releasing it, once it's finished, as the "Shining Source Instant Messenger" Tongue .
I need to think of a proper interface. I think i'll just model it after some popular instant messenger's interface like Yahoo, AIM... etc. Wink

By the way, i know it's not really necessary to have a Shining Source messenger since everybody here probably already has one they can use, it's just the groundwork for a multiplayer game. Smiley


Old Post August 24, 2005, 02:22:02 am
#30
Administrator Shining Spammer *

Posts: 1,129

Logged
Networking
Sounds like a plan.

So... what's next?? Cheesy

~Elvenfyre


Pages: 1 [2] 3 Print 
« previous next »
Jump to:  

Powered by SMF 1.1.21 | SMF © 2013, Simple Machines