ID:418513
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Would be nice if developers had an in-game proc to check if somebody is a fan of the game's hub much like checking if they are subscribed so we can encourage or reward them to do so.
Seconded. ed ed ed
Upvoted.
Good idea. We'll see what it takes. I also think we could benefit from more active hub updates, where a proc is called when the hub receives info about a new fan, sub, etc.
This isn't difficult to make yourself. Just use world.Export() to get the fan page for your hub, and then use findtext() to see if their key is on it.
I actually wrote a program to do this. However, my program only lists the MEMBER fans.
It seemed pointless.
Maybe I should upload it as a library.
Library made-> http://www.byond.com/developer/SuperSaiyanX/hubget

It now returns a list of both member and non-member fans.
A somewhat direct database access is going to be quicker and take less memory than having the server load a somewhat large webpage all the time and parsing it.

Not to mention the things Tom mentioned that could be added to it. And it's just a nice addition to the language, I think.
^ agreed
and until that's added, someone could use my library until it's pointless! :D
Text format BYOND hubs can be loaded into a BYOND Savefile and read directly, you know.

The AJAX based reference had comments some of us wrote, an example of how to do that was on the savefile page. I'd link it if I could. =(

[Edit] Hey hey, a fans list doesn't appear in it. A real nice quick-fix would be that list appearing in the textfile hub page. =)
The text format for BYOND hubs doesn't have a list of fans on it... Just a number of how many there are.
In response to Tiberath
Tiberath wrote:
[Edit] Hey hey, a fans list doesn't appear in it. A real nice quick-fix would be that list appearing in the textfile hub page. =)

I was going to initially suggest that, but I decided to plug my own library instead...and yeah. Why else would I write a program to to do all that parsing, if it's easy access? Of course it's not listed on the text format! :(
mob/proc/IsFan()
if(!src.key) return ""
var/http[]=world.Export("http://www.byond.com/games/[world.hub]?command=view_fans")
if(!http) return null
var/fanData=html_encode(file2text(http["CONTENT"]))
if(findtext(fanData,"/[src.key]&")) return 1
else return 0
I'm not even going to respond anymore. Haha. You guys clearly confused this to be a developer help post rather than a feature request. Tom, the request still stands, and your additions would be nice as well.
Nice! Falacy, but would still be better to have a built in function.
I agree, it would be nice to have this built in, but waiting for them to implement some system that you can easily make yourself isn't the most viable option around here. This latest update, for example, has seemingly been in working condition for several months now, but has yet to be released, even though it features an important bug/performance fix and a new system for map_text.
In response to Falacy
Falacy wrote:
falacy's code
Just wondering, but what would be more efficient in terms of memory & speed, using your isFan procedure each time someone logs in, or just getting a list of the fans, whenever the world starts up/at specific intervals?
I would load it at the world start as loading it every time someone logs in will put a strain on the server I would also update every 2 hours ... if you need to...

Although the proc doesn't take long on a local server it would take long if you have a good amount of players as they are also using the connection it could make everyone lag depending on the severs connection.
What if the user has a space or _ in his key? I mean, after using that proc it worked with an alt, but with my main one (this one) it didn't, because the game recognizes me as Eternal_Memories, not as EternalMemories.
Page: 1 2