TheLunarFrog/LagMeter — pull request #5 by dequis (2013-05-02 07:35:58+00:00)
Title: Fix ping command, allow sendMessage to non-players, fix pom.

Okay damn I'm tired and I don't know why I even bothered patching this stuff. Someone on #craftirc asked me to fix /lag so it would show up through craftirc, not in the server console. After fixing the pom that evidently nobody uses, I opened the main source file and noticed that the code didn't seem to be beautiful. I don't want to be rude, but my first reaction was "oh god this is shit i'll try to get the fuck out of here as soon as possible".

So I patched sendMessage quickly, and before closing the file I made a terrible mistake. I saw the function above the one I changed and noticed a warning message which made no sense. Which seemed to be dumb. Which seemed to indicate that someone was doing something very, very wrong. Or that someone slept through the comp sci classes, particularly when they explain the big O notation. Or that someone didn't understand the concept of an event loop and what happens if you run blocking function calls inside one of those. Or that someone wrote a method that literally pauses all of the server ticks for one or several seconds, creating massive amounts of lag from a plugin that is supposed to monitor lag itself to help server admins prevent it.

Of course that was just a bunch of quick assumptions I made when reading a message that said that the amount of ping packets had to be limited to 10. Who knows if those are correct...

Heh, I was the one who usually replied to people who said "lagmeter creates lag!!!1" saying that it was bullshit FUD and that there was no way the plugin could do that. Maybe it was possible after all...

So have a pull request.