Ticket #39 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

TWDbot = Extra IP/MID (Accounts) and !Resetname bug...

Reported by: RiiStar Assigned to: dugwyler
Priority: normal Component: Bots - Other
Version: Latest version from repository Severity: critical
Keywords: Cc:

Description

When adding extra comps (IP/MIDs) the bot should check table to see if its already added… So it doesn't obtain double up entries…

When doing !resetname it should also be deleting all IP/MIDs associated to that user in the table…

Attachments

Change History

04/03/07 17:20:23 changed by dugwyler

  • priority set to highest.

Looked at the code of this one.

I'm not sure why !resetname wouldn't delete all the IPs and MIDs associated with the user, so long as the ID still matched. It first updates the reset times of any matching IDs:

UPDATE tblAliasSuppression SET fdResetTime = '"+time+"' WHERE fnUserID = '" + id + "'

Then regularly a check deletes names that are in the waiting queue and past 24hours:

DELETE FROM tblAliasSuppression WHERE fdResetTime < DATE_SUB(NOW(), INTERVAL 1 DAY

The instant mod version is not all that different:

DELETE FROM tblAliasSuppression WHERE fnUserID = "+m_fnUserID

Unless for some reason they are given a different ID each time a new IP or MID is added?

Also, what's the command that adds in extra computers? I can't seem to find it, so I have no idea how the alg works.

04/03/07 17:20:47 changed by dugwyler

  • priority changed from highest to normal.

04/03/07 17:55:52 changed by RiiStar

Type :TWDBot:!add name:playername ip:newipaddy mid:newMID

NOTE SPACING ON THE COMMAND! 2 spaces between 'playername' and 'ip' and 'newipaddy' and 'mid' are required!

These html forms usually remove the extra space/whitespace in the above string… this is posted on the TWD Staff (private) forum.

04/03/07 18:09:05 changed by RiiStar

Btw, this new bit was an addition by Ikrit/Jacen when he changed the sign up procedure on the bot a year or so ago.

It stores all the new ip/mids into a table on tw.org If i wasn't busy/or feeling lazy i could try searching the database for duplicate entries, but it'd still take a long time.

Rudy usually finds them on the bot and cleans em up, well he did when i did it last. The bot doesn't tell u when it completes some of the new tasks, so u don't know if it worked or not and try it a few times till u realize it does.

The double spacing usually throws most of us off when we're using the command, still not used to it. =]

04/03/07 19:46:03 changed by dugwyler

Ok, checking over the code. It's a weirdly written bit, made so you can do something like:

name:soandso ip:ip#1:ip#2 mid:mid1:mid2:mid3:mid4

Yet of course I doubt it's ever actually used this way, so the syntax of the command just becomes silly.

I think Ik did the doublespace thing because names can have spaces in them. If you want, I could just make the command accept only single IPs and MIDs, with no tags. For example, "!add priitk:192.168.1.1:1123981" … might be a little easier. I dunno. Let me know if that's even worth the effort. It does reduce the functionality a little.

How often does it not tell you when it's added something? A line like this should be displayed at the end of every !add:

m_botAction.sendSmartPrivateMessage(staffname, "Added, IP+MID: " + IP + "+" + mID);

Maybe there's something malformed in the queries that's making them take quite a while to execute, and so the message sometimes doesn't get printed?

04/04/07 02:25:29 changed by RiiStar

Quite Possible. The help on the bot also needs an update me thinks, adding the new commands into the help msg.

04/04/07 06:11:01 changed by dugwyler

  • owner set to dugwyler.
  • status changed from new to assigned.

Figured out the !resetname bit — it's not removing the entries that !add makes, as that's done to a different table. Really would have thought Ik would have taken care of that. I'll look a little more at the DB structure before tackling this.

So, I'll:

1. Add !help messages (amusingly !add says to use !help if you don't know how to use the command, hahah) 2. Remove IP and MID entries made by !add when a name is unregistered 3. Have !add check for prior entries before adding new ones 3. Check the !add query for possible problems. SQL is not my strong suit, but I can at least manually query and observe completion times 4. Put the help messages before the query, so at least if it is taking a while, you'll still get a message saying it's successfully added. I might change these to background queries if they do seem to take too long, as otherwise they'll really slow down the bot. They have one nested query in them, which might be why it takes such a long time…

Can you tell me:

- Do you find you ever get spammed with multiple !add messages after you've done a few in a row with no response?

- Do sometimes you really just don't get the responses at all?

- Are you able to use TWDBot for any other commands immediately after you've done an !add?

Thanks

04/04/07 17:19:34 changed by RiiStar

- Do you find you ever get spammed with multiple !add messages after you've done a few in a row with no response?

Usually No. I Think its cos the bot becomes somewhat unresponsive.

- Do sometimes you really just don't get the responses at all?

Sometimes not at all, we do have problems with the bot taking along time to do anything at all.

- Are you able to use TWDBot for any other commands immediately after you've done an !add?

Depends, sometimes yes, sometimes no. for the same reasons as above. When the bot becomes unresponsive we cant even !register <name> and stuff, or think we cant because the bot is going so slow. Its happening more frequently too. When this usually happens i try spawning twdbot from king (Gammabot1) to use while queen's isn't responsive.

04/04/07 18:15:36 changed by RiiStar

Also !resetname doesnt say anything after task is completed. I did it a min ago :]

RiiStar> !resetname Imperative

[No msg back]

RiiStar> !info Imperative TWDBot> The name 'Imperative' has not been registered.

04/05/07 16:30:32 changed by dugwyler

Fixed !resetname.

Just found a BIG thing with !add, !removeip, !removemid, and !listipmid … the data is never used by anything but those commands! The table tblTWDPlayerMID is only referenced 6 times in all of TWCore, and it's only inside the code of those 4 commands. This means that all of the adds … add up to nothing.

The feature set was never finished — it's just a user interface at the moment… stores the info and never checks it. How long have these commands been in? Has there been ever any evidence they work?

The queries look fine, executed perfectly. As far as removing info added with !add when a name is unregistered, or checking for new entries, at the moment it's a moot point… I can make a lot of TWDBot's queries background queries, though, so that they won't block the process and other commands can still go through while the slow queries run.

04/05/07 20:02:38 changed by RiiStar

Err since TWD last did a full reset of everything including users/squads? A year or so?

My understanding the info in tblTWDPlayerMID is to stop users registering if either IP and MID doesnt match. I think that is the case, and perhaps it should be IP or MID matches?

I haven't studied the code that much myself, only abit when i was making the website for twd's ban lists etc, which also interface with the bot (well queens database - you know what i mean) so i could see what queries it used.

If you can (or i will) speak with Reaver (current TWD Smod) because the signup is still flawed, tho being better than it was. He'd know of any discrepancy's with the process and those varibles that let those users avoid the signup check and register more than one name.

The info in that table is also if an account already has a similar ip/mid it would tell the op and we'd have to manually add the new computer to the system/table?

04/05/07 20:27:58 changed by RiiStar

Another one brought up. When a name is reset, and later re-registered.

Can we update the date that it was registered?

4:RiiStar> TWDBot> 'riistar' IP:121.72.3.136 MID:1951888911 ENABLED. Registered 2004-01-17

4:RiiStar> if re-reg'd 2day it would be

4:RiiStar> TWDBot> 'riistar' IP:121.72.3.136 MID:1951888911 ENABLED. Registered 2007-04-05

04/06/07 05:55:42 changed by dugwyler

If you find any code at all that uses tblTWDPlayerMID, I'd be grateful. Any info you can get out of Reaver would be great too. I'll try to talk to him as well, though I'm not able to be on [SS] much.

The update of the registered date shouldn't be too tough.

04/07/07 19:59:46 changed by Reaver

I think currently when you register, the TWDbot checks to see whether your MID AND IP match with someone currently registered. If only the MID OR only the IP match, it lets you register.

I think it would be better if it checked if MID OR IP matched when you register. If either or match, then you should need to contact a TWD Op in order to be force registered. I've seen people able to register on IPs that are already registered because they are on another computer (MID) at the same location. This is bad.

I'll try to think of more fixes that need to be done, thanks for the great work so far!

04/08/07 09:09:59 changed by dugwyler

Got the change in for MID or IP match preventing a register (it was on another ticket that I believe Mav started). You're right, dual-registration would not be terribly hard, especially considering Continuum is a small download and easy install!…

Are there any requirements for people playing on the same IP and MID that they register from? Or at least some kind of log when they are playing with a different IP and/or MID?

As far as this particular ticket is concerned:

- !add doesn't seem to have any effect inside TWDBot itself — it's added to a table that's never read by the bot, at least, making it appear useless. Do you know if data entered with !add is used on the website? Also, would the change to disallowing registrations if an MID OR IP match change the need/use of an !add command for additional IPs and MIDs? I have no idea how this command was meant to work. Any help you can give would be appreciated.

- Rii mentioned that the signup itself might be flawed. Any insight here? For example, I have no clue why a player has to first !signup and then afterward !register — seems redundant? It looks like the !signup part was there first (written or originally associated with PriitK, no less), and then someone came and added !register afterward. What's the difference between them?

(follow-up: ↓ 17 ) 04/09/07 11:50:38 changed by dugwyler

Ugh. TWCore.org timing out deleted what I entered…

The short of it is:

- The current running MatchBot seems to have code in it that is not in the repository. Very nasty. But, !add does work. - If you sub in a player rather than just add at the start, you can get by the MatchBot IP/MID check. - I'll have !resetname remove the entries that have been made with !add. - About checking for double entries on !add … should it count as a double only if both IP and MID are already in there, or also if just one is in?

(in reply to: ↑ 16 ) 04/09/07 12:57:24 changed by Reaver

Yeah I've heard about players being able to be subbed into the game, but not being able to be added at the beginning. I'd like to have that glitch fixed if possible, so that it uses the same info for subs as it does for adding players.

I'm not sure about the signup, but Im pretty sure that anybody can !signup at anytime, and also, thats how people set their passwords. Whereas not everybody can !register, and not everybody can register at any time. If both MID and IP match one stored in the databse, they cant register, that's something I wanted to get fixed with my previous post about how if either match one in the database they shouldnt be able to register without TWD op aid.

If you see that I'm on please have no hesitation to talk to me and ask any additional questions. I'm not sure exactly what you're asking in your very last question.

08/22/07 14:15:44 changed by mirrorrim

Read all the comments, not sure if this is being looked at:

!removeip and !removemid commands do not work. The bot says that the ip/mid is removed but after checking with !listipmid the "removed" ip/mid is still there. This relates to the !resetname problem too and would be nice to have working. Thanks for all the hard work :)

08/23/07 07:53:35 changed by dugwyler

The !removeip and !removemid commands currently both run background queries, whereas !listipmid runs a foreground query, so if you do a remove and then a list right after, chances are the removed one will still show up. I'll change the removes to foreground queries, as well as the add, just to be safe. They're pretty simple queries so this shouldn't be a problem — you may just see TWDBot pause very slightly when it does an add or remove (a foreground query blocks the process from doing anything else).

It's true that !resetname is still not resetting on time? Any more info on when/how it fails? I can't remember if anything was done about this problem.

New registrations should at least be blocked from registering if either an IP or MID matches an existing one, not requiring both … is this working?

FYI, the updates for the adds and removes will not show up until Queen is updated again.

08/23/07 08:04:58 changed by dugwyler

Ah, I see the piece on !resetname above now. 4 and a half months and one forgets a bit what's being worked on:

  • In order for !resetname to work the way you want, should all entries made with !addipmid be removed for that name? (The only time I seriously played in TWD, short of 3 or 4 matches, was before MatchBot was written, and don't really know how all this is supposed to work.)
  • I'll check out !sub in Match bypassing IP/MID checks.
  • Something about double IPs or MIDs when doing !add? "Should it count as a double only if both IP and MID are already in there, or also if just one is in?" I wrote that, but don't know what it refers to exactly.
  • Will update the date registered after !resetname has been used

08/23/07 08:26:27 changed by RiiStar

Yes when a name is reset, it should really also delete any extra ip/mid from the PlayerMID table also…

Can it also check when adding IP's or MID's to see if there is already a row with those details?

Id say if there's a row in the table that has ip + mid in there don't add it again?
They shouldn't really be trying to move their computers from one place to another and have it registered?

I'm not sure, since laptops can be on the move…
So Perhaps if the computer is at a new ip with same mid then continue? Whats your judgment?

08/23/07 08:40:58 changed by dugwyler

Ok, having it delete everything from the mysterious tblTWDPlayerMID table on !resetname (which I still can find no reference to except inside TWDBot). MatchBot is not checking this table, and TWDBot is just inserting into it, updating it, deleting from it, or listing its contents. Must be a website thing.

Can definitely check if there's already a row with the details the TWDop is trying to enter. I would say just on a gut level that unless the exact entry is entered, the mod should be able to enter it — so if an IP & MID combo is added, just check if the combo exists; if IP w/o MID is added, check for any row containing that IP; MID w/o IP, check for any row containing that MID. That should hopefully eliminate dups. As for the rest I'd hope we can rely on the good judgment of the TWD Ops… because I have little idea where or how this table is used.

Or, are you talking about tblAliasSuppression here, and not the table modified with !addipmid?

08/23/07 17:07:45 changed by RiiStar

From my understanding, the AliasSupression table is for twd users which is checked to see if there is already a row with the same details for games and at registration…

PlayerMID table is supposed to be referenced for extra computers/locations/ip's when playing TWD… Like A sibling using a 2nd computer at one house hold etc…

08/24/07 12:36:23 changed by dugwyler

Here's what I can tell happens in MatchBot: when the aliasCheck CFG option is set to 1, it's verified in MatchTeam's playerAllowedToPlay method that a player is both registered and enabled. This is ensured through checking AliasSuppression when registering/enabling in TWDBot. MatchBot itself does no calls to AliasSuppression, it looks like (even when using DBPlayerData — only the old bot for TWL calls DBPlayerData's aliasMatch method).

As for tblTWDPlayerMID, it's only referenced in TWDBot and is never referenced in any part of MatchBot or DBPlayerData. Unless the website uses this, all entries made in here are worthless.

There's one final possibility: that the Queen MatchBot code is not on SVN. Does MatchBot ever seem to say anything along the lines of, "You can't play because your IP/MID don't match your record"? If so, can you provide the text? I'll search the code for it — if it's not there, then we're in a bad position. But that would explain a lot of things.

08/24/07 14:54:06 changed by dugwyler

Mav and I have isolated this to probably being some sort of fork in the code… hopefully we'll know more soon.

08/24/07 15:00:56 changed by RiiStar

'im pretty sure, that the twd matchbots tell you that you cant play if ur details don't match whats recorded by ur name, or if you don't have any ip/mids added on top of those from registration… so it must reference it somewhere!

Im not surprised that ikrit never put his changes to the code library, he was lazy…

(follow-up: ↓ 30 ) 08/24/07 15:20:07 changed by dugwyler

Do you know if we can get that code, or if Ik is still around and we could nab it from him?

08/24/07 21:00:02 changed by Reaver

Yeah, if I understand correctly it wouldn't surprise me if the most up to date code isn't in the code library. As I had said before, and this was explained to me by Weaver or Ikrit (I can't remember which right now); When a player registers it get's their MID and IP and stores that info in some database that matchbot's call on (as well as TWDbot). It calls on the info every time someone attempts to play the player in a TWD match, if your IP or MID doesn't match then you can't play 90% of the time. I have heard of a few people being able to play even though an IP or MID doesn't match. I also know that the code also allows people to be subbed in if their IP and MID don't match, he slacked on the code a bit I guess there and didn't think of this. I'll try to get you the exact message it sends when it disallows someone to play so you can search the code for it.

08/25/07 12:32:29 changed by MirrorriM

Something interesting happened when I tested commands on a player:

did a !fullinfo and a !check, got same results:

IP:84.82.126.98 MID:795154392

Then did a !removemid, bot tells me the mid is removed. !listipmid says the mid is still there (I gather Queen hasnt been updated yet). Then I did !resetname and !register and the person tells me this:

TWDBot> Added, IP+MID: 84.82.126.98+795154392

I do another !listipmid and it seems the info was duplicated: TWDBot> Results for:

TWDBot> IP: 84.82.126.98 mID: 795154392 TWDBot> IP: 84.82.126.98 mID: 795154392

(in reply to: ↑ 27 ) 08/28/07 00:15:56 changed by Maverick

Replying to dugwyler:

Do you know if we can get that code, or if Ik is still around and we could nab it from him?

RiiStar reported in the TWSDX ticket that he got the Matchbot code from Ikrit, I will either merge it with our matchbot or import it into the repository soon.

09/09/07 06:04:37 changed by dugwyler

I've updated TWDBot to disallow duplicate entries to be made w/ !add. Regarding the updating of registration dates, I don't think I'll touch it, as it's stored in the ubiquitous and esoteric "tblUser" that is used by a very large number of classes.

This leaves !sub in MatchBot to be checked out.

Also, I noticed from the comments in past that at one point !add was stalling the bot for a long time, and that I switched the queries to background because of this. Recently because entries made with !add weren't immediately showing up on !listipmid I put them back to foreground queries, which can sometimes block a bot and cause it to appear to lag. If this becomes a problem again, let me know and we'll switch to background queries again, with a message in !listipmid that the data may not be perfectly up-to-date (within 5-10 minutes).

02/05/08 08:21:14 changed by dugwyler

The !sub problem is discussed in another ticket, so it looks as though everything in this one is OK from what I understand.

02/05/08 08:21:37 changed by dugwyler

  • status changed from assigned to closed.
  • resolution set to fixed.

Add/Change #39 (TWDbot = Extra IP/MID (Accounts) and !Resetname bug...)




Change Properties
Action