Blockland Forums > Modification Help
Checking If A Client Does Not Have A Add On
otto-san:
--- Quote from: Nexus on October 28, 2011, 10:20:28 PM ---But the client sends no information during that.
--- End quote ---
using onconnectrequest can break things
Nexus:
--- Quote from: otto-san on October 28, 2011, 10:21:35 PM ---using onconnectrequest can break things
--- End quote ---
yes
But there is no communication between the server and the client during the admin check. I guess you could give the client a clientcmd that sent the info to the server, but I always found pinging responses to be not ideal.
otto-san:
--- Quote from: Nexus on October 28, 2011, 10:35:46 PM ---yes
But there is no communication between the server and the client during the admin check. I guess you could give the client a clientcmd that sent the info to the server, but I always found pinging responses to be not ideal.
--- End quote ---
Pinging probably isn't that great an option, but it's probably one of the best options.
Fairly easy to do, as well.
Greek2me:
Server:
--- Code: ---package Slayer_Dependencies_GameConnection
{
function GameConnection::autoAdminCheck(%client)
{
%client.isHost = (%client.isLocalConnection() || %client.getBLID() == getNumKeyID());
//snip
//tell the client that Slayer is enabled
commandToClient(%client,'Slayer_Handshake',$Slayer::Server::Version);
//snip
return parent::autoAdminCheck(%client);
}
};
activatePackage(Slayer_Dependencies_GameConnection);
function serverCmdSlayer_Handshake(%client,%version)
{
if(%client.isSpamming())
return;
%client.slayerVersion = %version;
if(%version !$= $Slayer::Server::Version)
{
for(%i=0; %i < getFieldCount($Slayer::Server::CompatibleVersions); %i++)
{
if(getField($Slayer::Server::CompatibleVersions,%i) $= %version)
{
%noReturn = 1;
break;
}
}
if(!%noReturn)
return;
}
%client.slayer = 1;
//snip
}
--- End code ---
Client:
--- Code: ---function clientCmdSlayer_Handshake(%version)
{
slyrClientDebug(1,"Handshake Recieved","Server has Version" SPC %version @ ". Responding...");
if(%version !$= $Slayer::Client::Version)
{
for(%i=0; %i < getFieldCount($Slayer::Client::CompatibleVersions); %i++)
{
%f = getField($Slayer::Client::CompatibleVersions,%i);
if(%f $= %version)
{
%clVersion = %f;
break;
}
}
}
if(%clVersion $= "")
%clVersion = $Slayer::Client::Version;
commandToServer('Slayer_Handshake',%clVersion);
}
--- End code ---
That should be pretty easy to adapt to your own mod.
jes00:
--- Quote from: Greek2me on October 30, 2011, 05:53:54 PM ---Server:
-Code-
Client:
-Code-
That should be pretty easy to adapt to your own mod.
--- End quote ---
Would this work?
Server:
--- Code: ---package Summoning_Dependencies_GameConnection
{
function GameConnection::autoAdminCheck(%client)
{
%client.isHost = (%client.isLocalConnection() || %client.getBLID() == getNumKeyID());
//snip
//tell the client that Server_Summoning is enabled
commandToClient(%client,'Summoning_Handshake',$Summoning::Server::Version);
//snip
return parent::autoAdminCheck(%client);
}
};
activatePackage(Summoning_Dependencies_GameConnection);
function serverCmdSummoning_Handshake(%client,%version)
{
if(%client.isSpamming())
return;
%client.summoningVersion = %version;
if(%version !$= $Summoning::Server::Version)
{
for(%i=0; %i < getFieldCount($Summoning::Server::CompatibleVersions); %i++)
{
if(getField($Summoning::Server::CompatibleVersions,%i) $= %version)
{
%noReturn = 1;
break;
}
}
if(!%noReturn)
return;
}
%client.summoning = 1;
//snip
}
--- End code ---
Client:
--- Code: ---function clientCmdSummoning_Handshake(%version)
{
summoningClientDebug(1,"Handshake Recieved","Server has Version" SPC %version @ ". Responding...");
if(%version !$= $Summoning::Client::Version)
{
for(%i=0; %i < getFieldCount($Summoning::Client::CompatibleVersions); %i++)
{
%f = getField($Summoning::Client::CompatibleVersions,%i);
if(%f $= %version)
{
%clVersion = %f;
break;
}
}
}
if(%clVersion $= "")
%clVersion = $Summoning::Client::Version;
commandToServer('Summoning_Handshake',%clVersion);
}
--- End code ---