realbasic-nug
[Top] [All Lists]

Re: Some questions and help about CHAT!

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Some questions and help about CHAT!
From: Niccolo Zapponi <nicky at nosrelo dot it>
Date: Wed, 31 Aug 2005 14:51:34 +0200
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20050830134052 dot 23198D07B18 at lists dot realsoftware dot com> <E9C8AE83-150B-4D83-BA29-A44263D3634D at farhner dot com> <0D067786-2149-4001-8DAE-8EA9DE867C99 at neuropop dot com> <FD665C71-4C16-40DA-9C04-E9092413818E at nosrelo dot it> <46E00B8C-544B-4DD3-8A92-5100384A94B3 at neuropop dot com>
And how do I create the rooms? I mean, I think there must be a command like "<cmd>newroom</cmd><room>RoomName</room>#END" and then another one for a client to connect to it.
Am I right?

Can you please explane me this part?
"if mConnections.value(mConnections.key(i)).room = self.room then" and send the message only to people in your room.

I didn't understand if what...
Thank you

Nick

Il giorno 31/ago/05, alle ore 14:31, Lance Massey ha scritto:

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>


_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>