Forum General Unable to Test Fridge Magnets Example Code

Any issues or discussions relating to Flash development are welcome here.

Unable to Test Fridge Magnets Example Code

Postby Xuri » July 27th, 2011, 3:31 pm

I have followed the "Getting started with Flash and Player.IO" guide here: http://playerio.com/documentation/getti ... mbopackage

I followed the sets down to "Step 4, Running the development environment" without issue; however, I cannot seem to get the Flash client to connect to my local server. When I run the Flash code a window opens up and then cycles between displaying "Connecting" and "Unable to Connect to Server" very quickly.

I am running windows XP and chose to download Microsoft Visual C# 2010 Express.

The server seems to be running fine. Upon starting it displays the following output:
Server Started
========================
(waiting for connection)

Trying last loaded dll

Using Game Dll: FridgeMagnets.dll
========================
(dll: C:\Documents and Settings\adiehl\Desktop\Player.IO\Flash\Example - Multiplayer - FridgeMagnets\Serverside Code\Player.IO Test Server Project\bin\Debug\FridgeMagnets.dll)


When I try to connect to the server via telnet I believe that it works properly. Telnet outputs "Connecting To 127.0.0.1..." and then displays the following when I push any key:
<?xml version="1.0" ?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports = "*"/>
</cross-domain-policy>
Connection to host lost.
Press any key to continue...


I also checked netstat to make sure that port 8184 was not in use by anything else.

In addition to these steps, I changed my Flash Global Security Settings to always allow swfs (here: http://www.macromedia.com/support/docum ... ger04.html) and made sure that I do not have IPv6 enabled. I also disabled my windows firewall as well as my anti-virus software.

Finally, I have tried changing the Flash code from:
Code: Select all
function FridgeMagnets(){
         stop();
         PlayerIO.connect(
            stage,                        //Referance to stage
            "----OMITTED ON PURPOSE----",      //Game id (Get your own at playerio.com. 1: Create user, 2:Goto admin pannel, 3:Create game, 4: Copy game id inside the "")
            "public",                     //Connection id, default is public
            "GuestUser",                  //Username
            "",                           //User auth. Can be left blank if authentication is disabled on connection
            null,                        //Current PartnerPay partner.
            handleConnect,                  //Function executed on successful connect
            handleError                     //Function executed if we recive an error
         );   

         stage.scaleMode = StageScaleMode.NO_SCALE
         stage.align = StageAlign.TOP_LEFT
      }
      
      private function handleConnect(client:Client):void{
         trace("Sucessfully connected to player.io");
         
         //Set developmentsever (Comment out to connect to your server online)
         client.multiplayer.developmentServer = "127.0.0.1:8184";


To:
Code: Select all
function FridgeMagnets(){
         stop();
         PlayerIO.connect(
            stage,                        //Referance to stage
            "----OMITTED ON PURPOSE----",      //Game id (Get your own at playerio.com. 1: Create user, 2:Goto admin pannel, 3:Create game, 4: Copy game id inside the "")
            "public",                     //Connection id, default is public
            "GuestUser",                  //Username
            "",                           //User auth. Can be left blank if authentication is disabled on connection
            null,                        //Current PartnerPay partner.
            handleConnect,                  //Function executed on successful connect
            handleError                     //Function executed if we recive an error
         );   

         stage.scaleMode = StageScaleMode.NO_SCALE
         stage.align = StageAlign.TOP_LEFT
      }
      
      private function handleConnect(client:Client):void{
         trace("Sucessfully connected to player.io");
         
         //Set developmentsever (Comment out to connect to your server online)
         client.multiplayer.developmentServer = "localhost:8184";


I also checked the Hosts file in my Windows system32 directory. I believe the file is configured correctly. It reads:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost


At this point, I have tried everything that I found from previous forum posts without any success. Does anyone have any other ideas on what I can do to get this working?

Thanks.
Xuri
 
Posts: 3
Joined: July 26th, 2011, 7:47 pm

Re: Unable to Test Fridge Magnets Example Code

Postby Xuri » July 27th, 2011, 5:36 pm

I am having the same issue when trying to connect to the server after uploading the server code onto PlayerIO.

Following the instructions, I changed the client code to:

Code: Select all
function FridgeMagnets(){
         stop();
         PlayerIO.connect(
            stage,                        //Referance to stage
            "--OMMITTED---",      //Game id (Get your own at playerio.com. 1: Create user, 2:Goto admin pannel, 3:Create game, 4: Copy game id inside the "")
            "public",                     //Connection id, default is public
            "GuestUser",                  //Username
            "",                           //User auth. Can be left blank if authentication is disabled on connection
            null,                        //Current PartnerPay partner.
            handleConnect,                  //Function executed on successful connect
            handleError                     //Function executed if we recive an error
         );   

         stage.scaleMode = StageScaleMode.NO_SCALE
         stage.align = StageAlign.TOP_LEFT
      }
      
      private function handleConnect(client:Client):void{
         trace("Sucessfully connected to player.io");
         
         //Set developmentsever (Comment out to connect to your server online)
         //client.multiplayer.developmentServer = "127.0.0.1:8184";
         
         //Create pr join the room test
         client.multiplayer.createJoinRoom(
            "fridgemagnets",               //Room id. If set to null a random roomid is used
            "FridgeMagnets",               //The game type started on the server
            true,                        //Should the room be visible in the lobby?
            {},                           //Room data. This data is returned to lobby list. Variabels can be modifed on the server
            {},                           //User join data
            handleJoin,                     //Function executed on successful joining of the room
            handleError                     //Function executed if we got a join error
         );
      }


I have the same issue with the client switching between Connecting and Cannot Connect messages rapidly.
Xuri
 
Posts: 3
Joined: July 26th, 2011, 7:47 pm

Re: Unable to Test Fridge Magnets Example Code

Postby Xuri » July 27th, 2011, 7:40 pm

Well, I have no idea what the problem was, but I cleared my old extraction of the code and re-extracted it from the same zip file. Everything is working fine now. Weird.
Xuri
 
Posts: 3
Joined: July 26th, 2011, 7:47 pm


Return to General