Help - Search - Members - Calendar
Full Version: Mplay Interference
Game Maker Community > Working with Game Maker > Advanced Users Only
finerkill
I'm wondering if there is any programs that interfere with Mplay functions particularly joining sessions.
Everything works until I try to join a local session on my laptop. The session is there as I have a debug message.
CODE
if mplay_session_find()>0
            {
                if mplay_session_name(0)="Main_Server"
                {
                    show_message("Server Found...Connecting")
                    mplay_session_join(0,string(Username))
                    if mplay_session_status()=2
                    {
                        show_message("Connection to server success. Press OK to continue to check Username and Password")
                    }
                    if mplay_session_status()=0
                    {
                        show_message("Connection to server failed.")
                    }
                    exit
                }
            }

It does not connect in the end.
Also, if I try on a friends computer, which I did, it works fine.
The connection is tcpip and the mplay_session_status() returns as 0.
Is there any programs that interfere with Mplay? Thnx in advance.

I have tried:

Shutting Windows Firewall
Shutting Windows Defender
Opening all ports on router
Closing all software that communicates with the internet
Tarik
I recommend in general to not use show_message as it makes the game unresponsive and may result in packet loss. It probably has no effect here though, as it works on your friend's computer.
Anyway, I'm not sure, if you're connecting to a local session you don't even need internet etc. You may not have the protocol installed however, while your friend does.

QUOTE
Game Maker offers four different types of connections: IPX, TCP/IP, Modem, and Serial. The IPX connection (to be more precise, it is a protocol) is almost completely transparent. It can be used to play games with other people on the same local area network. It needs to be installed on your computer to be used. (If it does not work, consult the documentation of Windows. Or go to the Network item in the control panel of Windows and add the IPX protocol.) TCP/IP is the internet protocol. It can be used to play with other players anywhere on the internet, assuming you know their IP address. On a local network you can use it without providing addresses.


It might be good to tell us exactly which debug messages you do get. (Are you for example getting "Server Found." and not "Server Connected", or are you not getting anything? etc. And your session creation might be helpful too. But first try installing the IPX protocol if you're not using TCP/IP.

Good luck.
ragarnak
QUOTE (finerkill @ Oct 31 2009, 02:27 PM) *
It does not connect in the end.
How did you start your connection / what does the "mplay_connect_status()" command return ?
finerkill
QUOTE (Tarik @ Oct 31 2009, 02:50 PM) *
I recommend in general to not use show_message as it makes the game unresponsive and may result in packet loss. It probably has no effect here though, as it works on your friend's computer.
Anyway, I'm not sure, if you're connecting to a local session you don't even need internet etc. You may not have the protocol installed however, while your friend does.

QUOTE
Game Maker offers four different types of connections: IPX, TCP/IP, Modem, and Serial. The IPX connection (to be more precise, it is a protocol) is almost completely transparent. It can be used to play games with other people on the same local area network. It needs to be installed on your computer to be used. (If it does not work, consult the documentation of Windows. Or go to the Network item in the control panel of Windows and add the IPX protocol.) TCP/IP is the internet protocol. It can be used to play with other players anywhere on the internet, assuming you know their IP address. On a local network you can use it without providing addresses.


It might be good to tell us exactly which debug messages you do get. (Are you for example getting "Server Found." and not "Server Connected", or are you not getting anything? etc. And your session creation might be helpful too. But first try installing the IPX protocol if you're not using TCP/IP.

Good luck.


Sorry...Should've mentioned it.
It's the "Connection to server failed."
And I am going to change the show_message to something else I've just started this project and this method that I'm using usually works.
finerkill
QUOTE (ragarnak @ Oct 31 2009, 02:50 PM) *
QUOTE (finerkill @ Oct 31 2009, 02:27 PM) *
It does not connect in the end.
How did you start your connection / what does the "mplay_connect_status()" command return ?

The connection is tcpip.
ragarnak
QUOTE (finerkill @ Oct 31 2009, 02:53 PM) *
The connection is tcpip.
Thats not quite what I wanted to know : are you entering an IP there when you want to connect locally (you shouldn't) ?

Allso, my question asked two things and you only (badly) answered one ... mellow.gif
finerkill
QUOTE (ragarnak @ Oct 31 2009, 03:10 PM) *
QUOTE (finerkill @ Oct 31 2009, 02:53 PM) *
The connection is tcpip.
Thats not quite what I wanted to know : are you entering an IP there when you want to connect locally (you shouldn't) ?

Allso, my question asked two things and you only (badly) answered one ... mellow.gif


Okay...This is the connection code:
CODE
mplay_init_tcpip("127.0.0.1")
if mplay_connect_status()=0
{
    show_message("Connection to server failed.") //Will actually change room to show error message.
}
if mplay_connect_status()=2
{
    show_message("Connected to server host")
    Draw=1//Draw Username and Password boxes
}


mplay_connect_status() returns as 2
I connect using the local IP address: 127.0.0.1
Tarik
We have your connection code, your session join code, but where is your session creation code? Also, an address is not needed for a local network game, just use no arguments.
Also, where are you initializing the connection for the client? You're looking for sessions on the current connection, but you're not initializing a connection, only with the server in the last post you made (which requires no arguments on a local network).

And just to check, you're saying you can find the session just fine, just not join it?
I don't actually believe there's anything wrong with the code though as it works on the other computer, (completely works right?) but just to make sure.
finerkill
QUOTE (Tarik @ Oct 31 2009, 03:32 PM) *
We have your connection code, your session join code, but where is your session creation code? Also, an address is not needed for a local network game, just use no arguments.
Also, where are you initializing the connection for the client? You're looking for sessions on the current connection, but you're not initializing a connection, only with the server in the last post you made (which requires no arguments on a local network).

And just to check, you're saying you can find the session just fine, just not join it?
I don't actually believe there's anything wrong with the code though as it works on the other computer, (completely works right?) but just to make sure.


Yes everything works on another computer that is why I asked if there is any programs that interfere with mplay functions. And, the session creatipn code works...well my debug says it works
CODE
if Username="Server_Start" and Password=""
        {
            mplay_session_create("Main_Server",0,"Server")
            if mplay_session_status()=0
            {
                show_message("Server creation failed, Restart and try again")
            }
            if mplay_session_status()=1
            {
                show_message("Server creation success, Press OK to continue to load game")
            }
            exit
        }

There is other steps before this but that's just the code you need.

For people who don't know there are three values for mplay_session_status()

0: No session
1: Created session
2: Joined session
Tarik
Well the code looks okay, which explains why it works on another comp. Ports or addresses can not really be a problem on a local network either. Your firewall was disabled.
Also, most problems would also occur when trying to find sessions, which works fine, just joining goes wrong.

There's possibilities of a lack of network card, also some network cards can't run off of battery power in laptops, or the protocol is not installed. But all these things are very unlikely.
finerkill
QUOTE (Tarik @ Oct 31 2009, 04:06 PM) *
There's possibilities of a lack of network card, also some network cards can't run off of battery power in laptops, or the protocol is not installed. But all these things are very unlikely.


What protocol is it? The IPX protocol? Or the TCP/IP Protocol? (I am on Vista)
The only reason I need it to work is for testing...
Opc44
QUOTE (finerkill @ Nov 1 2009, 05:07 AM) *
QUOTE (Tarik @ Oct 31 2009, 04:06 PM) *
There's possibilities of a lack of network card, also some network cards can't run off of battery power in laptops, or the protocol is not installed. But all these things are very unlikely.


What protocol is it? The IPX protocol? Or the TCP/IP Protocol? (I am on Vista)
The only reason I need it to work is for testing...

Did you make your game using GM7 or GM6? GM6 games are NOT compatible with Vista.
finerkill
QUOTE (Opc44 @ Nov 1 2009, 03:42 AM) *
QUOTE (finerkill @ Nov 1 2009, 05:07 AM) *
QUOTE (Tarik @ Oct 31 2009, 04:06 PM) *
There's possibilities of a lack of network card, also some network cards can't run off of battery power in laptops, or the protocol is not installed. But all these things are very unlikely.


What protocol is it? The IPX protocol? Or the TCP/IP Protocol? (I am on Vista)
The only reason I need it to work is for testing...

Did you make your game using GM7 or GM6? GM6 games are NOT compatible with Vista.


Okay...Here's the point. The game RUNS, it RUNS!! On my friends computer it works! His is also Vista. Yes I am using GM7. I am not that stupid. Read everything I write before answering. And don't forget the game RUNS! The code is fine...As it works fully without the debug message showing on another computer.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.