Development > Coding and development discussion

Tracking online and join status

(1/4) > >>

Alreadythere:
Seeing all the modules tracking members online as well as people joining the bot channel, I think it would be sensible to create one central online instance.

The instance would need to do the following things:
1) Add buddies logging on and remove buddies logging off. It has to differentiate between members/guests, chars on notifylist and other characters (like for !is checks).
2) Add characters joining the pgroup, and remove them when leaving.

Personally I favor the approach to put this information into a table, as it would allow all kinds of queries for other modules fairly easy. The table should contain relevant informations (prof, faction, level, ai-level, breed, org) for other modules.
Other approach would be to save this information in an array and add some interface to access this. This wouldn't allow easy queries though.

Modules that want to do anything with people online or in chat group would just have to query this table then, without any need to do the tracking and adding themself. Modules using those information are the Online module, the Count module, the Team module, and the new SB module just getting written.

Things like the logon information or information on joins could be put into the module or stay in their own modules, they just act on one of those two events anyways.

Pharexys:
thats a ubah idea :P i had to make separete colums for that info :P

Khalem:
Im starting to get scared now.

Ive spent the past few days thinking about this myself. However, while i want an online list in the database for several reasons, however im debating if an array to store general information about all online users is a better way than using the database. As such i am very open to feedback on the subject.

Alreadythere:
Personally I prefer the databased solution.

Local arrays would be faster and produce less overhead. I doubt you'd notice the speed advantage though, and no clue how big the overhead by querying the database really is.

But seeing that bots aren't that time critical (at least not compared to the usual response times of the database) I think the advantages speak for the database solution.

Any kind of query done will be much easier to code, and most likely in the end be faster. A select x from table where y order by z is pretty intuitive, definitly gets the right result, and easier to write then any queries in the array based solution.

Wolfbiter:
I have online cell in my members table already, have news, leadernews and realname cells as well.
I also don't wipe the list each time a roster updates, to work with the new org. msg. channel for people that join/leave org, so they're added/deleted right away instead of having to wait for the main db to update.

Navigation

[0] Message Index

[#] Next page

Go to full version