Exemple #1
0
bool CClient::Login_Relay( uint iRelay ) // Relay player to a selected IP
{
	ADDTOCALLSTACK("CClient::Login_Relay");
	// Client wants to be relayed to another server. XCMD_ServerSelect
	// iRelay = 0 = this local server.

	// Sometimes we get an extra 0x80 ???
	if ( iRelay >= 0x80 )
	{
		iRelay -= 0x80;
	}

	// >= 1.26.00 clients list Gives us a 1 based index for some reason.
	if ( iRelay > 0 )
		iRelay --;

	CServerRef pServ;
	if ( iRelay <= 0 )
	{
		pServ = &g_Serv;	// we always list ourself first.
	}
	else
	{
		iRelay --;
		pServ = g_Cfg.Server_GetDef(iRelay);
		if ( pServ == NULL )
		{
			DEBUG_ERR(( "%x:Login_Relay BAD index! %u\n", GetSocketID(), iRelay ));
			return false;
		}
	}

	return addRelay( pServ );
}
Exemple #2
0
bool SuplaDeviceClass::addRelay(int relayPin, bool hiIsLo) {
    return addRelay(relayPin, 0, hiIsLo, false, SUPLA_BIT_RELAYFUNC_CONTROLLINGTHEGATEWAYLOCK
                    | SUPLA_BIT_RELAYFUNC_CONTROLLINGTHEGATE
                    | SUPLA_BIT_RELAYFUNC_CONTROLLINGTHEGARAGEDOOR
                    | SUPLA_BIT_RELAYFUNC_CONTROLLINGTHEDOORLOCK
                    | SUPLA_BIT_RELAYFUNC_POWERSWITCH
                    | SUPLA_BIT_RELAYFUNC_LIGHTSWITCH);
}
Exemple #3
0
bool SuplaDeviceClass::addRollerShutterRelays(int relayPin1, int relayPin2, bool hiIsLo) {
    return addRelay(relayPin1, relayPin2, hiIsLo, false, SUPLA_BIT_RELAYFUNC_CONTROLLINGTHEROLLERSHUTTER);
}
Exemple #4
0
bool SuplaDeviceClass::addRelay(int relayPin1) {
    return addRelay(relayPin1, false);
}