Teh Mine

From: Peter (BOUGHTONP) 5 Aug 2011 13:45
To: Peter (BOUGHTONP) 2867 of 3934
Oh, it probably also needs a $results = []; before the preg_match too.
(I just updated the post, but not sure if you read it before or after that)
From: Peter (BOUGHTONP) 5 Aug 2011 13:50
To: ANT_THOMAS 2868 of 3934
Stupid language. You apparently don't need to define the $results before using it, assuming the examples are correct.

Anyway, if you haven't already done it, here's a modified version of the original code segment I posted:

php code:
	else if ( strpos($thing,"logged in") )
	{
		$time = "[" . substr($thing, 11, 5) . "]";
		preg_match( '/(?<=\[INFO\] )\S+/' , $thing , $results );
		$person = $results[0];
		$chats[] = $time.' <i>Joined:</i> <b>'.htmlspecialchars($person).'</b>';
	}
	else if ( strpos($thing,"lost connection") )
	{
		$time = "[" . substr($thing, 11, 5) . "]";
		preg_match( '/(?<=\[INFO\] )\S+/' , $thing , $results );
		$person = $results[0];
		$reason = trim(substr(strrchr($thing, '.'), 1));
		$chats[] = $time.' <i>Disconnected:</i> <b>'.htmlspecialchars($person).'</b> ('.$reason.')';
	}


I also added a trim() call around the $reason value, to remove the space that appeared.
EDITED: 5 Aug 2011 13:54 by BOUGHTONP
From: ANT_THOMAS 5 Aug 2011 13:55
To: Peter (BOUGHTONP) 2869 of 3934
Brilliant. That's all now up. I might add an auto refresh thing later too. I'd already done that last night but it fucked up.
From: Ken (SHIELDSIT) 5 Aug 2011 14:26
To: ANT_THOMAS 2870 of 3934
From: Peter (BOUGHTONP) 5 Aug 2011 14:34
To: Ken (SHIELDSIT) 2871 of 3934
Which means notch has between 30 and 45 million euros. Lucky bastard!
From: Ken (SHIELDSIT) 5 Aug 2011 14:36
To: Peter (BOUGHTONP) 2872 of 3934
For a game in Beta.
From: Chris (CHRISSS) 5 Aug 2011 14:40
To: Peter (BOUGHTONP) 2873 of 3934
I wonder how much he was expecting/hoping to get, if he'd thought about that.
From: koswix 5 Aug 2011 14:41
To: Chris (CHRISSS) 2874 of 3934
I won a tenner on a scratch card yesterday. Doesn't really compare :(
From: ANT_THOMAS 5 Aug 2011 14:44
To: Peter (BOUGHTONP) 2875 of 3934
Yeah I saw a quote the other day from him along the lines of "I don't think about the price of groceries any more"
From: milko 5 Aug 2011 14:46
To: Ken (SHIELDSIT) 2876 of 3934
In fairness, I doubt the post-beta audience will be all that large, there can't be that many people left waiting can there? Good heavens, if there are he'll be able to buy islands and things. Well, he probably already can, but more and bigger ones.
From: Ken (SHIELDSIT) 5 Aug 2011 14:55
To: milko 2877 of 3934
I dunno, the number of people on earth is above my math skill. I just wish it was/had more physics or something involved so I could invent my own things to use instead of having to wait for them to introduce them.
From: ANT_THOMAS 5 Aug 2011 14:59
To: ALL2878 of 3934

Auto-refresh is up and running. It'll refresh the chat every 20 seconds.

 

Next on my to-do list (when I can be bothered) are:
List of currently Online Users.
Ability to chat from the chat page.

From: Drew (X3N0PH0N) 5 Aug 2011 15:27
To: Peter (BOUGHTONP) 2879 of 3934
Hmm, I'll stick it in my dropbox.

http://dl.dropbox.com/u/132841/No%20Clouds.zip
From: Drew (X3N0PH0N) 5 Aug 2011 15:34
To: ANT_THOMAS 2880 of 3934
Bit of a problem on the web map...

81.155.247.206: test
Error: You may only chat once every 25 seconds.
From: Drew (X3N0PH0N) 5 Aug 2011 15:51
To: af (CAER) 2881 of 3934
I don't think you need to build /all/ of it. There are going to be a lot of dull buildings between the interesting ones. Emphasise the cool bits and drop the bits which don't add anything to the y'know.
From: ANT_THOMAS 5 Aug 2011 15:52
To: Drew (X3N0PH0N) 2882 of 3934
:$ I obviously changed the wrong setting
From: patch 5 Aug 2011 15:53
To: Drew (X3N0PH0N) 2883 of 3934
The cafeterias and restaurants can probably be left out, aye. And maybe dividing all the numbers by two.
From: ANT_THOMAS 5 Aug 2011 15:58
To: Drew (X3N0PH0N) 2884 of 3934

Down to 2 secs now. NO SPAMING etc etc.

 

Though I can't yet find the setting to increase the length of time the messages show for. I've tried a couple of settings but it's still about 15 seconds per message.

From: ANT_THOMAS 5 Aug 2011 16:00
To: ALL2885 of 3934
The mini-site chat thing is now working fairly well and there's an online players list as well. Both refresh every 20 seconds.
From: af (CAER) 5 Aug 2011 16:03
To: patch 2886 of 3934
Even if I divide the size by two it's still longer than my wall :'D (and a 25m wide moat around the outside will be... an interesting challenge)