Creating the id is up to you. In my application each user is assigned
an id when they first join gorillapop, so I use that. But you can use
anything -- *so long as it's unique* (an easy one is the use str
(microseconds))
Rooms and usernames will also be up to you. The easiest way would be
to make them a property of "Connection" in the server and modify the
"SendAll" method by adding a line like: "if mConnections.value
(mConnections.key(i)).room = self.room then" and send the message
only to people in your room.
Next you can start creating your own chat protocol sending messages
like "<room>RoomName</room><UserId>id</UserId><msg>Put user message
here</msg>#END
Each Little Client can then strip that apart and display accordingly.
HTH,
L
********************************************************
GorillaPop - Connecting People Through Music
http://www.gorillapop.com/
On Aug 31, 2005, at 3:00 AM, Niccolo Zapponi wrote:
Ok, LAnce.
I understood the little Server / Client app, except for one thing:
how does it give the ID to each connection? Is that the uptime of
the server computer when the socket has been created?
After that, how can I manage usernames and Private chats?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|