Also, there's nothing about CTR in there. See the DSHub manual (http://sourceforge.net/project/showfile ... _id=239994), and this page: http://www.adcportal.com/forums/viewtop ... 95&start=0
Comment comment
I've always assumed 0 is a normal user. I thought it was odd that the spec had nothing explicit though. And yes -1 does pose a bit of a problem, though I would suggest that somebody who is a 'limited user' is not going to be an operator or anything. In any case, it made far more sense to me to put a limited user at the lower end of the spectrum, not at 64 or 128 above hub owner, and ullner seems to think 64 is used but not in the spec... okay.CT user classes in BAN cannot be -1 or 0 because you are allowed to combine values.
There were a couple questions on why BAN and KCK are two commands. Well, because they do totally different things! The BAN message is aimed at preventing users from using certain values that are reported by the INF message, so you cannot call yourself something offensive, or have something offensive in your description. It can also be used for banning certain clients, and setting minimum and maximum share sizes (yes I see no reason in banning specific share sizes, I had ranges in mind. It probably should also include a CT parameter, come to the of it, so that you can apply the bans to different user levels (or somehow say all levels too). That would allow for things like a minimum share size for registered users, but no minimum for operators. The maximum share size would usually be -1 i.e. infinity I think, but I wanted to allow flexibility.Or, at least combine kick and ban since it's basically the same thing except different time.
Good point with the comma's. I wanted to allow multiple values at once and be reasonably easy to parse on the hub side. I guess it isn't much difference though. I just saw that INF SU was a comma-delimited list and I was like yeah that sounds good.It's probably simpler to use separate NItest1 NItest2 etc
Fair call. I guess it's meant to just make it easier to read than having to refer to a table in the protocol when you wanna decrypt a message. Like, hmmm what does REG TY3 mean? But yeah it should only be developers reading the raw protocol shouldn't it.I don't understand why you're so keen on using "strings" when a simple integer will suffice.
I totally agree. Good work darkklorbut I do think that proposals should be ENCOURAGED
Oooo I did not!BTW did you ever look about the extended commands I implemented in DSHub?
Code: Select all
Regex kickRegex = new Regex("(?<field>[a-zA-Z]{2})(?<operator>(?<equal>=)|(?<lessthan><)|(?<greaterthan>>))(?<value>[a-zA-Z0-9]+)");
Match regexMatch = kickRegex.Match(inputParameter);
if (regexMatch.Success)
{
foreach (string user in hubUsers)
{
string fieldValue = GetFieldValue(user, regexMatch.Groups["field"].Value);
int compareResult = string.Compare(fieldValue, regexMatch.Groups["value"].Value,
System.Globalization.CultureInfo.CurrentCulture, System.Globalization.CompareOptions.IgnoreCase);
bool caseMatched = false;
if (!string.IsNullOrEmpty(regexMatch.Groups["lessthan"].Value))
{
if (compareResult < 0)
{
// is less than
caseMatched = true;
}
}
if (!string.IsNullOrEmpty(regexMatch.Groups["greaterthan"].Value))
{
if (compareResult > 0)
{
// is greater than
caseMatched = true;
}
}
if (!string.IsNullOrEmpty(regexMatch.Groups["equal"].Value))
{
if (compareResult == 0)
{
// is equal to
caseMatched = true;
}
}
if (caseMatched)
{
// call or queue kick function
}
}
}
Using <param><number> does not mean simply <param> (in this case 0). That goes for all flags in the protocol. However, as the CT is specfified as it is, well, there's not much you can do about 0 or negative values. Also, I wasn't entirely sure about CT64. There's a fair chance that it's not reserved by any other developer. I haven't given any proof that it's actually reserved (hoping that someone else remembered or found out), so go nuts.darkKlor wrote: I've always assumed 0 is a normal user. I thought it was odd that the spec had nothing explicit though. And yes -1 does pose a bit of a problem, though I would suggest that somebody who is a 'limited user' is not going to be an operator or anything. In any case, it made far more sense to me to put a limited user at the lower end of the spectrum, not at 64 or 128 above hub owner, and ullner seems to think 64 is used but not in the spec... okay.
I fail at seeing the real world usage of 256 user classes... Will there be a hub with 256 users with different power, all of which you (hubowner, operator etc) should maintain? I can tell you right now that that will be a nightmare.darkKlor wrote: CT does not offer much flexibility in setting the user level, yet it seems to be intended for that task. As blastbeat said, what about a VIP or "whatever hubowner xy wants" class. Well, I know my hub allows 256 user classes, but the way I do it is that each user is assigned a RoleId, with Role 0 being the hub. It's not linear like YnHub or other systems either, because each Role is a child of another role, and a user can only be kicked etc by a user with a higher level in the hierachy. Thus you can have Operator as a child of Hub Owner, with Moderator and SuperVIP as children of Operator. A SuperVIP might have fewer powers than a moderator e.g. no kick, but a Moderator cannot kick a SuperVIP because they're both an equal distance from the common parent, Operator. An Operator could kick both a Moderator and a SuperVIP. Anyway, that's just the way I do it. Everything has to be slotted into the CT flag when I send it to other users though.
I understand what you're saying and the idea, while I don't agree. Also, while perhaps not needed in TY, it can be used in REG ME (which is annoyingly strange naming, but I digress) to be combined as CT is.darkKlor wrote: Fair call. I guess it's meant to just make it easier to read than having to refer to a table in the protocol when you wanna decrypt a message. Like, hmmm what does REG TY3 mean? But yeah it should only be developers reading the raw protocol shouldn't it.
I was lazy at the time and copy paste was a shorter solution. The coding was not done with performance in mind, I just wanted to see if it would work and how it would fit into the scenedarkKlor wrote: I kinda think that a function longer than 50 lines is too hard to handle, so it should be broken into sub-functionsAlso, I'm surprised you didn't use a regular expression for the actual parsing.
Users browsing this forum: Google (Crawler) and 0 guests