I was wondering why that was doing that. I've got a working "normal"
chat program (ie audible). What I did to resolve the threading issue
is create an addChat function that looks like:
public void addChat(string c){
if(logBox.InvokeRequired){
  AddChatCallback a = new AddChatCallback(addChat);
  this.Invoke(a, new object[] { c });
} else {
   logBox.Items.Add(c);
}
}
with
delegate void AddChatCallback(string t);
at the top. I'd be interested in merging our codebases :)
--Jesse
On 7/7/06, Tom Wilson <[EMAIL PROTECTED]> wrote:

I also forgot to mention: the InstantMessage function in the Avatar.cs file
curently generates a new UUID every time you send an IM. THis causes new IM
windows to open in the recipient's client every time you IM the same person.

The fix is to generate and use the same UUID in your calling function. Since
I'm tracking separate conversations in separate iterations of my ChatWindow
form, I create a UUID when I load the form (or get the UUID from the
incoming IM if the other person IM's me).

the fix in Avatar.cs is to change lines 269 and 279-280:



public void InstantMessage(LLUUID target, string message, LLUUID id)

Packet packet = PacketBuilder.InstantMessage(Client.Protocol, target,
Client.Network.AgentID, 0,

RegionID, Position, 0, 0, id, Now, Name, message, "");

it's probably also a good idea to check id for null and generate a new UUID.
My thought on that was to make id an optional parameter and return the id
back from the function. this way, you could call the function with no ID the
first time, then use that ID in future calls.




On 7/7/06, Tom Wilson <[EMAIL PROTECTED]> wrote:
>
>
> So I'm not the only person working on a chat program?
>
> I started on a chat program today. It's actually at the point where I can
IM anybody in-world, and IM's from in-world show up in new windows. I don't
have a friends list or anything like that, though. I also don't have the
avatar "dressed". The avatar just sits there with the default shape and no
texture.
>
> What I did discover is that since all the network traffic is being handled
on a separate thread, I can't create windows in that thread. So what I did
is create a queue in my main window. An IM received event just pushes the IM
on to the top of the queue. Then a timer in my main window pulls the IM's
off.
>
> I'll probably handle the friends list via a config file, rather than
trying to track your SL calling cards.
>
>



--
Tom Wilson
[EMAIL PROTECTED]
KI6ABZ
_______________________________________________
libsecondlife-dev mailing list
libsecondlife-dev@gna.org
https://mail.gna.org/listinfo/libsecondlife-dev





--
--Jesse

_______________________________________________
libsecondlife-dev mailing list
libsecondlife-dev@gna.org
https://mail.gna.org/listinfo/libsecondlife-dev

Reply via email to