Page 1 of 1

Bypass the Protocol Selection Screen

Posted: Sat Oct 09, 2010 7:26 pm
by mh
It's a small cosmetic change, but it's small changes like this that add a layer of polish to the end result, and end up giving a more professional impression.

By default when you use the Multiplayer menus you get a screen allowing you to select IPX, TCP/IP, etc. However, if only one protocol is available on your PC there's no reason why you can't just go directly to the next menu instead. Well now you can. Replace your M_Menu_Net_f with this lot:

Code: Select all

qboolean m_net_recursive = false;

void M_Menu_Net_f (void)
{
    qboolean m_net_direct = false;

    IN_Deactivate (vid.type == MODE_WINDOWED);

    // either go direct to the appropriate menu or use the protocol selection menu.
    // the protocol selection menu will only show if 2 or more protocols are available.
    // it also shows if none are available to inform the user of this fact.
    // note that serial counts as 2 protocols - modem and direct connect.
    if (!serialAvailable && !ipxAvailable && !tcpipAvailable) m_net_direct = false;
    if (serialAvailable && !ipxAvailable && !tcpipAvailable) m_net_direct = false;
    if (!serialAvailable && ipxAvailable && !tcpipAvailable) m_net_direct = true;
    if (!serialAvailable && !ipxAvailable && tcpipAvailable) m_net_direct = true;

    if (m_net_direct)
    {
        if (!m_net_recursive)
        {
            // automatically select the correct protocol and go to the appropriate menu
            m_net_recursive = true;
            m_net_cursor = ipxAvailable ? 2 : 3;
            M_Menu_LanConfig_f ();
            return;
        }
        else
        {
            m_net_recursive = false;
            M_Menu_MultiPlayer_f ();
            return;
        }
    }
    else m_net_recursive = false;

    key_dest = key_menu;
    m_state = m_net;
    m_entersound = true;
    m_net_items = 4;

    if (m_net_cursor >= m_net_items)
        m_net_cursor = 0;

    m_net_cursor--;
    M_Net_Key (K_DOWNARROW);
}
I don't suppose too many older hands use the Multiplayer menus, but this should add some user-friendliness for those who are new and/or are uncomfortable with the console.

Posted: Sun Oct 10, 2010 2:00 pm
by dreadlorde
Is IPX support even needed though? iirc I removed it from my engine, then again, my engine segfault's when trying to do multiplayer. :P

Posted: Sun Oct 10, 2010 4:19 pm
by Spike
needed or not (very unlikely) its very unlikely to actually be supported.
certain old games have buggy ip support (actually, of the ones that support both, most have buggy ip support... including quake - nats)... otherwise ipx would not normally be used.

Posted: Sun Oct 10, 2010 6:01 pm
by frag.machine
Spike wrote:needed or not (very unlikely) its very unlikely to actually be supported.
certain old games have buggy ip support (actually, of the ones that support both, most have buggy ip support... including quake - nats)... otherwise ipx would not normally be used.
Back in 1995/1996 IPX was a widely used protocol, more than TCP/IP in fact. The fault wasn't in the games or apps, but in the MS-DOS and its lack of any networking support at all. Netware IPX/SPX was in fact easier to set up (and more reliable) than the available third part TCP/IP stacks. So, it was kinda natural Quake to offer the option.

Nowadays supporting anything besides TCP/IP is just a waste of time and effort. I just chopped off everything but TCP/IP from Q2K4 a long, long time ago. No regrets. :)