|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Feb 26, 2003 4:40 pm Post subject: TCP/IP over Java |
|
|
|
|
MGB EDIT: Split from Chatnut Client
Will you be releasing the source code?
(I've been working with bridge.dll and it has a similar protocol, but TCP is so much more complicated than UDP in Java since it's a stream and not a packet.)
|
|
Back to top |
|
|
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Wed Feb 26, 2003 7:50 pm Post subject: |
|
|
|
|
TCP is hard in Java?! I specifically made it simple text over TCP so that it's easy to deal with. Just make a BufferedReader from an InputStreamReader from the socket input stream and call readLine() on it, then use String.split (the two-arg version, so you can specify a limit). Easy. Requires 1.4.1, but that's been out for a while.
Ok, I made both protocols use the same arena name limitations.
I'm not sure what you mean by "team" vs. "freq" chats. Do you mean your own team vs. an enemy team? I wasn't sure which way to go on that.. I think the current way (having them be the same) in the protocol makes the protocol and server simple but might require additional work on the client. But it's really not very much more work, so I think I'm going to keep it.
The protocol, or at least the current impl. certainly needs more work, though: private freqs aren't currently hidden, and I don't think the server supports chat clients changing freq at all. All the ideas I've heard for how to handle private freqs sound hacky to me, so I'm in favor of not handling them. That is, all freq numbers get sent as they are, and everyone knows all freq numbers. Don't worry; this isn't as bad as it sounds: The freqowners module already allows people to kick unwanted people off of their priv freqs, and I'd like to write a password-protected freq system eventually so unwanted people can't even get on in the first place. Comments appreciated on all this.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed Feb 26, 2003 10:46 pm Post subject: |
|
|
|
|
Grelminar wrote: | TCP is hard in Java?! I specifically made it simple text over TCP so that it's easy to deal with. Just make a BufferedReader from an InputStreamReader from the socket input stream and call readLine() on it, then use String.split (the two-arg version, so you can specify a limit). Easy. Requires 1.4.1, but that's been out for a while. |
The Connection was REALLY easy. Smong, what do you mean? Are you afraid of streams or something?
Quote: |
Ok, I made both protocols use the same arena name limitations.
|
Ok, good
Quote: |
I'm not sure what you mean by "team" vs. "freq" chats. Do you mean your own team vs. an enemy team? I wasn't sure which way to go on that.. I think the current way (having them be the same) in the protocol makes the protocol and server simple but might require additional work on the client. But it's really not very much more work, so I think I'm going to keep it.
|
Ok, just a suggestion.
Quote: |
The protocol, or at least the current impl. certainly needs more work, though: private freqs aren't currently hidden, and I don't think the server supports chat clients changing freq at all. All the ideas I've heard for how to handle private freqs sound hacky to me, so I'm in favor of not handling them. That is, all freq numbers get sent as they are, and everyone knows all freq numbers. Don't worry; this isn't as bad as it sounds: The freqowners module already allows people to kick unwanted people off of their priv freqs, and I'd like to write a password-protected freq system eventually so unwanted people can't even get on in the first place. Comments appreciated on all this. |
There are several things that don't work. Ship status updates are never sent... _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Feb 27, 2003 4:40 pm Post subject: |
|
|
|
|
Ok, im afraid I didn't look that hard at your code, but instead Im posting my ChatConnection class for you to adapt, shoudn't be too hard, just remove the chat specific functions and add your own.
BTW: Single line {s are a lot easier to read, but whatever floats your boat...
I realize that this isn't great code ATM, the intface should really be a Vector of interfaces, and the ChatConnection class should really extend a super Connection class.
connect.txt - 5.01 KB
File downloaded or viewed 95 time(s)
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Mar 04, 2003 5:33 pm Post subject: |
|
|
|
|
By adapting my bridge.dll communicator for Chatnet succesfully I've come to the conclusion that bridge.dll uses some different code to ASSS which makes it not work with Java's readLine() (at least 1.3.1 anyway).
|
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 918 page(s) served in previous 5 minutes.
|