A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 45

Thread: XenSoft FlashNetwork

  1. #21
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    I dont understand it

    The other person must click the Network menu and select Connect to another Computer. A small dialog box will pop up, where the user can enter the hosting computer's IP address. Click OK, and the connection will be made.
    How will I know the IP address of someone elses computer? I could perhaps know the computers name in the network...

    So, could the server program set some name, like "xserver" and then client could type this name in the box to connect?

  2. #22
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    You can get your own ip address through the projector, so a php script could do the matchmaking, you give it your ip, go back to it again, and it gives you an ip, and that ip's holder get's yours when they check again. Then, it would do it all by magic.

  3. #23
    Senior Member
    Join Date
    Jul 2000
    Posts
    323

    Version 0.2 Released

    Ok, since no one seems to have any problems with it (Or care about it), I've put out the first full release, still BETA until I figure out if there are any major bugs...

    You can get it at: XenSoft.net

    Changes in this release:
    • Changed the background to black (I think it looks better)
    • Added Help > Instructions, which displays a readme-type notice.
    • Movies can now be loaded on the command-line, e.g. XSFN.exe mymovie.swf

    From this point on, I'll do my best not to change existing API functions, so old XSFN-compatible movies will always work on newer versions.

    So, enjoy... Remember, bugs, suggestions, etc, are always welcome.

    Oh, and it'd be nice to know if anyone is actually making any games for it... I've started one, but I wasn't just making this for myself

  4. #24
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370

    Re: Version 0.2 Released

    Originally posted by Xentor
    • Movies can now be loaded on the command-line, e.g. XSFN.exe mymovie.swf
    Yay!

    And I'll make a game for it. I already have a kewl idea, but I will start with it over 3 weeks, after my finals.(busy, busy, busy..)

  5. #25
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    When I made a button with:
    fscommand ("LISTEN");
    and clicked on it once, it went to "Listening to connection..." mode.

    Now, when I clicked on the button again, while in the listening mode, I got error message:

    Run-time error '40020':
    Invalid operation at current state

    and XSFN closed.


    I would also like to see XSFN have the option to find hosts from the network itself. I find it quite annoying to type in IP adress. Can please add this option?

  6. #26
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Why cant I read variables localip, remoteip, remotehost? Are the not supported yet, or am I just hopeless?

  7. #27
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    Finally, someone found a bug...Looks like I missed an error trap... Easy fix... Before, the program depended on just disabling the menu options that wouldn't work, but I forgot that the flash movie doesn't have to follow those rules...

    The network variables are set INSIDE the XSFN movie clip, not in the main timeline... This was done in order to help separate the network code from the rest of the game, and make it a bit more modular. /XSFN:localip is set at the very beginning, as soon as frame 1 finishes loading... /XSFN:remotehost and remoteip are set when a connection is completed (When you enter the online state).

    As for finding hosts on the local network, I'm putting that on my to-do list... Sounds like a good idea...

  8. #28
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Originally posted by Xentor
    The network variables are set INSIDE the XSFN movie clip, not in the main timeline... This was done in order to help separate the network code from the rest of the game, and make it a bit more modular. /XSFN:localip is set at the very beginning, as soon as frame 1 finishes loading... /XSFN:remotehost and remoteip are set when a connection is completed (When you enter the online state).
    No, still no luck with them.

    This is how I made it:
    In your XSFNtest1 movie I made separate layer and put new mc there with action:
    Code:
    onClipEvent (enterFrame) {
        _root.localip = _root.XSFN.localip;
        _root.remoteip = _root.XSFN.remoteip;
        _root.remotehost = _root.XSFN.remotehost;
    }
    and I made 3 dynamic text boxes in the root with variables assigned: localip, remoteip and remotehost

    None of those show up, not in the any states.


    Also, when I run 2 instances of XSFN in same computer and set both of them to listen, I get error message:
    Run-time error '10048':
    Address in use

    I guess its right for running too many XSFN same time
    [Edited by tonypa on 05-03-2002 at 12:30 PM]

  9. #29
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    Well, first of all, the chat example I wrote was done before the localip variable was made available, and in that movie, the XSFN movie clip isn't created until frame 3... The localip variable is set the instant the movie finishes loading frame 1, and when that happens, the XSFN mc doesn't exist yet.

    As for remotehost and remoteip... I knew this thing wasn't ready to be released, but no one was interested while it was just a "developer's release"... Bug #2... Due to some restructuring somewhere in the middle of the development process, those are being set in the root when they should be in the XSFN mc...

    Just gotta repackage this thing, and I'll release it with the bug fixes...

    tony, ever considered professional beta-testing?

    EDIT: Version 0.2.1 released, with these bugs fixed. (Download)
    [Edited by Xentor on 05-03-2002 at 12:53 PM]

  10. #30
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    Xentor -I don't have much time to check out the whole program. I have realy a lot to do. But I think it's a very good project and when I start making a game for it, over three weeks after my exams, I will also help debugging it, ok..

  11. #31
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Thanks, Xentor, for fixing it so fast

    Here is an example, where coordinates of hero (green square) are sent to other movie and there enemy (red square) is positioned there.
    Try to save it somehow on your disk:
    http://www.hot.ee/tonypa/flash/flas/XSFNtest2.swf

  12. #32
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    Originally posted by tonypa
    ..save it somehow on..
    Just right-click on the link and choose 'Save Target As...'.

  13. #33
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Xentor you have any documentation how you script your movies to use the networks. I mean in a single game how would you diferentiate between host and guest(s) using single AS.

    I hope this made sence.

    ms

  14. #34
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    All of the API documentation is on the website... Shows ya what commands are available...

    And once the two computers connect, it's a peer-to-peer connection, so it really doesn't make a difference which is the client and which is the server...

  15. #35
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Gotcha..

    I was thinkin if possible to get both IPs. I mean for example in a chat room:

    1. you enter name. and then when you type you get:


    mad-sci> hi Xentor
    Xentor > hi mad-sci

    see my point. So have one AS for the chat room displaing diferent avatars and different coolors..

    ms

  16. #36
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    Well, the remoteip and localip are both available...

    Don't forget, you can send just about anything over the network, so as soon as the computers connect, you could have both movies send "NAME myname", and the other computer would know their name.

  17. #37
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Very cool, Ill keep in thouch with you over the ICQ..

    ms

  18. #38
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    Ok, I've got a network search working... Basically, once the game is loaded, you select the Find option from the network menu, and it pops up a list of computers on the local network who are running the same game as you, and listening for a connection...

    In order to make that work, the game has to tell XSFN its name... For example, when a modified version of my chat demo runs, the first frame contains:

    fscommand("MOVIENAME","XSCHATDEMO")

    Once XSFN knows the name of the game, it enables the Find option. When the user clicks the find option, XSFN immediately sends a broadcast to the network, basically saying (Though in code), "Hey, any XSFN's out there playing XSCHATDEMO?" (Hehe)... As they respond, it lists them for you, and you can double-click one to connect to it...

    The problem is, all I can really display (Info about the listed hosts), is the IP address, the version of XSFN being used, and the ping time...

    I want to be able to display a name for each computer found, but that would require any computer going into "Listening" mode to have a name.

    Basically I can think of a few options for that...
    • Ask for their name when XSFN starts, and save it in the registry until they change it via a menu option.
    • Prompt them for a name every time they enter listen mode
    • Assign a default name (i.e. "User" or "Nameless"), display the user's name while they're listening, and have an option to change it, again via a menu option.


    Any opinions?

  19. #39
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    Maybe you can let the flash movie ask to the user a name to use. Then if that users goes into listening mode, he will also send it's name with the normal vars...

  20. #40
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    I was thinking, it could be nice, if you can hide all the XSFN menu, like with FSCommand showmenu. And when it will have transparent background, it will be very cool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center