ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
AW_EVENT_CHAT vs. AW_EVENT_AVATAR_ADD woes... (Sdk)
AW_EVENT_CHAT vs. AW_EVENT_AVATAR_ADD woes... // SdkcyborganicSep 17, 1998, 12:29am
Maybe I'm the only one without a workaround to this problem, but here's
my dilemma.... 1. AW_AVATAR_ADD provides you with the AW_AVATAR_SESSION number, which seems to be the main session number. It does not provide you with AW_CHAT_SESSION. 2. AW_CHAT provides you with the AW_CHAT_SESSION number, which I have not found a use for, but not the AW_CHAT_SESSION number. As a result, I cannot link AW_AVATAR_NAME to any of the session numbers, since each is only accessible by one function, not both. 3. Build 5 now lets you access variables such as AW_AVATAR_NAME directly from AW_CHAT and other event handlers, but the name provided is only current in AW_AVATAR_ADD. As a result, when I access AW_AVATAR_NAME from AW_CHAT, it gives me the name of the last avatar to be added, not the avatar that was speaking. The same is true about AW_AVATAR_SESSION. This means that AW_CHAT_SESSION is the only thing that can be linked with AW_AVATAR_NAME. However, AW_CHAT_SESSION is not assigned in AW_AVATAR_ADD to my knowledge. The result of all this is that I have no way of checking the avatar name associated with a chat message, so I cannot access its sender's name. This is very unfortunate, since it means that I cannot respond to messages on a user to user basis. If anyone else has found a way to get around this, PLEASE, PLEASE, PLEASE let me know. Thanks. -Cyborganic roland vilettSep 21, 1998, 9:35pm
[View Quote]
The session number in AW_AVATAR_SESSION during the AVATAR_ADD event is the same as the session number in AW_CHAT_SESSION during an AVATAR_CHAT event for that avatar . I guess the confusing part is that the two different events use two different attributes to convey the session number. >3. Build 5 now lets you access variables such as AW_AVATAR_NAME directly >from AW_CHAT and other event handlers, but the name provided is only current >in AW_AVATAR_ADD. As a result, when I access AW_AVATAR_NAME from AW_CHAT, it >gives me the name of the last avatar to be added, not the avatar that was >speaking. The same is true about AW_AVATAR_SESSION. This means that >AW_CHAT_SESSION is the only thing that can be linked with AW_AVATAR_NAME. >However, AW_CHAT_SESSION is not assigned in AW_AVATAR_ADD to my knowledge. The behavior you describe here sounds like a pre-build 5 version of the SDK. If you are using the DLL from build 5, then the AW_AVATAR_NAME attribute should be correctly defined for the events AW_EVENT_AVATAR_DELETE, AW_EVENT_AVATAR_CHANGE, and AW_EVENT_CHAT. -Roland devon tuckOct 1, 1998, 5:26pm
Funny, I just stumbled across this yesterday. So as Roland said,
the following code will work: void handle_chat (void) { /* printf ("chat: Session %d %s %s NAME: %s\n", aw_int (AW_CHAT_SESSION), chat_type[aw_int (AW_CHAT_TYPE)], aw_string (AW_CHAT_MESSAGE), aw_string (AW_AVATAR_NAME)); */ printf ("%s:\t\t%s\n", aw_string (AW_AVATAR_NAME), aw_string (AW_CHAT_MESSAGE)); } Interesting to note that when I tried to use AW_AVATAR_NAME within a handle_avatar_delete I got a blank string. Devon [View Quote] [View Quote] |