Teh Mine

From: Matt 4 Aug 2011 22:02
To: Drew (X3N0PH0N) 2831 of 3934
But, but! Caer is Caer, and he'd probably write it in Ruby or something.

To be fair, Andy would probably right it in ActionScript.
From: Drew (X3N0PH0N) 4 Aug 2011 22:11
To: Matt 2832 of 3934
Right it!

But aye, you're write.
From: ANT_THOMAS 4 Aug 2011 22:12
To: ALL2833 of 3934
Only problem being we don't get the DynMap webchat
From: ANT_THOMAS 4 Aug 2011 22:12
To: ANT_THOMAS 2834 of 3934
But I might be able to fix that myself.
From: ANT_THOMAS 4 Aug 2011 22:25
To: ANT_THOMAS 2835 of 3934
Or maybe not :((
From: koswix 4 Aug 2011 22:32
To: ANT_THOMAS 2836 of 3934
aren't the dynmap chat lines written to the log?
From: ANT_THOMAS 4 Aug 2011 22:42
To: koswix 2837 of 3934
Aye, just the way we're stripping the chat out means the DynMap ones get missed. They're formatted differently.
From: Drew (X3N0PH0N) 4 Aug 2011 23:00
To: ANT_THOMAS 2838 of 3934
How're they formatted?
From: Peter (BOUGHTONP) 4 Aug 2011 23:00
To: ANT_THOMAS 2839 of 3934
Why on earth would you want the newest at the top!? :/
From: ANT_THOMAS 4 Aug 2011 23:02
To: Peter (BOUGHTONP) 2840 of 3934
Because pressing F5 and scrolling to the bottom is annoying.
From: ANT_THOMAS 4 Aug 2011 23:04
To: Drew (X3N0PH0N) 2841 of 3934
code:
2011-08-04 22:09:29 [INFO] <RichyBoyWonder> Anyway, G & I are enjoying it
2011-08-04 22:09:40 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?Anyway, night. Will be back tomorrow with no Sian to bother me. She going away for Christening
2011-08-04 22:09:49 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?whie I'm stuck in work
2011-08-04 22:10:00 [INFO] <RichyBoyWonder> I may or may not be around
2011-08-04 22:10:16 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?If you are see you over the  weekend. If not have a good weekend#
2011-08-04 22:10:20 [INFO] <RichyBoyWonder> Visiting G's Dad as he's not too well
2011-08-04 22:10:27 [INFO] <RichyBoyWonder> You too squire
2011-08-04 22:10:30 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?:( Sorry to hear that
2011-08-04 22:10:51 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?Bye
2011-08-04 22:10:56 [INFO] <RichyBoyWonder> Ciao


Also, I've scaled it back so the time is listed still, but then we get [INFO] as well. Trying to find a way to get rid of that.
From: Peter (BOUGHTONP) 4 Aug 2011 23:06
To: ANT_THOMAS 2842 of 3934
Then make it automatically jump to the bottom?


Reading messages upwards is annoying - and confusing when there's no times shown too.
From: Drew (X3N0PH0N) 4 Aug 2011 23:08
To: ANT_THOMAS 2843 of 3934
Ok, gimme a min.
From: Peter (BOUGHTONP) 4 Aug 2011 23:12
To: ANT_THOMAS 2844 of 3934
Is the chat thing itself part of Bukkit or part of Minecraft server?
From: ANT_THOMAS 4 Aug 2011 23:13
To: Peter (BOUGHTONP) 2845 of 3934
Minecraft server I think. Fairly sure there's always chat even if you use the vanilla server.
From: Matt 4 Aug 2011 23:18
To: Drew (X3N0PH0N) 2846 of 3934
Man, I corrected that shit. I blame Android.
From: Drew (X3N0PH0N) 4 Aug 2011 23:19
To: ANT_THOMAS 2847 of 3934
PHP code:
<?
 
$things = file('server.log');
$chats = Array();
 
foreach ($things as $thing) {
	if (strpos($thing, "[INFO] <")) {
		$chats[] = "[" . substr($thing, 11, 5) . "]" . htmlspecialchars(substr($thing, 27));
	} else if (strpos($thing, "[dynmap]")) {
		$thing = str_replace(": ?", ": ", $thing);
		$chats[] = "[" . substr($thing, 11, 5) . "]" . htmlspecialchars(substr($thing, 37));
	}
}
 
$chatt = implode("<br />", array_slice($chats, -30));
echo $chatt;
 
?>


I dunno if those question marks are really there or just an artefact of pasting? If they're not really there the character counts might be out. If they are, then if someone really says ": ?" via the web interface it'll be filtered out (because it's going to be so rare that I can't be arsed to code around it).

That aside, that should work. If you want seconds on the timestamps change those two instances of 11, 5 to 11, 8
From: Drew (X3N0PH0N) 4 Aug 2011 23:20
To: Drew (X3N0PH0N) 2848 of 3934
That'd be much neater with some regex but ... fuck regex :Y
From: ANT_THOMAS 4 Aug 2011 23:20
To: Drew (X3N0PH0N) 2849 of 3934

:D Thanks!

 

The ? are because of pasting, there's some colour formatting from dynmap to make it green.

From: Drew (X3N0PH0N) 4 Aug 2011 23:26
To: ANT_THOMAS 2850 of 3934
What character's really there?