1. I always wondered what the Flag was, in the odch::get_flag() user's function. Is it away / ready ?
2. Is there a simple way to list the users a useable way, like an array or a list ? Or must i make one myself using *_connected and user_disconnected ? If not can we have one in the future ? (check with other users if they wants too).
Thanx in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As far as getting a user list goes, I just read it in from ~/tmp/odchlist - it's not the cleanest way of doing things but it seems to work. You need to read the whole thing in in one go (rather than one line at a time) otherwise the filehandle gets closed.
Looking at the code, this seems to be exactly what the hub does when sending the nicklist anyway.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Joohn,
Of course i'm considering the v0.7.4 odch.
1. I always wondered what the Flag was, in the odch::get_flag() user's function. Is it away / ready ?
2. Is there a simple way to list the users a useable way, like an array or a list ? Or must i make one myself using *_connected and user_disconnected ? If not can we have one in the future ? (check with other users if they wants too).
Thanx in advance.
1: Yes, the flag is a byte, sent with the $MyINFO command that is used to tell if a user is away/ready among other things. Information about which values that corresponds to what can be found at:
http://umn.dl.sourceforge.net/sourceforge/opendcd/directconnect.txt
2: Currently there isn't an easy way to retrieve a list, but it is a good suggestion for the future.
if possible it would be nice to have a function that would take a string "a" and output the user_t for user a
As far as getting a user list goes, I just read it in from ~/tmp/odchlist - it's not the cleanest way of doing things but it seems to work. You need to read the whole thing in in one go (rather than one line at a time) otherwise the filehandle gets closed.
Looking at the code, this seems to be exactly what the hub does when sending the nicklist anyway.
joohn : thx for the flag one ... i see what you're talking about as i also studied the DC protocol before i found ODCH.
smileaf : it was necessary only before v0.7.4, as it now stores users by their names ... so your string "a" equals user_t.
rob1n : thx a lot, i'll try that :)