Can as3 setup/run a proper lan connection between 2 or more computer? Can it be done with the new flash.net.Socketaddition?
CHeers
Printable View
Can as3 setup/run a proper lan connection between 2 or more computer? Can it be done with the new flash.net.Socketaddition?
CHeers
Define 'proper lan connection'.
In the examples (seperate download), there is a telnet application, so a TCP/IP connection is possible. But UDP isn't supported as far as I know, which is too bad.
EDIT: check out the diagram on this page http://en.wikipedia.org/wiki/Internet_protocol_suite (to the right) to get a better understanding on the different layers of data transport.
Its ok, i already know about that stuff, learnt it in cisco.Quote:
check out the diagram on this page http://en.wikipedia.org/wiki/Internet_protocol_suite (to the right) to get a better understanding on the different layers of data transport.
Maby you can answer this question?
There is still no way to store data on the users HDD? Other than sharedObjects?
I would think that being able to save info on a computer would be a security issue. If you want to use flash to save then try flash 5 because that was the last version that had saving functions included.
AS3 can open a TCP socket to any destination as long as the Flash player security restrictions are met (damn assinine restrictions!!!). XMLSocket could do the same but it couldn't really communicate anything but text, Socket supports ByteArray so you can transfer real data. Hence the possibility to create a telnet example.
Flash can't LISTEN on a socket yet, so you can't do peer-to-peer with just the player alone. Additionally, at this point, you can't send/recieve datagram packets (UDP).
Do you think p2p is a possibility that could develop?
Uh, in my previous post I said:Quote:
Do you think p2p is a possibility that could develop?
p2p is peer-to-peer. So unless you want to do a hybrid solution using something like Flash + another home-grown plugin, Java Applet, or something installed on their machine you won't be able to do p2p.Quote:
Flash can't LISTEN on a socket yet, so you can't do peer-to-peer with just the player alone.
But do you think that they will enable it later on is what I'm asking?
Allowing clients to listen is a fairly huge thing for Adobe, it then enters them into the realm of security etc. I can't see it happening any time soon, but who knows.
I agree with iopred. I wouldn't expect to see it any time soon.
Does anyone know of some sort of a hack or something that would create this feature?
Yeah, using a swf2exe tool that allows you to use dlls. Don't think there is one for flash 9 yet, though.
If you want it in the browser, you'd have to communicate with a java applet or something. I don't think you can do that directly, but if Java can communicate with Javascript, you could use that to communicate between the two. Don't know if I would recommend it, but I don't see any other way.
Ok, I'm going to quote my first post again:
Which is basically the same thing Fall_X said as well. The hack would be to implement what I (and Fall_X) described. Not to put too fine of a point on it, but please read our posts to avoid asking a question that's already been answered.Quote:
So unless you want to do a hybrid solution using something like Flash + another home-grown plugin, Java Applet, or something installed on their machine you won't be able to do p2p.
We (Electrotank) built a prototype of this and it worked ok but the lag of Java --> JS --> Flash and back was substantial and far outweighted any realistic advantages of p2p. Why does it need to be p2p and not just client <-> server?
Could you release your prototype? That would be really cool even if it's kind of slow some people would like to use it like me. Why throw work down the drain? I'm sorry if I'm being annoying or anything.
Hey webgeek? Are you going to release to p2p stuff that you've done? I would like to try it out for my self.
I wouldn't get my hopes up. Off course, I can't talk for webgeek or electrotank, but I personally wouldn't release a prototype just like that for a number of obvious reasons.
Why don't you give it a shot yourself? It will be a lot more rewarding, and you'll learn a whole lot. It wouldn't be too difficult to get java and flash to communicate. The p2p part might be a bit harder to do, but it's good experience.
The problem is learning java. Right now I'd say that I'm an intermediate in flash and a novice in java (I took one course in learning basic concepts). I'm far off from doing anything big with java.
Understandable, but it doesn't have to be a huge project. Just make a test to see if you can get the two to communicate through javascript, and go from there.
Or wait and hope for Webgeek to release that prototype they did, but chances are they won't.
I don't even know where to start though. Could it be possible to use javascript/java to receive and the built in functions to send? Maybe this is.
Sorry, we won't release the prototype as it stands. You are on the right track already though with Java to recieve and Flash to send. Don't forget the need for cross-domain policy files on the listening clients. Thanks to Adomedia's stupid implementation, you will also need to listen for HTTP requests with the same applet. The bigger problem you are going to run into is the signing of the applet. That's a real pain. Additionally, every browser handles it differently.
To be honest, I don't know why you are dead set on P2P but I wouldn't bother if I were you. In the end, it's going to be slower then client-server due to the very round-about way you have to implement it with Flash. Additionally, it's going to have a great deal of quirky issues with the Javascript interaction piece.
Additionally you have a lot of people who disable Javascript.
Can it be java receiving not javascript?
You can't send messages to java directly, so that's why you'd be using javascript to send messages back and forth between Flash and Java.
But really, it's probably not worth it, except for the learning experience... Why do you need p2p so badly?
It would be nice. Plus, I don't think that I can install a server on my website. So, I see this as the only other option. What servers do you suggest then? I would like to learn how to make this kind of stuff.
What do you mean whith "this kind of stuff"?
If it's a turn based multiplayer game that you want to make, you can get by with php/asp on your hosting account.
If you want to make a realtime game, I don't know of any servers that support Flash 9 yet (using tcp sockets), but they will emerge (and might exist, I just don't know about them).
You could try writing one yourself too (in Java, C#, C++, whatever...). But off course, this is a bit complex, and will require a server to host it on. But you can develop it without a server, using your own computer during development.
Keep in mind that realtime multiplayer game development is a rather advanced topic (even more so when you're using p2p I guess). I consider myself a pretty good developer, and have worked on multiplayer stuff both in Flash and other languages, but it would still cause me some headaches (a lot actually). If you want to do it right, you'll have to worry about things like lag, and predicting player positions based on current movement (using splines). A whole lot of fun :)
So if you want to learn about multiplayer game development, I suggest you start with a turnbased game, using PHP or something similar.
Hope this is of any help.
That's the problem though, I don't really know any of those languages.
That's not a problem, that's an opportunity to learn! :)
Edit : serverside scripting in something like PHP is relatively easy. Just spit out xml or urlencoded documents, and open those with Flash. You could get something very simple up and running in a few days.