When I start the application, I'm able to initialize the buddylist, play with it perfectly... everything is fine.
The problem is that I need to refresh the properties of sfs.buddyManager.buddyList live during runtime- since buddies will be added to/removed from the database storage at runtime.
When I try to re-initialize the list, I get:
[SFS - WARN] InitBuddyRequest error Buddy List is already initialized.
And the SFSBuddyEvent.BUDDY_LIST_INIT event is never fired....
Please help!
Thanks...
Re-initializing / Updating BuddyList - Fail!
Hi. When you initialize the buddylist, what the server does is loading the buddylist, so why do you need to reload the whole buddylist? Isn't it better if you do the changes also to the buddylist when you do them to the database?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
The changes to the database are done via serverside logic, not necessarily triggered by the user themselves...
They have no way of knowing when this change happens, but they only need to know before creating a room basically.
I could try pulling the real buddylist via a database call, then comparing with what's in the BuddyListManager so far, and add/remove via the API as necessary... but before I try that:
1) will it work? (i.e. addbuddy when the buddy is already added on the backend)
2) Is it really the most elegant solution? A simple ReInitialize or Destroy()/Initialize() or some way of resyncing the buddyList array would be much better imho...
They have no way of knowing when this change happens, but they only need to know before creating a room basically.
I could try pulling the real buddylist via a database call, then comparing with what's in the BuddyListManager so far, and add/remove via the API as necessary... but before I try that:
1) will it work? (i.e. addbuddy when the buddy is already added on the backend)
2) Is it really the most elegant solution? A simple ReInitialize or Destroy()/Initialize() or some way of resyncing the buddyList array would be much better imho...
What i was suggesting is, when you, for example, add a buddy on your server-side logic, you also add the buddy to the user's buddylist.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Ah- there's a critical piece of the puzzle missing in my description.
"Serverside Logic" here is all driven by the webserver, not SFS.
I.e. someone calls example.com/addbuddy?username=foo, and it gets pushed into the BuddyListStorage database.
If there were a hook from that webserver into the Java Extension... then I think your solution of calling serverside AddBuddy would work...
1) Is that correct?
2) Is there such a hook?
3) If there isn't, how can a single rusty Java programmer create one reliably in 2 hours or less?
"Serverside Logic" here is all driven by the webserver, not SFS.
I.e. someone calls example.com/addbuddy?username=foo, and it gets pushed into the BuddyListStorage database.
If there were a hook from that webserver into the Java Extension... then I think your solution of calling serverside AddBuddy would work...
1) Is that correct?
2) Is there such a hook?
3) If there isn't, how can a single rusty Java programmer create one reliably in 2 hours or less?
Ah i understand now. Well, I'm pretty sure there is a way to comminicate with an extension from the webserver... In SFS1x it was possible...
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
I have an interesting idea...
1) Create a reserved room on the system called "ControlRoom"
2) Create a Room-Level extension which is only for that room
3) Give this room a password which is only known to the backend webserver
4) When the webserver needs to update a buddy list, it connects to SFS and joins this room- while loading the extension (extension will only allow a specific username, and that username must pass the authentication of the Zone-level pw check)
5) Extension processes specific commands... like addbuddy() and removebuddy(). Perhaps even other administration-like functions such as KickBanUser, etc.
Questions-
1) What'ya think?
2) If this is a good idea, is there away to optimize so that it doesn't require reconnecting each time? I.e. a way to maintain a persistent connection? backend environment is .NET/IIS
1) Create a reserved room on the system called "ControlRoom"
2) Create a Room-Level extension which is only for that room
3) Give this room a password which is only known to the backend webserver
4) When the webserver needs to update a buddy list, it connects to SFS and joins this room- while loading the extension (extension will only allow a specific username, and that username must pass the authentication of the Zone-level pw check)
5) Extension processes specific commands... like addbuddy() and removebuddy(). Perhaps even other administration-like functions such as KickBanUser, etc.
Questions-
1) What'ya think?
2) If this is a good idea, is there away to optimize so that it doesn't require reconnecting each time? I.e. a way to maintain a persistent connection? backend environment is .NET/IIS
Isn't a zone-level extension better? Also, sorry i never worked with a webserver, so i don't know how to make it connect with sfs. But i can google it
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Well, to optimize you only need to send from the webserver the essential info, like for example cmdName ("addBuddy", "removeBuddy", etc) and buddyName ("rjgtav", "omnivibe", etc). And you would only have 1 function to handle all the webserver requests.
After this, i think the only optimization may be the protocol used to send the data between the webserver and the server.
After this, i think the only optimization may be the protocol used to send the data between the webserver and the server.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
It looks like the way to communicate between jetty and sfs hasnt changed from sfs1x and sfs2x:
viewtopic.php?t=10332&highlight=jetty+extension
viewtopic.php?t=10332&highlight=jetty+extension
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Probably yes. I dont know if there's a better way
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Return to “SFS2X ActionScript 3 API”
Who is online
Users browsing this forum: No registered users and 12 guests