first commit

This commit is contained in:
Jose Caban
2025-06-07 01:59:34 -04:00
commit 388ac241f0
3558 changed files with 9116289 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

View File

@@ -0,0 +1,76 @@
NetTxt Networking Protocol.
The network messages will be sent between the server and the client in pure text format, for ease of coding and debugging. Some of the messages can only be sent from the server to the client and others - only the other way around, while others still can be sent by the server or by the client.
The messages will be identified by an all-caps message type in the front of the message, and the different parts of each message will be delimited by the escaped unit separator character ( \037 ).
The following things will need to be negotiated over the network:
1. User joining/quitting the server.
2. Chat messages (of the public and private variety).
3. List users in a chat room (public or private).
4. List documents on the server.
5. List sections in a document. (Maybe instead the user should just get the whole document when he opens it up?)
6. Create a new document.
7. Create a new section in a document.
8. Request lock on a section.
9. Release lock on a section.
10. Notify the server that we are starting to view / stopped viewing a document.
11. Request latest version of a section (document?)
12. Transmit latest version of a section (document?)
The messages that will need to be sent are as follows*:
SRVE - Server error. Rejection, drop, server quitting, etc. Format:
SRVE^message
HELO - User is joining the server. Format:
HELO^username
QUIT - User is quitting the server gracefully. Format:
QUIT^username
CHAT - User is sending a chat message. Format:
CHAT^username^docId^text
Here, the docId parameter specifies which chat room the message belongs to.
ULST - The list of users in a chat room. Format:
ULST^docId^usrCount^username1^username2^...
Here, the docId parameter specifies which chat room the list belongs to, and the usrCount parameter specifies how many users there are in the chat room. That one parameter is only needed for parsing purposes.
DLST - The list of documents available on the server. Format:
DLST^docCount^docId1^docName1^docId2^docName2^...
Here, docCount specifies how many documents are in the list (for parsing purposes only), docIdN specifies the unique ID of the Nth document, and docNameN specifies the name of the Nth document.
DCMT - Transfers a document either from the server to the client or from the client to the server. Format:
DCMT^docId^docName^loaded(1|0)^secCount^username^secId^secOrder^stamp^locked(0|1)^secName^secContents
If the load flag is one, then each section also contains all the information pertinent to each section. If it set to 0, then only the section names and ids are transferred.
SCTN - Transfers a section of a document. Format:
SCTN^username^docId^secId^secOrder^stamp^locked(0|1)^secName^secContents
username is the name of the author of the latest update. docId is the id of the document in which the section appears. secId is the id of the section - just a hash key of its name, basically. secOrder is the order in which the section appears in the document. stamp is the timestamp. locked is 0 if the section is unlocked and 1 if it is locked. secName is the name of the section. secContents is the contents of the section.
RMSC - Remove section from a document. Format:
RMSC^username^docId^secId
LOCK - Requests a lock on a section. Format:
LOCK^username^docId^secId
The order in which the section appears in the document is sufficient for the secId.
ULCK - Releases a lock on a section. Format:
ULCK^username^docId^secId
VIEW - Notifies the server that the user has started viewing a document. Format:
VIEW^username^docId
UVEW - Notifies the server that the user has stopped viewing a document. Format:
UVEW^username^docId
UPDT - Requests the latest version of a document. Format:
UPDT^username^docId
* Note that here the ^ character serves to represent the unit separator character, which is \037.

View File

@@ -0,0 +1,61 @@
The server will have a directory termed "the repository" that will contain all of the documents on that server. The files will be arranged as follows:
d) root_dir
|
+- f) doc1.xml
|
+- f) doc2.xml
|
+- f) doc_list.xml
d) here denotes a directory, and f) - a file.
doc_list.xml will be a master document list that will contain a list
of all documents and the names of the directories in which they
reside. Each document will reside in a directory of its own. The
doc_list.xml file will have the following structure:
<documents>
<document id="0001" name="Introduction to NetPaint" />
<document id="0002" name="Introduction to NetTxt" />
<document id="0003" name="NetTxt: Advanced Topics" />
</documents>
The ID will be the hash code of the name of the document and has to
be unique (no two documents with the same name allowed).
docNNNN.xml will be created for each document and will contain the
document itself as well as the list of sections and their contents:
<document name="NetTxt Server File Structure" id="0001">
<section id="0001" name="Introduction" editor="Vladimir" time="2004-02-15 13:39" position="1">
The section stuff goes in here.
</section>
<section id="0002" name="Directory Structure" editor="Vladimir" time="2004-02-15 13:40" position="2">
The section stuff goes in here.
</section>
</document>
The section tags will contain the text of each section. Each
paragraph will be contained within the <p> tags which will specify
the alignment of the paragraph. The <p> tags can contain <b>, <i>,
and <u> tags to denote formatting, as well as the <font> tags which
will allow one to choose font faces and <color> tags which will
allow one to choose colors. The format of the file will be as
follows:
<section>
<p align="left">
The server will have a directory termed <i>"The Repository"</i> that will contain all of the documents on that server. The files are arranged as follows:
</p>
</section>
This file structure will simplify the file reading/writing process
quite a bit. Making a list of documents available from the server
still wouldn't be a problem even, since we would have that list
available form the master doc_list.

View File

@@ -0,0 +1,14 @@
Tuesday
February 17
Have the network messages implemented.
Have the file IO for the NetText formats implemented, as well as for the document list.
Have the basic user and chat functionality working on the server.
Thursday
February 19
Finish up the server.
Implement the UI.
Friday
February 20
Finish the Client architecture design.

View File

@@ -0,0 +1,71 @@
Bugs:
Somehow when we start the server UI, the server starts automatically,
even if we don't push the "Start" button. I don't particularly mind
this now, as it makes the debugging one click faster, but it is a bug
and needs to be fixed. Low Priority.
Sometimes the document list doesn't get updated on the client... I am
not sure why this may be, as I cannot reproduce this one a stable
basis.
The client list in the chat panel looks ugly. It either takes up too
much space, or too little. Fix it!
In all the JLists in general, the text is stuck agains the left
edge. Would be good to add a little margin there.
Testing:
Untested:
NetTextDocumentReader.java - Jose (need client/server)
Everything else, pretty much, too.
Implementation:
Implement network messages. (Andrew, Daniyar)
+ Implement the regular server message. (Maybe do the same
abstraction as in netpaint - AbstractServerMessage with the
children - GenericServerMessage, and ServerErrorMessage.) When I
was writing the protocol, I thought we never used the regular
server message in netpaint, and so exclueded it from the
protocol. While writing the networking code, I remembered what it
was I needed to use this generic message for, and I still need it
here.
Implement file IO. (Jose)
-Implement
Implement document structure. (Jose)
Implement server functionality. (Vladimir)
+ Implement the framework for managing clients - adding, dropping.
+ Implement the Client class.
+ Need to add the document list to the client class when the
document list class becomes available.
+ Implement the client list stuff.
o Implement the chat functionality.
o Implement the document handling functionality.
o Implement Server settings with default values.
+ Still need to add here the defaults for the repository and the
autosave delay.
Implement server UI. (Vladimir)
+ Implement the interactive user list.
o Implement the kick user button.
Shared UI
+ Implement client list.
Client UI:
o Implement it so when the client receives a "duplicate username"
message, it doesn't freak out and drop the connection...
Miscellaneous:
Fill in the package.html placeholder descriptions with real information.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB