Author Topic: Check for gui version?  (Read 822 times)

Basically I want it to make sure the player has the GUI version before allowing them to connect, but at the same time I don't want it spamming play x has connected player x has left over and over again because someone didn't download the gui. I tried using the DRPG method but anyone with both my client and the DRPG client, DRPG overwrites the method.

No, it doesn't overwrite the method, it merely adds an argument to the commands
Make your's 1 argument forward
so if it is now
gameConnection::getConnectionRequest(%client,%a,%b,%c,%d,%e,%f,%g,%h,%i)
%h is what DRPG uses, but to be on the safe side use
gameConnection::getConnectionRequest(%client,%a,%b,%c,%d,%e,%f,%g,%h,%i,%newarg)

This should fix it.

Hmm, Cheese6(AKA Brian Smith) got a new account?

The better solution would be for everyone to agree that a certain argument is a tab-delimited list of information, and how to read it so that you only interact with your own mod's data. That way, conflicts like this wouldn't happen (I blame RTB partially, as it uses an arg on it's own, and would have been large enough to introduce such a shared feature in a way that got others to use it properly)


I would suggest something like this, since it would still break with add-ons that don't, but it would work alongside others that did the same. After that, it would just be convincing everyone else to do so too.

Code: [Select]
package AddonConnectArgs
{
    function GameConnection::onConnectRequest(%this, %a, %b, %c, %d, %e, %f, %g, %h, %i)
    {
        for(%fieldNum = 0; %fieldNum < getFieldCount(%h); %fieldNum++)
        {
            %field = getField(%h, %fieldNum);

            if(getWord(%field, 0) $= "MyTag")
            {
                //Do something with %field
            }
        }

        Parent::onConnectRequest(%this, %a, %b, %c, %d, %e, %f, %g, %h, %i);
    }
};

activatePackage(AddonConnectArgs);


Code: [Select]
package AddonConnectArgsClient
{
    function GameConnection::setConnectArgs(%a, %b, %c, %d, %e, %f, %g, %h, %i)
    {
         Parent::setConnectArgs(%a, %b, %c, %d, %e, %f, %g, %h TAB "MyTag" SPC $versionNumber, %i);
    }
};

activatePackage(AddonConnectArgsClient);