<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Seb Lee-Delisle &#187; ElectroServer</title>
	<atom:link href="http://sebleedelisle.com/category/multi-user/electroserver/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebleedelisle.com</link>
	<description>Actionscript Games, Physics and Papervision3D</description>
	<lastBuildDate>Sat, 31 Jul 2010 15:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Giving ElectroServer more memory</title>
		<link>http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/</link>
		<comments>http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 22:56:37 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[ElectroServer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Multi-user]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=825</guid>
		<description><![CDATA[So after last time, I thought I&#8217;d given ElectroServer more memory, but it turns out I hadn&#8217;t. I&#8217;m not exactly sure why, but I suspect it&#8217;s something about how Media Temple is set up. So rather than call the main ElectroServer app (which is just a shell script), I&#8217;m opening the ElectroServer jar file, and [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
<li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/' rel='bookmark' title='Permanent Link: Installing ElectroServer on Mac OSX'>Installing ElectroServer on Mac OSX</a></li>
<li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/' rel='bookmark' title='Permanent Link: Installing ElectroServer on MediaTemple'>Installing ElectroServer on MediaTemple</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F01%252Fgiving-electroserver-more-memory%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2Fbr2ALd%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Giving%20ElectroServer%20more%20memory%20%23%22%20%7D);"></div>
<p><a href="http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/">So after last time, </a> I thought I&#8217;d given ElectroServer more memory, but it turns out I hadn&#8217;t. I&#8217;m not exactly sure why, but I suspect it&#8217;s something about how Media Temple is set up. </p>
<p>So rather than call the main ElectroServer app (which is just a shell script), I&#8217;m opening the ElectroServer jar file, and that way I can tell java how much memory to use (and other options) as parameters.</p>
<p>I&#8217;m pretty sure Java is installed somewhere on Media Temple (you need to install the dev tools) but I couldn&#8217;t find it anywhere! And if I just typed <em>java</em> it couldn&#8217;t find it. I even ran a find command, but it was nowhere! But then I realised that the Java runtime is packaged with ElectroServer in the <em>jre</em> folder! </p>
<p><del datetime="2010-02-03T09:25:46+00:00">So with a bit of fiddling I worked out that I could start ElectroServer with more memory by running the jar file, but I had to do it while in the <em>server</em> subfolder within the ES install.  </del></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">..<span style="color: #000000; font-weight: bold;">/</span>jre<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java <span style="color: #660033;">-Xmx128M</span> <span style="color: #660033;">-jar</span> lib<span style="color: #000000; font-weight: bold;">/</span>ElectroServer4-bootstrap.jar <span style="color: #660033;">-mode</span> StandAlone <span style="color: #660033;">-config</span> config<span style="color: #000000; font-weight: bold;">/</span>ES4Configuration.xml</pre></div></div>

<p><del datetime="2010-02-03T09:25:46+00:00">where <em>128M</em> is the amount of RAM made available.<br />
</del></p>
<p><strong>[UPDATE] </strong></p>
<p>There is a better way! Thanks to Paul Hayes (a colleague at Plug-in Media, see comments below) I have now realised that ElectroServer&#8217;s main app is nothing more than a shell script that you can edit. Furthermore there is a line you can uncomment right at the top to change the Java parameters :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Uncomment the following line to add additional VM parameters</span>
<span style="color: #666666; font-style: italic;"># INSTALL4J_ADD_VM_PARAMS=</span></pre></div></div>

<p>Change this to :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Uncomment the following line to add additional VM parameters</span>
<span style="color: #007800;">INSTALL4J_ADD_VM_PARAMS</span>=<span style="color: #ff0000;">&quot;-Xmx512m&quot;</span></pre></div></div>

<p>Where 512 is the amount of RAM in Mb you want ElectroServer to use. </p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
<li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/' rel='bookmark' title='Permanent Link: Installing ElectroServer on Mac OSX'>Installing ElectroServer on Mac OSX</a></li>
<li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/' rel='bookmark' title='Permanent Link: Installing ElectroServer on MediaTemple'>Installing ElectroServer on MediaTemple</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>ElectroServer security sandbox violation error</title>
		<link>http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/</link>
		<comments>http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 14:24:30 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[ElectroServer]]></category>
		<category><![CDATA[Multi-user]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=817</guid>
		<description><![CDATA[I suddenly started getting a really weird error from Flash when trying to connect to ElectroServer : Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://sebleedelisle.com/games/moonlander/MoonLanderViewer.swf cannot load data from 72.47.193.154:9899. I posted to the ElectroServer forums and quick as a flash, Teresa got back to me &#8211; apparently ElectroServer was running out of [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/' rel='bookmark' title='Permanent Link: Installing ElectroServer on Mac OSX'>Installing ElectroServer on Mac OSX</a></li>
<li><a href='http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/' rel='bookmark' title='Permanent Link: Giving ElectroServer more memory'>Giving ElectroServer more memory</a></li>
<li><a href='http://sebleedelisle.com/2010/01/further-adventures-with-electroserver/' rel='bookmark' title='Permanent Link: Further adventures with ElectroServer'>Further adventures with ElectroServer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F01%252Felectroserver-security-sandbox-violation-error%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2F57PdIZ%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22ElectroServer%20security%20sandbox%20violation%20error%20%23%22%20%7D);"></div>
<p>I suddenly started getting a really weird error from Flash when trying to connect to ElectroServer : </p>
<p><code><br />
Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://sebleedelisle.com/games/moonlander/MoonLanderViewer.swf cannot load data from 72.47.193.154:9899.<br />
</code></p>
<p><a href="http://www.electro-server.com/forum/?f=2&#038;m=8868">I posted to the ElectroServer forums</a> and quick as a flash, Teresa got back to me &#8211; apparently ElectroServer was running out of memory. But apparently that&#8217;s not surprising &#8211; all Java gives it is 64Mb by default! But before I could fix it I had to stop ElectroServer from running, which isn&#8217;t easy when it&#8217;s running in the background. </p>
<p>Earlier <a href="http://www.electro-server.com/forum/?f=2&#038;m=8790">Teresa had told me how to do this</a>.<br />
<span id="more-817"></span><br />
First, find the process by typing :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> java</pre></div></div>

<p>For me, that return a whole bunch of junk! :<br />
<code lang="bash"><br />
root      3492  3482  2 06:02 pts/0    00:00:09 /opt/ElectroServer_4_0_6/jre/bin/java -server -Dinstall4j.jvmDir=/opt/ElectroServer_4_0_6/jre -Dexe4j.moduleName=/opt/ElectroServer_4_0_6/ElectroServer -classpath /opt/ElectroServer_4_0_6/.install4j/i4jruntime.jar:/opt/ElectroServer_4_0_6/server/lib/ElectroServer4-bootstrap.jar com.install4j.runtime.Launcher launch com.electrotank.electroserver4.bootstrap.Main false false   true true false  true true 0 0  20 20 Arial 0,0,0 8 500 version 4.0.6 20 40 Arial 0,0,0 8 500 -1 -mode StandAlone<br />
root     32208  1741  0 06:08 pts/0    00:00:00 grep java<br />
</code></p>
<p>But it&#8217;s actually only two processes, both starting with the word <em>root</em> (which is my current user name). The second process is the one that we just started by typing <em>ps -ef | grep java</em> and the first one is our ElectroServer, and that&#8217;s the one we have to kill. To do this we need the process id. I must admit I&#8217;m a bit confused why there are two numbers next to our process, 3492 and 3482. But I found that it worked for me using the first number.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-9</span> <span style="color: #000000;">3492</span></pre></div></div>

<p>But of course you&#8217;ll have to replace <strong>3492</strong> with whatever number you get. You can check it&#8217;s not running by typing <em>ps -ef | grep java</em> again, and this time you should no longer see the ElectroServer process :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root     <span style="color: #000000;">32208</span>  <span style="color: #000000;">1741</span>  <span style="color: #000000;">0</span> 06:08 pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span>    00:00:00 <span style="color: #c20cb9; font-weight: bold;">grep</span> java</pre></div></div>

<p>So now I&#8217;ve killed the server process, I can now give ElectroServer more RAM, thankfully there&#8217;s<a href="http://www.es-wiki.com/index.php?title=Performance_and_Optimization"> this useful post on the ElectroServer wiki</a>. I must admit I found it quite confusing, but for my Media Temple installation I used the <a href="http://www.es-wiki.com/index.php?title=Performance_and_Optimization#Unix">Instructions for Unix</a>. These instructions show you how to create a shell script that starts the server with more RAM. I had some trouble getting it to work, but that was because the capitalisation was different so check that you&#8217;re typing ElectroServer with the right caps &#8211; Unix is fussy. </p>
<p>Now it seems to be working again, but let me know if you see any more issues. </p>
<p>[UPDATE] those instructions didn&#8217;t seem to work. <a href="http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/">See this post on how I actually added more memory to ElectroServer</a>.</p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/' rel='bookmark' title='Permanent Link: Installing ElectroServer on Mac OSX'>Installing ElectroServer on Mac OSX</a></li>
<li><a href='http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/' rel='bookmark' title='Permanent Link: Giving ElectroServer more memory'>Giving ElectroServer more memory</a></li>
<li><a href='http://sebleedelisle.com/2010/01/further-adventures-with-electroserver/' rel='bookmark' title='Permanent Link: Further adventures with ElectroServer'>Further adventures with ElectroServer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Multi-user gaming in Flash &#8211; Lunar Lander tests</title>
		<link>http://sebleedelisle.com/2010/01/multi-user-gaming-in-flash-early-tests/</link>
		<comments>http://sebleedelisle.com/2010/01/multi-user-gaming-in-flash-early-tests/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 18:04:50 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[ElectroServer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game programming]]></category>
		<category><![CDATA[Multi-user]]></category>
		<category><![CDATA[flash games]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=732</guid>
		<description><![CDATA[Anyone playing my Lunar Lander game won&#8217;t know it, but we&#8217;re spying on them! The game gets around 20,000 hits a month, which is very roughly one a minute or so, so I thought it&#8217;d be the perfect vehicle to test out some real-time gaming techniques. I&#8217;ve replaced the original game with one that transmits [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2009/04/lunar-lander-3d-in-5k/' rel='bookmark' title='Permanent Link: Lunar Lander 3D in 5K'>Lunar Lander 3D in 5K</a></li>
<li><a href='http://sebleedelisle.com/2010/05/making-a-multi-track-recorder-in-flash-part-2/' rel='bookmark' title='Permanent Link: Making a multi-track recorder in Flash part 2'>Making a multi-track recorder in Flash part 2</a></li>
<li><a href='http://sebleedelisle.com/2010/05/making-a-multi-track-recorder-in-flash/' rel='bookmark' title='Permanent Link: Making a multi-track recorder in Flash'>Making a multi-track recorder in Flash</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F01%252Fmulti-user-gaming-in-flash-early-tests%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2F7TxSLT%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Multi-user%20gaming%20in%20Flash%20-%20Lunar%20Lander%20tests%20%23%22%20%7D);"></div>
<p><img src="http://farm5.static.flickr.com/4004/4281714217_1123d7f175.jpg" width="500" height="259" alt="Lunar Lander multi-user tests" /></p>
<p>Anyone playing <a href="http://sebleedelisle.com/games/moonlander/">my Lunar Lander game</a> won&#8217;t know it, but we&#8217;re spying on them! The game gets around 20,000 hits a month, which is very roughly one a minute or so, so I thought it&#8217;d be the perfect vehicle to test out some real-time gaming techniques. </p>
<p>I&#8217;ve replaced the original game with one that transmits your position to ElectroServer, although you won&#8217;t notice any difference at all. The only way to see the all the current players is via the swf below :<br />
<span id="more-732"></span><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_MoonLanderViewer_2031545581"
			class="flashmovie"
			width="600"
			height="300">
	<param name="movie" value="http://sebleedelisle.com/games/moonlander/MoonLanderViewer.swf" />
	<param name="flashvars" value="baseurl=http://sebleedelisle.com/games/moonlander/" />
	<param name="allowfullscreen" value="true" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://sebleedelisle.com/games/moonlander/MoonLanderViewer.swf"
			name="fm_MoonLanderViewer_2031545581"
			width="600"
			height="300">
		<param name="flashvars" value="baseurl=http://sebleedelisle.com/games/moonlander/" />
		<param name="allowfullscreen" value="true" />
	<!--<![endif]-->
		<br />
(Visit <a href="http://sebleedelisle.com/2010/01/multi-user-gaming-in-flash-early-tests">original post</a> to see Flash content)<br />

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>The button in the top left makes it full screen. If all you can see is an empty landscape, it means that no one is playing. Usually someone will turn up within a couple of minutes, but if you can&#8217;t wait, then why not <a href="http://sebleedelisle.com/games/moonlander/" target="_blank">open the game in a new window and watch yourself playing? </a> </p>
<p>At the moment it&#8217;s very very primitive. It&#8217;s just literally receiving the data and updating the visuals as it gets them, that&#8217;s why the movement is quite jerky, even despite the fact that there&#8217;s a little realtime easing on there. Of course, I&#8217;m going to have to get a lot more into this, comparing the timings with the server so I can adjust for any inconsistencies in data, and of course predicting where the players should be now, rather than where they were a few hundred mils ago. </p>
<p>But I still find it utterly compelling, and naturally I&#8217;ll be explaining all of this in my <a href="http://sebleedelisle.com/training/">upcoming Flash game programming training courses. </a></p>
<p>Last night, I left it running (it draws the trails of anyone playing as they go) and this is the image I woke up to : </p>
<p><a href="http://www.flickr.com/photos/sebleedelisle/4281722645/" title="Lunar Lander Multi user by sebleedelisle, on Flickr"><img src="http://farm5.static.flickr.com/4009/4281722645_4681703dc5.jpg" width="500" height="251" alt="Lunar Lander Multi user" /></a></p>
<p>I can&#8217;t help but think that <a href="http://blog.blprnt.com/">Jer Thorp</a> would be proud of me <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>[UPDATE] due to popular request there is a high res version of this now on <a href="http://www.flickr.com/photos/sebleedelisle/4306603442/">my Flickr page</a>. </p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2009/04/lunar-lander-3d-in-5k/' rel='bookmark' title='Permanent Link: Lunar Lander 3D in 5K'>Lunar Lander 3D in 5K</a></li>
<li><a href='http://sebleedelisle.com/2010/05/making-a-multi-track-recorder-in-flash-part-2/' rel='bookmark' title='Permanent Link: Making a multi-track recorder in Flash part 2'>Making a multi-track recorder in Flash part 2</a></li>
<li><a href='http://sebleedelisle.com/2010/05/making-a-multi-track-recorder-in-flash/' rel='bookmark' title='Permanent Link: Making a multi-track recorder in Flash'>Making a multi-track recorder in Flash</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/01/multi-user-gaming-in-flash-early-tests/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Further adventures with ElectroServer</title>
		<link>http://sebleedelisle.com/2010/01/further-adventures-with-electroserver/</link>
		<comments>http://sebleedelisle.com/2010/01/further-adventures-with-electroserver/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 17:18:53 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[ElectroServer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Multi-user]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=690</guid>
		<description><![CDATA[As there has been a lot of interesting talk on my recent live chat example I thought it&#8217;d be nice to actually see what you&#8217;ve been saying! So I checked out the Logging Chat By Room tutorial on the ElectroServer wiki. After some minor tweaks I got the Java extension compiled (the methods should not [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
<li><a href='http://sebleedelisle.com/2009/12/electroserver-flex-simple-chat/' rel='bookmark' title='Permanent Link: ElectroServer Flex simple chat'>ElectroServer Flex simple chat</a></li>
<li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/' rel='bookmark' title='Permanent Link: Installing ElectroServer on MediaTemple'>Installing ElectroServer on MediaTemple</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F01%252Ffurther-adventures-with-electroserver%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Further%20adventures%20with%20ElectroServer%20%23%22%20%7D);"></div>
<p>As there has been a lot of interesting talk on my recent live chat example I thought it&#8217;d be nice to actually see what you&#8217;ve been saying! So I checked out the <a href="http://www.es-wiki.com/index.php?title=Logging_chat_by_room">Logging Chat By Room</a> tutorial on the ElectroServer wiki. </p>
<p>After some minor tweaks I got the Java extension compiled (the methods should not be marked @Override as the class isn&#8217;t extending anything) and tested them locally &#8211; all was fine. </p>
<p>So I uploaded them to the server and restarted but ElectroServer wouldn&#8217;t come back! There was a Java error message and it was just way beyond my capabilities to troubleshoot it. Thankfully, Teresa from ElectroServer checked the forum at 7.30am on a Sunday morning and<a href="http://www.electro-server.com/forum/?f=2&#038;m=8790"> responded to my plea for help</a>! She assures me that she&#8217;s not usually so ultra-responsive but I have yet to see evidence of that! So far, the support I&#8217;ve got from Teresa is just phenomenal. </p>
<p>I never did quite get to the bottom of what happened, but I suspect it was a problem with a persistent room as I had been playing with those settings in the web admin interface (frankly without really knowing what I&#8217;m doing <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) . But I fixed it by <a href="http://www.es-wiki.com/index.php?title=Remote_upgrade_(Linux)">reinstalling ElectroServer with these instructions</a>, and I was back where I started! I&#8217;m still working on getting chat logging done, but in the meantime I wanted to try something a little more interesting to me. There&#8217;s a tutorial on the ElectroServer wiki which extends the chat example and shows everyone&#8217;s mouse as they move it around! </p>
<p>And here&#8217;s what it looks like screen captured : </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/v_YK9aDWAIM&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/v_YK9aDWAIM&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>And here&#8217;s the actual app!<br />
<span id="more-690"></span><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SimpleChatWithCursors_19725231"
			class="flashmovie"
			width="450"
			height="365">
	<param name="movie" value="http://sebleedelisle.com/wp-content/uploads/2010/01/SimpleChatWithCursors.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://sebleedelisle.com/wp-content/uploads/2010/01/SimpleChatWithCursors.swf"
			name="fm_SimpleChatWithCursors_19725231"
			width="450"
			height="365">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Again I&#8217;ve adapted it for Flex, and made some minor changes, including showing the username attached to the cursors. I&#8217;ve also changed how the easing works (with spring) and optimised it so it only broadcasts the mouse position when it changes, rather than every frame. </p>
<p>It&#8217;s really interesting to see how the updates come in and what that looks like &#8211; this is all good research into the next phase of these experiments &#8211; real time multiplayer gaming. </p>
<p><a href="http://sebleedelisle.com/wp-content/uploads/2010/01/SimpleChatWithCursors.zip">Download the Flex archive project source code for the Flex Chat with Cursors.</a></p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
<li><a href='http://sebleedelisle.com/2009/12/electroserver-flex-simple-chat/' rel='bookmark' title='Permanent Link: ElectroServer Flex simple chat'>ElectroServer Flex simple chat</a></li>
<li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/' rel='bookmark' title='Permanent Link: Installing ElectroServer on MediaTemple'>Installing ElectroServer on MediaTemple</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/01/further-adventures-with-electroserver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ElectroServer Flex simple chat</title>
		<link>http://sebleedelisle.com/2009/12/electroserver-flex-simple-chat/</link>
		<comments>http://sebleedelisle.com/2009/12/electroserver-flex-simple-chat/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 13:20:40 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[ElectroServer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Multi-user]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=684</guid>
		<description><![CDATA[I&#8217;ve just converted the code from the Simple Chat Tutorial on the ElectroServer wiki into Flex and I thought it may be useful to someone. Here&#8217;s what it looks like, and it&#8217;s connecting to an ES4 install with only 20 connections so forgive me if you can&#8217;t connect : 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SimpleChat_1533802372"
			class="flashmovie"
			width="450"
			height="365">
	<param name="movie" value="http://sebleedelisle.com/wp-content/uploads/2009/12/SimpleChat.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://sebleedelisle.com/wp-content/uploads/2009/12/SimpleChat.swf"
			name="fm_SimpleChat_1533802372"
			width="450"
			height="365">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>


Related posts:<ol><li><a href='http://sebleedelisle.com/2010/01/further-adventures-with-electroserver/' rel='bookmark' title='Permanent Link: Further adventures with ElectroServer'>Further adventures with ElectroServer</a></li>
<li><a href='http://sebleedelisle.com/2009/11/simple-flash-3d-drawing-api/' rel='bookmark' title='Permanent Link: Simple Flash 3D drawing API'>Simple Flash 3D drawing API</a></li>
<li><a href='http://sebleedelisle.com/2006/10/simple-real-time-easing-in-flash/' rel='bookmark' title='Permanent Link: Simple real-time easing in Flash &#038; 3D panels'>Simple real-time easing in Flash &#038; 3D panels</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2009%252F12%252Felectroserver-flex-simple-chat%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22ElectroServer%20Flex%20simple%20chat%20%20%23%22%20%7D);"></div>
<p>I&#8217;ve just converted the code from the <a href="http://www.es-wiki.com/index.php?title=Simple_Chat_Tutorial">Simple Chat Tutorial on the ElectroServer wiki</a> into Flex and I thought it may be useful to someone. </p>
<p>Here&#8217;s what it looks like, and it&#8217;s connecting to an ES4 install with only 20 connections so forgive me if you can&#8217;t connect : </p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SimpleChat_1339947107"
			class="flashmovie"
			width="450"
			height="365">
	<param name="movie" value="http://sebleedelisle.com/wp-content/uploads/2009/12/SimpleChat.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://sebleedelisle.com/wp-content/uploads/2009/12/SimpleChat.swf"
			name="fm_SimpleChat_1339947107"
			width="450"
			height="365">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Here&#8217;s the source:<br />
<span id="more-684"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> applicationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;450&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;365&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
		<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">utils</span>.<span style="color: #006600;">URLUtil</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">event</span>.<span style="color: #006600;">PublicMessageEvent</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">request</span>.<span style="color: #006600;">PublicMessageRequest</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #006600;">user</span>.<span style="color: #006600;">User</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">request</span>.<span style="color: #006600;">LoginRequest</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #006600;">room</span>.<span style="color: #006600;">Room</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">event</span>.<span style="color: #006600;">JoinRoomEvent</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">event</span>.<span style="color: #006600;">UserListUpdateEvent</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">request</span>.<span style="color: #006600;">CreateRoomRequest</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">response</span>.<span style="color: #006600;">LoginResponse</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">event</span>.<span style="color: #006600;">ConnectionEvent</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #0066CC;">message</span>.<span style="color: #006600;">MessageType</span>;
		<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">electrotank</span>.<span style="color: #006600;">electroserver4</span>.<span style="color: #006600;">ElectroServer</span>;
		<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">rpc</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">FaultEvent</span>;
		<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">rpc</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">ResultEvent</span>;
		<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">Alert</span>;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> es : ElectroServer; 
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> serverInfo : <span style="color: #0066CC;">Object</span>; 
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> myRoom : Room; 
		<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> users : <span style="color: #0066CC;">Array</span>; 
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// There MUST be a better way of getting the app's path than this! suggestions welcome. </span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> pathelements: <span style="color: #0066CC;">Array</span> = Application.<span style="color: #006600;">application</span>.<span style="color: #0066CC;">url</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #66cc66;">&#41;</span>; 
			pathelements<span style="color: #66cc66;">&#91;</span>pathelements.<span style="color: #006600;">length</span>-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span> = settings.<span style="color: #0066CC;">url</span>; 
			settings.<span style="color: #0066CC;">url</span> = pathelements.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
			settings.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
			users = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>; 
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sendMessage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> msg:<span style="color: #0066CC;">String</span> = msg_text.<span style="color: #0066CC;">text</span>;
	  		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>msg <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	  			msg_text.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;&quot;</span>; 
				msg_text.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
	  			<span style="color: #808080; font-style: italic;">//create the request</span>
	  			<span style="color: #000000; font-weight: bold;">var</span> pmr:PublicMessageRequest =<span style="color: #000000; font-weight: bold;">new</span> PublicMessageRequest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	  			pmr.<span style="color: #006600;">setRoomId</span><span style="color: #66cc66;">&#40;</span>myRoom.<span style="color: #006600;">getRoomId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	  			pmr.<span style="color: #006600;">setZoneId</span><span style="color: #66cc66;">&#40;</span>myRoom.<span style="color: #006600;">getZone</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getZoneId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	  			pmr.<span style="color: #006600;">setMessage</span><span style="color: #66cc66;">&#40;</span>msg<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	  			<span style="color: #808080; font-style: italic;">//send it</span>
	  			es.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span>pmr<span style="color: #66cc66;">&#41;</span>;
	  		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onPublicMessageEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:PublicMessageEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
	  	<span style="color: #66cc66;">&#123;</span>
	  		<span style="color: #000000; font-weight: bold;">var</span> from:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">getUserName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	  		<span style="color: #000000; font-weight: bold;">var</span> msg:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">getMessage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	  		output<span style="color: #66cc66;">&#40;</span>from+<span style="color: #ff0000;">&quot;: &quot;</span>+msg<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	  	<span style="color: #66cc66;">&#125;</span>		
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> xmlLoaded<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span> : ResultEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
&nbsp;
			es = <span style="color: #000000; font-weight: bold;">new</span> ElectroServer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
			serverInfo = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>; 
			<span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> lis:<span style="color: #0066CC;">XML</span> <span style="color: #b1b100;">in</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">result</span>.<span style="color: #006600;">Listener</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span> protocol:<span style="color: #0066CC;">String</span> = lis.<span style="color: #66cc66;">@</span>protocol;
				<span style="color: #000000; font-weight: bold;">var</span> ip:<span style="color: #0066CC;">String</span> = lis.<span style="color: #66cc66;">@</span>ip;
				<span style="color: #000000; font-weight: bold;">var</span> port:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>lis.<span style="color: #66cc66;">@</span>port<span style="color: #66cc66;">&#41;</span>;
				serverInfo<span style="color: #66cc66;">&#91;</span>protocol<span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				serverInfo<span style="color: #66cc66;">&#91;</span>protocol<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">ip</span> = ip;
				serverInfo<span style="color: #66cc66;">&#91;</span>protocol<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">port</span> = port;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			es.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MessageType.<span style="color: #006600;">ConnectionEvent</span>, <span style="color: #ff0000;">&quot;onConnectionEvent&quot;</span>, <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
			es.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MessageType.<span style="color: #006600;">LoginResponse</span>, <span style="color: #ff0000;">&quot;onLoginResponse&quot;</span>, <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
			es.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MessageType.<span style="color: #006600;">JoinRoomEvent</span>, <span style="color: #ff0000;">&quot;onJoinRoomEvent&quot;</span>, <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
			es.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MessageType.<span style="color: #006600;">PublicMessageEvent</span>, <span style="color: #ff0000;">&quot;onPublicMessageEvent&quot;</span>, <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
			es.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MessageType.<span style="color: #006600;">UserListUpdateEvent</span>, <span style="color: #ff0000;">&quot;onUserListUpdateEvent&quot;</span>, <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//Create the connection</span>
			output<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Attempting connection with this ip/port combo: &quot;</span>+serverInfo.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">ip</span>+<span style="color: #ff0000;">&quot;:&quot;</span>+serverInfo.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">port</span><span style="color: #66cc66;">&#41;</span>;
			es.<span style="color: #006600;">createConnection</span><span style="color: #66cc66;">&#40;</span>serverInfo.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">ip</span>, serverInfo.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">port</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onConnectionEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:ConnectionEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">getAccepted</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				output<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Connection accepted&quot;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">name</span>:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;user&quot;</span>+<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">round</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10000</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
				output<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Attempting to login as: &quot;</span>+<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #808080; font-style: italic;">//Build the LoginRequest and populate it</span>
				<span style="color: #000000; font-weight: bold;">var</span> lr:LoginRequest = <span style="color: #000000; font-weight: bold;">new</span> LoginRequest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				lr.<span style="color: #006600;">setUserName</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #808080; font-style: italic;">//send it</span>
				es.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span>lr<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
				output<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Connection failed: &quot;</span>+<span style="color: #0066CC;">e</span>.<span style="color: #006600;">getEsError</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getDescription</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
	 	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onLoginResponse<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:LoginResponse<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
	  	<span style="color: #66cc66;">&#123;</span>
	  		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">getAccepted</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	  			output<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Login accepted.&quot;</span><span style="color: #66cc66;">&#41;</span>;
	  			output<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;You are logged in as: &quot;</span>+<span style="color: #0066CC;">e</span>.<span style="color: #006600;">getUserName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	  			joinRoom<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	  		<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
	  			output<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Login failed: &quot;</span>+<span style="color: #0066CC;">e</span>.<span style="color: #006600;">getEsError</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getDescription</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	  		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>			
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> joinRoom<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
		  	<span style="color: #808080; font-style: italic;">//tries to create a room. if it already exists, then you join that room</span>
		  	<span style="color: #808080; font-style: italic;">//create the request</span>
			<span style="color: #000000; font-weight: bold;">var</span> crr:CreateRoomRequest = <span style="color: #000000; font-weight: bold;">new</span> CreateRoomRequest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			crr.<span style="color: #006600;">setRoomName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;MyRoom&quot;</span><span style="color: #66cc66;">&#41;</span>;
			crr.<span style="color: #006600;">setZoneName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;ZoneName&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//send it</span>
			es.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span>crr<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>	
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onJoinRoomEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:JoinRoomEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			myRoom = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">room</span>;
			showUserList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onUserListUpdateEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:UserListUpdateEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
  		<span style="color: #66cc66;">&#123;</span>
  			showUserList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> showUserList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> userobjs : <span style="color: #0066CC;">Array</span> = myRoom.<span style="color: #006600;">getUsers</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
			users = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
			<span style="color: #b1b100;">for</span> each<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> user : User <span style="color: #b1b100;">in</span> userobjs<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				users.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>user.<span style="color: #006600;">getUserName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; 
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> xmlLoadFailed<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span> : FaultEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;failed&quot;</span><span style="color: #66cc66;">&#41;</span>; 
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> output<span style="color: #66cc66;">&#40;</span>msg : <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			chat_text.<span style="color: #0066CC;">text</span> += msg+<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>; 
			chat_text.<span style="color: #006600;">verticalScrollPosition</span> = chat_text.<span style="color: #006600;">maxVerticalScrollPosition</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:HTTPService 
	id=<span style="color: #ff0000;">&quot;settings&quot;</span>
	<span style="color: #0066CC;">url</span>=<span style="color: #ff0000;">&quot;./ServerSettings.xml&quot;</span> 
	resultFormat=<span style="color: #ff0000;">&quot;e4x&quot;</span>
	result=<span style="color: #ff0000;">&quot;xmlLoaded(event);&quot;</span>
	fault=<span style="color: #ff0000;">&quot;xmlLoadFailed(event);&quot;</span>
	<span style="color: #66cc66;">/&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:Model id=<span style="color: #ff0000;">&quot;users_model&quot;</span><span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>users<span style="color: #66cc66;">&gt;</span>
&nbsp;
      <span style="color: #66cc66;">&lt;/</span>users<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>mx:Model<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> x=<span style="color: #ff0000;">&quot;386&quot;</span> y=<span style="color: #ff0000;">&quot;333&quot;</span> label=<span style="color: #ff0000;">&quot;Send&quot;</span> id=<span style="color: #ff0000;">&quot;send_button&quot;</span> click=<span style="color: #ff0000;">&quot;sendMessage()&quot;</span><span style="color: #66cc66;">/&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:TextInput x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;333&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;368&quot;</span> id=<span style="color: #ff0000;">&quot;msg_text&quot;</span> <span style="color: #0066CC;">enter</span>=<span style="color: #ff0000;">&quot;sendMessage()&quot;</span><span style="color: #66cc66;">/&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:TextArea x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;302&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;316&quot;</span> id=<span style="color: #ff0000;">&quot;chat_text&quot;</span><span style="color: #66cc66;">/&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">List</span> x=<span style="color: #ff0000;">&quot;320&quot;</span> y=<span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;120&quot;</span> id=<span style="color: #ff0000;">&quot;user_list&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{users}&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;318&quot;</span><span style="color: #66cc66;">&gt;&lt;/</span>mx:List<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>This example also requires a ServerSettings.xml file that contains the server details, which if you&#8217;re running ElectroServer locally, should be :</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Listeners<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Listener</span> <span style="color: #000066;">ip</span>=<span style="color: #ff0000;">&quot;127.0.0.1&quot;</span> <span style="color: #000066;">port</span>=<span style="color: #ff0000;">&quot;9898&quot;</span> <span style="color: #000066;">protocol</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Listener</span> <span style="color: #000066;">ip</span>=<span style="color: #ff0000;">&quot;127.0.0.1&quot;</span> <span style="color: #000066;">port</span>=<span style="color: #ff0000;">&quot;1935&quot;</span> <span style="color: #000066;">protocol</span>=<span style="color: #ff0000;">&quot;rtmp&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Listeners<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><a href="http://sebleedelisle.com/wp-content/uploads/2009/12/SimpleChat.zip">Download the MXML source code for the ElectroServer Flex Simple Chat</a>. </p>
<p>I very rarely use Flex so please feel free to comment with improvements! </p>
<p>Particularly with how to load a file with a relative path in an HTTPService. It seems ridiculous that I have to specify a full path name, and the hack I&#8217;ve employed to extract the local path from the application URL is equally ridiculous. There must be a simpler method? </p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2010/01/further-adventures-with-electroserver/' rel='bookmark' title='Permanent Link: Further adventures with ElectroServer'>Further adventures with ElectroServer</a></li>
<li><a href='http://sebleedelisle.com/2009/11/simple-flash-3d-drawing-api/' rel='bookmark' title='Permanent Link: Simple Flash 3D drawing API'>Simple Flash 3D drawing API</a></li>
<li><a href='http://sebleedelisle.com/2006/10/simple-real-time-easing-in-flash/' rel='bookmark' title='Permanent Link: Simple real-time easing in Flash &#038; 3D panels'>Simple real-time easing in Flash &#038; 3D panels</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2009/12/electroserver-flex-simple-chat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing ElectroServer on MediaTemple</title>
		<link>http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/</link>
		<comments>http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 11:58:21 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[ElectroServer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Multi-user]]></category>
		<category><![CDATA[MediaTemple]]></category>
		<category><![CDATA[multiuser]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=682</guid>
		<description><![CDATA[Further news to report on my ElectroServer adventures! I&#8217;ve now got an ES4 installation up and running on a MediaTemple Dedicated Virtual server. It was actually pretty easy too, thanks to this tutorial from Greg Sidbury. I had no problems following although there are a couple of bits that confused me. The first was that [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/' rel='bookmark' title='Permanent Link: Installing ElectroServer on Mac OSX'>Installing ElectroServer on Mac OSX</a></li>
<li><a href='http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/' rel='bookmark' title='Permanent Link: Giving ElectroServer more memory'>Giving ElectroServer more memory</a></li>
<li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2009%252F12%252Finstalling-electroserver-on-mediatemple%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Installing%20ElectroServer%20on%20MediaTemple%20%20%23%22%20%7D);"></div>
<p>Further news to report on my ElectroServer adventures! I&#8217;ve now got an ES4 installation up and running on a MediaTemple Dedicated Virtual server. It was actually pretty easy too, thanks to <a href="http://himynameissid.com/2008/03/11/how-to-install-electroserver-on-media-temple-dv-and-similar-centos-setups/">this tutorial from Greg Sidbury</a>. </p>
<p>I had no problems following although there are a couple of bits that confused me. The first was that the download link didn&#8217;t work so I just found the Linux RPM link on the ElectroServer download pages and used that, which for the current version is : </p>
<pre script="bash">
wget http://electro-server.com/downloads/builds/ElectroServer_4_0_6_linux.rpm
</pre>
<p>The other thing that got me is that I put in the domain name into the ES4Configuration.xml which didn&#8217;t work. I should have put the ip address for the virtual server (which you should find in your Media Temple account or you could always just ping your domain from a terminal window).  </p>
<p>Once I&#8217;d opened the ports and started the server running I tried to telnet in to port 9898 (the default chat port) but it was refused. So I edited the crossdomain.xml on the main webserver to include the IP address of my home internet connection and it seemed to be OK after that. (At least I think that&#8217;s what fixed it!). </p>
<p>So apart from a few minor hassles it was pretty seamless and only took me an hour or so. I must admit to feeling way out of my depth, this isn&#8217;t something I&#8217;m particularly expert on so please feel free to comment with further advice <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/' rel='bookmark' title='Permanent Link: Installing ElectroServer on Mac OSX'>Installing ElectroServer on Mac OSX</a></li>
<li><a href='http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/' rel='bookmark' title='Permanent Link: Giving ElectroServer more memory'>Giving ElectroServer more memory</a></li>
<li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://electro-server.com/downloads/builds/ElectroServer_4_0_6_linux.rpm" length="57129397" type="audio/x-pn-realaudio-plugin" />
		</item>
		<item>
		<title>Installing ElectroServer on Mac OSX</title>
		<link>http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/</link>
		<comments>http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 17:04:59 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[ElectroServer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Multi-user]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[multiuser]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=678</guid>
		<description><![CDATA[What else to do in the Christmas holidays but finally get my head around ElectroServer? Of course the first (sometimes significant) hurdle in getting started with any multi-user technology is just installing the server on your machine! ElectroServer4 (ES4) is Java based so it should work on OSX, but most of the documentation is for [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/' rel='bookmark' title='Permanent Link: Installing ElectroServer on MediaTemple'>Installing ElectroServer on MediaTemple</a></li>
<li><a href='http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/' rel='bookmark' title='Permanent Link: Giving ElectroServer more memory'>Giving ElectroServer more memory</a></li>
<li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2009%252F12%252Finstalling-electroserver-on-mac-osx%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Installing%20ElectroServer%20on%20Mac%20OSX%20%23%22%20%7D);"></div>
<p>What else to do in the Christmas holidays but finally get my head around ElectroServer? <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Of course the first (sometimes significant) hurdle in getting started with any multi-user technology is just installing the server on your machine! ElectroServer4 (ES4) is Java based so it should work on OSX, but most of the documentation is for Windows, so I spent today installing it on my MacBook and thought I would share what I learned. </p>
<p>ES4 runs on Java 1.6 and OSX is shipped with 1.5. You can <a href="http://blogs.sun.com/cmar/entry/java_1_6_finally_available">find instructions on getting the update here</a>, but whatever you do don&#8217;t complete the steps to make 1.6 the default Java Virtual Machine (JVM), otherwise FlexBuilder won&#8217;t work any more!</p>
<p>Now you need to download the Unix package (the one marked &#8220;without JVM&#8221;) on the <a href="http://electro-server.com/downloads.aspx">ElectroServer downloads</a> page, and unzip it somewhere suitable (I put it in my documents folder). </p>
<p>Then open up a terminal window and navigate into the folder where you unzipped it. (Handy shortcut : type &#8220;cd&#8221; followed by a space and then drag the folder from the finder onto your terminal where the full path name will be inserted). </p>
<p>There&#8217;s a file in here called <em>ElectroServer</em> that you run but you need to tell it where to find the latest JVM. According to <a href="http://www.electro-server.com/forum/?f=2&#038;m=4264">this rather useful thread</a> you can do this by typing :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">INSTALL4J_JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>JavaVM.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.6</span><span style="color: #000000; font-weight: bold;">/</span>Home<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>And then start the server normally by typing :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>ElectroServer</pre></div></div>

<p>At which point you should see the happy message :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">16</span>:<span style="color: #000000;">28</span>:08,<span style="color: #000000;">523</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>main<span style="color: #7a0874; font-weight: bold;">&#93;</span> INFO  DisplayLogger  - 
-=-=-=-=-=-=-=-
Starting ElectroServer 4.0.6
Go to http:<span style="color: #000000; font-weight: bold;">//</span>www.electro-server.com<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">for</span> the newest version.
-=-=-=-=-=-=-=-
Computer Information
	Operating System: Mac OS X
	Operating System Architecture: x86_64
	Processors Available: <span style="color: #000000;">2</span>
	Memory Available: 682Mb
-=-=-=-=-=-=-=-
Virtual Machine Information
	Virtual Machine Vendor: Apple Inc.
	Virtual Machine Version: 1.6.0_17
&nbsp;
&nbsp;
<span style="color: #000000;">16</span>:<span style="color: #000000;">28</span>:<span style="color: #000000;">14</span>,<span style="color: #000000;">863</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>pool-<span style="color: #000000;">1</span>-thread-<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> INFO  DisplayLogger  - 
-=-=-=-=-=-=-=-
ElectroServer has started successfully</pre></div></div>

<p>After several hours of fiddling around this was somewhat of a relief. </p>
<p>The next problem was that I couldn&#8217;t navigate to the admin panel which by default you can find at 127.0.0.1:8080/admin. But whenever I pointed my browser at it all I got was an empty binary file in my downloads folder. Thank goodness for Twitter where <a href="http://twitter.com/mbolt35/">Matt Bolt</a> saved the day with <a href="http://twitter.com/mbolt35/status/7127087275">his tweet</a> : </p>
<blockquote><p>@sebleedelisle Make sure you&#8217;re using https, not http &#8211; I run into this constantly <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p></blockquote>
<p>Thank you Matt! I have no idea how I would have figured that one out without you! So I just navigated to https://127.0.0.1:8080/admin and it worked. </p>
<p>I expect to be furthering my adventures in ElectroServer over the next few days so I&#8217;ll keep you informed of how I get along. </p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2009/12/installing-electroserver-on-mediatemple/' rel='bookmark' title='Permanent Link: Installing ElectroServer on MediaTemple'>Installing ElectroServer on MediaTemple</a></li>
<li><a href='http://sebleedelisle.com/2010/01/giving-electroserver-more-memory/' rel='bookmark' title='Permanent Link: Giving ElectroServer more memory'>Giving ElectroServer more memory</a></li>
<li><a href='http://sebleedelisle.com/2010/01/electroserver-security-sandbox-violation-error/' rel='bookmark' title='Permanent Link: ElectroServer security sandbox violation error'>ElectroServer security sandbox violation error</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2009/12/installing-electroserver-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
