Integrating Happyhour to show real time on a website

  • Nero
  • Nero's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 1 week ago - 3 years 1 week ago #8016 by Nero
This isn't really MUD related per se, more along the lines of website integration with the mud itself.
Basically what I want to do is have my wordpress be able to report any active bonuses

Exactly how this mud has it on their website: ROTJ MUD

I am sure it's related to some php code but I am not really sure how to get started on how to integrate this.

Any help would be much appreciated!
Last edit: 3 years 1 week ago by Nero.

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago #8022 by lacrc
Hmm, the "easiest" two alternatives of doing something similar with circle would be:

- Create a connection with the same Database the site uses (ie. MySQL) and update tables related to bonuses being on or off;
- Create and update files that will be read by PHP to check if the bonuses are on.

Both alternatives would have to be coded from scratch since there's nothing similar on stock TBA.

It would probably be easier to code the file alternative since TBA already has lots of utility functions to work with files (and examples of how it's done throughout the code) but it would demand more coding from the website side to read and process said files.

I would personally go with SQL since you can use the C API Connector from MySQL (and since most sites use MySQL anyway) and it would be easier to be used by the site, but that would probably be a slower alternative than updating a file, performance-wise (even tho I'm not sure that it would be noticeable, working directly with files is definitely faster than using a MySQL API).

Here's the reference for MySQL API: dev.mysql.com/doc/refman/5.7/en/c-api.html

Please Log in or Create an account to join the conversation.

  • Nero
  • Nero's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 1 week ago #8023 by Nero
I was leaning more towards PHP checking to see if bonuses were on I just wasn't sure how to go about integrating this to where the file is linked to the MUD and it updates accordingly. In the long run it may be more trouble than it's worth but I will keep poking at it.

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago - 3 years 1 week ago #8025 by lacrc
But that's the problem, someone correct me if I'm wrong but, currently PHP (or any other client) has no way of accessing that kind information from circle directly since the bonus information is just stored in the memory that circle is using.

Those two suggestions above were way of making the bonus information available so that you can use it somewhere else.

A third suggestion would be to code a way that your PHP could log in to your mud, circle would detect that it was just your web server connecting and then would just send the bonus info (in a way that php could read it) and then disconnect.
Last edit: 3 years 1 week ago by lacrc.

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago #8026 by JTP
On circlemud.org there is a snippet called who2html

If that Can show who is online, Then it should also be possible to show happyhour. Dont know If you Can use that.

Please Log in or Create an account to join the conversation.

Time to create page: 0.099 seconds