I'm having an issue where onBuddyList isn't called when the buddy list is received. I have SFS Pro 1.6.6 and the latest SFS_CSharp, version 1.2.3.
Here's my code. Note that "RegisterCallbacks" does appear in my output, and "OnBuddyList" appears if I call SFSEvent.onBuddyList myself.
Code: Select all
private void RegisterCallbacks()
{
Debug.Log("RegisterCallbacks");
SFSEvent.onBuddyList += OnBuddyList;
}
void OnBuddyList(ArrayList buddyList)
{
Debug.Log("OnBuddyList");
// More processing on buddyList here...
}
//And elsewhere...
SmartFox.Connection.LoadBuddyList();
//Where SmartFox.Connection is our instance of SmartFoxClient
Server output:
INFO | jvm 1 | 2009/09/16 15:51:05 | 15:51:05.242 - [ INFO ] > { DATA IN } : <msg t='sys'><body action='loadB' r='-1'></body></msg>
INFO | jvm 1 | 2009/09/16 15:51:05 | 15:51:05.244 - [ INFO ] > { DATA OUT } : <msg t='sys'><body action='bList' r='-1'><bList></bList></body></msg>
Client output:
FriendListControl: Update - Need to get friends list
[SFS DEBUG] [Sending]: <msg t='sys'><body action='loadB' r='-1'></body></msg>
[SFS DEBUG] [ RECEIVED ]: <msg t='sys'><body action='bList' r='-1'><bList></bList></body></msg>, (len: 69)
[/code]
So, it received the 'bList' from the SFS server, but my OnBuddyList function never got called. My buddy list is empty, but that shouldn't make a difference. Also, if I don't add my function to onBuddyList, I don't see "Trying to call onBuddyList, but no callback is registered" printed either. Could there be some bug in the SFS_CSharp code that's supposed to generate the onBuddyListEvent?