AS3 API port to Haxe ?
AS3 API port to Haxe ?
Are you considering to port the current AS3 client to pure Haxe code ? The big advantage will be performance and with haxe can easy target any platform - iOS, Android, Flash, html 5. Haxe have a strong community and many flash developers using haxe now.
Re: AS3 API port to Haxe ?
Not at the moment. Anyway all platforms you mentioned are already covered by the native APIs we distribute.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: AS3 API port to Haxe ?
And by other popular platforms such as Flash, Unity and C++
Re: AS3 API port to Haxe ?
Hi,
I'm using this subject to ask If someone now has already made the port of the client to http://haxe.org/ or as created an extension for http://www.openfl.org/ ?
With my company we are already using smartfox with haxe and the flash client but we need to go multiplateform. For this port haxe is pretty at ease using openfl.
However the sfs client need a wrapper in haxe and not beeing a swc.
I think we can do it from our side but it will be really simplier if we can have access to as3 sources. A clean port can be done and may be really multiplateform.
If nothing already exists can you give us access to as3 sources?
Thank you
I'm using this subject to ask If someone now has already made the port of the client to http://haxe.org/ or as created an extension for http://www.openfl.org/ ?
With my company we are already using smartfox with haxe and the flash client but we need to go multiplateform. For this port haxe is pretty at ease using openfl.
However the sfs client need a wrapper in haxe and not beeing a swc.
I think we can do it from our side but it will be really simplier if we can have access to as3 sources. A clean port can be done and may be really multiplateform.
If nothing already exists can you give us access to as3 sources?
Thank you
Re: AS3 API port to Haxe ?
Hi,
send us an email to the support@... email box and we'll send the sources over.
Thanks,
Marco
send us an email to the support@... email box and we'll send the sources over.
Thanks,
Marco
Re: AS3 API port to Haxe ?
Hi Boorik,
We are in the same boat, where we want to integrate the SFS2x api to Haxe/openFL. How has your implementation turned out to be ? can you please give some insight, we are very eager to know if the direction we are taking is right.
Regards,
Sac
We are in the same boat, where we want to integrate the SFS2x api to Haxe/openFL. How has your implementation turned out to be ? can you please give some insight, we are very eager to know if the direction we are taking is right.
Regards,
Sac
Re: AS3 API port to Haxe ?
Hi,
I'm back, on this conversion.
Currently I'm facing an issue on the meaning of this code in SFSIOHandler.as, function handleNewPacket :
L138 :
// Resize the array
return resizeByteArray(data, 1, length - 1)
What does the length refer to? is it data.length?
Thank you for helping
I'm back, on this conversion.
Currently I'm facing an issue on the meaning of this code in SFSIOHandler.as, function handleNewPacket :
L138 :
// Resize the array
return resizeByteArray(data, 1, length - 1)
What does the length refer to? is it data.length?
Thank you for helping
Re: AS3 API port to Haxe ?
Hi,
thanks for spotting this. It is quite odd
You're right, length is not defined as a local or variable or class variable therefore it should simply cause a compilation error and yet it doesn't. Additionally the superclass is Object which doesn't have any length properties.
I opened up Flash, and tried this code:
Without any variable length defined, this is what I see:
So why does the code works even if it looks wrong? Because in the line you have reported we end up calling
and when the last argument is zero it copies the entire content of the byte array, which is exactly what we want!
So yeah, this is the perfect phantom bug... it compiles without errors, and it runs correctly! You could even argue that it is not a bug, since passing 0 works the same as passing the full length of the byte array.
Fascinating!
Anyway, back to your question --> As you suggested the correct version should be data.length
Cheers
p.s. = I am still puzzled as to where is this length variable is coming from... any ideas?
thanks for spotting this. It is quite odd
You're right, length is not defined as a local or variable or class variable therefore it should simply cause a compilation error and yet it doesn't. Additionally the superclass is Object which doesn't have any length properties.
I opened up Flash, and tried this code:
Code: Select all
function test():void
{
trace("len: " + length)
}
Without any variable length defined, this is what I see:
Code: Select all
len: 1
So why does the code works even if it looks wrong? Because in the line you have reported we end up calling
Code: Select all
ByteArray.writeByte(data, 1, 1 - 1)
and when the last argument is zero it copies the entire content of the byte array, which is exactly what we want!
So yeah, this is the perfect phantom bug... it compiles without errors, and it runs correctly! You could even argue that it is not a bug, since passing 0 works the same as passing the full length of the byte array.
Fascinating!
Anyway, back to your question --> As you suggested the correct version should be data.length
Cheers
p.s. = I am still puzzled as to where is this length variable is coming from... any ideas?
Re: AS3 API port to Haxe ?
Thank you for answer.
I have no idea too
Have you some sort of test classes to validate my translation?
It is compiling but I need to know if everything is working fine.
I have no idea too
Have you some sort of test classes to validate my translation?
It is compiling but I need to know if everything is working fine.
Re: AS3 API port to Haxe ?
I know it is correct, because data.length is what we have in the code of the Java and C# API. So no problem there.
Re: AS3 API port to Haxe ?
Sorry,
That's not what I was trying to say. I'm sure data.length is the good answer.
But I have done a first version of the haxe client, currently compiling to flash and c++, using openfl framework.
I was wondering if you have some kind of unit tests to validate that everything I have done is working as expected.
Or anything that can be used in this purpose.
Thank you.
That's not what I was trying to say. I'm sure data.length is the good answer.
But I have done a first version of the haxe client, currently compiling to flash and c++, using openfl framework.
I was wondering if you have some kind of unit tests to validate that everything I have done is working as expected.
Or anything that can be used in this purpose.
Thank you.
Re: AS3 API port to Haxe ?
Oh I see. My bad.
Typically what you want to do is building small applications that test each aspect of the API, such as basic connection/login, Messages (public/private/mod/admin), RoomVariables etc...
You could take a look at the Flash Example pack we provide and translate those examples to Haxe, maybe simplifying the UI bells and whistles to speed up the process.
Also, as a side note, if you're interested in sharing the API with the rest of the community we could host them on our website, giving you full credit for the work. We would regard them as "unofficial" since we don't maintain them but we'd be happy to forward to you potential customers and users interested in using them etc...
Just throwing the idea there, if you're interested.
Cheers
Typically what you want to do is building small applications that test each aspect of the API, such as basic connection/login, Messages (public/private/mod/admin), RoomVariables etc...
You could take a look at the Flash Example pack we provide and translate those examples to Haxe, maybe simplifying the UI bells and whistles to speed up the process.
Also, as a side note, if you're interested in sharing the API with the rest of the community we could host them on our website, giving you full credit for the work. We would regard them as "unofficial" since we don't maintain them but we'd be happy to forward to you potential customers and users interested in using them etc...
Just throwing the idea there, if you're interested.
Cheers
Re: AS3 API port to Haxe ?
I'm interested but can it be opensourced on github?
updates and community improvements are really easier with it.
Anyway it must work correctly before spreading
updates and community improvements are really easier with it.
Anyway it must work correctly before spreading
Re: AS3 API port to Haxe ?
Sure, makes sense.
We could add your work to the list of available API, when they're ready and a link to your website or some other contact info for people interested in getting in touch etc...
Let us know when you think you're ready.
cheers
We could add your work to the list of available API, when they're ready and a link to your website or some other contact info for people interested in getting in touch etc...
Let us know when you think you're ready.
cheers
Re: AS3 API port to Haxe ?
Hey!
I have an early version.
What a pleasure of being able to compile to flash, windows and android!
A lot faster than air on android.
https://github.com/chapatiz/smartfox-haxe-client
Pull requests are welcome.
Cheers
I have an early version.
What a pleasure of being able to compile to flash, windows and android!
A lot faster than air on android.
https://github.com/chapatiz/smartfox-haxe-client
Pull requests are welcome.
Cheers
Return to “SFS2X ActionScript 3 API”
Who is online
Users browsing this forum: No registered users and 24 guests