NodeJS Target

Monkey Targets Forums/User Targets/NodeJS Target

Galaxy613(Posted 2012) [#1]
This is essentially a STDCPP-like Target that produces Javascript. I made it so I can write the actual server logic in Monkey and share classes from my Flash client. You of course need to rebuild/replace trans to get this to work. I included a edited targets.monkey so that you just need to unzip it in the main monkey folder, build it, and then you'll have the new target.

https://dl.dropbox.com/u/120376/NodeJSTarget.zip

I'm currently working on a module that uses NodeJS and Flash's XMLSocket for multiplayer games. And I may find out I need to add stuff to the target later because right now it doesn't use any config files or stuff. When you try to "Run" it'll try to call "node main.js"

Of course to get anything to really work you'll need to add some native code that uses the NodeJS stuffs. I did redirect the Print function to nodeJS's console.log

*Edit* Already had to update it with a simple update function. Somewhere in your NodeJS-specific native code you need to add:
UpdateTimeout = function()
{
	bb_server_Update();
	setTimeout(function(){
		UpdateTimeout();
	},500);
}


With bb_server_Update being the name of the monkey function that you want to be run every half a second.