Files
GTSchoolShit/CS2335/lab4/documents/NetPaint_Protocol.txt
2025-06-07 01:59:34 -04:00

56 lines
1.9 KiB
Plaintext

The clients need to be able to know of the following happenings:
1. Their connection has been rejected by the server
2. Another user has joined/dropped from the session
3. The server wants to tell them of an error
4. A user is sending a chat message
5. A user has drawn something
6. A user did an UNDO on something
SRVE - Server error. Rejection, drop, server quitting, etc. Format:
SRVE: Message string
SRVM - Server message. New user, lost user, etc. Format:
SRVM: Message string
HELO - User is joining the server. Format:
HELO: username
QUIT - User is quitting the server gracefully. Format:
QUIT: username
RECT - user is drawing a rectangle. Format:
RECT:msgid:username:startX:startY:height:width:color:fill(y|n)
POLY - user is drawing a polygon. Format:
RECT:msgid:username:color:fill(y|n):numpoints:x1:y1:x2:y2:...
TRIA - user is drawing a triangle. Format:
TRIA:msgid:username:x1:y1:x2:y2:x3:y3:color:fill(y|n)
LINE - user is drawing a line. Format:
LINE:msgid:username:startX:startY:rise:run:color
QUAD - User is drawing a quadratic curve. Format:
QUAD:msgid:username:x1:y1:x2:y2:ctrlx:ctrly:color
ELIP - User is drawing an ellipse. Format:
ELIP:msgid:username:startX:startY:height:width:color:fill(y|n)
TEXT - User is drawing text. Format:
TEXT:msgid:username:startX:startY:size:color:font:text
IMAG - User is inserting an image. Format:
IMAG:msgid:username:startX:startY:height:width:URL
Note here that URL can be either a global URL, in which case we would download the image off the Internet, or just a filename, in which case the users would connect to the client that chose the image p2p and request a download.
UNDO - User is undoing an action. Format:
UNDO:msgid:username:undoid
undoid corresponds to the id of the message we want to undo.
CHAT - User is sending a chat message. Format:
CHAT:username:text