## -= TECHNICAL ABBENDUM =-

### IP Address logging in UTeamFix

UTeamFix logs IP Addresses at 2 points of times: at the prelogin() and when the login is complete.

The problem is the method being used. One of the very few working methods to acquire IP addresses via UScript is by parsing the result string of the sockets command. However this method is prone to trouble on a lot of occasions, especially on Coop servers which is why mostly DM-type servers have mods using this method, Coop servers usually don't. There are other methods though, so don't think you can sneak in a coop server now :)

Anyway in the circumstance that more than one player causes a prelogin() event at about the same time, then the IP Address of ONE of them is recorded wrongly!

Why? This is a sychronisation problem. At prelogin, the new client is just added at the end of the sockets list, if the last client cannot be correctly read out in time before another client is added to the list (the 2nd joining player) both readouts will return the same IP Address.

Side note: the faster the server, the less often this will happen. Because of this, the 2ndary routine called at the moment of login completion is the only point of time where the IP Address can be determined with 100% accuracy. But unfortunately even there it fails sometimes, because Unreal isn't always true to itself and rearranges the channel order sometimes.

### History Of The Sockets-Parser

The first sockets parser was very crude and part of Infiltration Cheat Detector by [SixPack]Shambler. It wasn't very reliable at all and often yielded no usable result. Further on the code was just horrible ;-). Nevertheless, it gave me a good starting position to see what the basic idea behind the algorithm is, and fortunately Shambler's code is a lot more beautiful nowadays.

Something I won't forget since it doesn't stop amusing me over the time is HBG's comment on the socket-parsing theory, as he believed it would be impossible to decipher the mess in any meaningful way.

Anyway I tossed away Shambler's code and started from scratch. The result was the first ServerDog mod which could log IPs. On a sad side note this made ServerDog very popular, even though it wasn't intended as an IP logging tool but ONLY as an administration aid.

Looking back at it, the code still isn't very beautiful, but a lot more thought-through and the "mess" character doesn't come to mind anymore. ServerDog's parser was quickly adopted by other tools. As a matter of fact, both IPLogger and KickBan use just that parser. I don't know what's inside SBab but I would dare a wild guess...

In UTeamFix, the very same parser is used again in the IPMaggot which is the class responsible for the job here. This is going to be the final stage of this algorithm, since there is neither point nor possibility to enhance it notably anymore - except for the occasional channel re-arrengament Unreal commits and could use compensation... but this happens once out of 80 times so it will be hard to grab and I'm kinda lazy at even starting the endavour debugging it.