Games (inc Online)Teh Mine

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
38140.2829 In reply to 38140.2828 
$things = array_reverse(file('server.log'));

Should do it?
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
38140.2830 In reply to 38140.2829 

I've sorted it anyway

 

There was once place I hadn't tried :)

0/0
 Reply   Quote More 

 From:  Matt  
 To:  Drew (X3N0PH0N)     
38140.2831 In reply to 38140.2827 
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.

doohicky

0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Matt     
38140.2832 In reply to 38140.2831 
Right it!

But aye, you're write.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  ALL
38140.2833 
Only problem being we don't get the DynMap webchat
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  ANT_THOMAS     
38140.2834 In reply to 38140.2833 
But I might be able to fix that myself.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  ANT_THOMAS     
38140.2835 In reply to 38140.2834 
Or maybe not :((
0/0
 Reply   Quote More 

 From:  koswix   
 To:  ANT_THOMAS     
38140.2836 In reply to 38140.2835 
aren't the dynmap chat lines written to the log?


GIVE ME EYERON OR! :@ msg:38140.1
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  koswix      
38140.2837 In reply to 38140.2836 
Aye, just the way we're stripping the chat out means the DynMap ones get missed. They're formatted differently.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
38140.2838 In reply to 38140.2837 
How're they formatted?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
38140.2839 In reply to 38140.2828 
Why on earth would you want the newest at the top!? :/
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Peter (BOUGHTONP)     
38140.2840 In reply to 38140.2839 
Because pressing F5 and scrolling to the bottom is annoying.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
38140.2841 In reply to 38140.2838 
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.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
38140.2842 In reply to 38140.2840 
Then make it automatically jump to the bottom?


Reading messages upwards is annoying - and confusing when there's no times shown too.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
38140.2843 In reply to 38140.2841 
Ok, gimme a min.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
38140.2844 In reply to 38140.2841 
Is the chat thing itself part of Bukkit or part of Minecraft server?
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Peter (BOUGHTONP)     
38140.2845 In reply to 38140.2844 
Minecraft server I think. Fairly sure there's always chat even if you use the vanilla server.
0/0
 Reply   Quote More 

 From:  Matt  
 To:  Drew (X3N0PH0N)     
38140.2846 In reply to 38140.2832 
Man, I corrected that shit. I blame Android.

doohicky

0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
38140.2847 In reply to 38140.2841 
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
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Drew (X3N0PH0N)     
38140.2848 In reply to 38140.2847 
That'd be much neater with some regex but ... fuck regex :Y
0/0
 Reply   Quote More 

Reply to All  
 

1–20  …  2781–2800  2801–2820  2821–2840  2841–2860  …  3921–3934

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats