DIRECTORY BluejaySmarts, IO, Names USING [ CurrentPasskey, OwnNetAddress ], NamesRPC USING [ StartConversation ], RPC USING [ AuthenticateFailed, EncryptionKey, ImportFailed, VersionRange ], Log USING [ ReportFR ], ThParty USING [ CreateParty, Register ], ThPartyRpcControl, Thrush USING [ nullHandle, PartyHandle, ROPE, SmartsHandle, unencrypted ], ThSmarts, ThSmartsRpcControl USING [ ExportInterface, InterfaceName ], ThVersions USING [ GetThrushVR, JayVersion, JayVR ], UserProfile USING [ Token ] ; BluejayRegisterImpl: CEDAR PROGRAM IMPORTS BluejaySmarts, IO, Log, Names, NamesRPC, RPC, ThParty, ThPartyRpcControl, ThSmartsRpcControl, ThVersions, UserProfile EXPORTS BluejaySmarts = { OPEN IO; myName: ThSmartsRpcControl.InterfaceName; serverPassword: RPC.EncryptionKey; BluejayRegister: PUBLIC PROC RETURNS [partyID: Thrush.PartyHandle_Thrush.nullHandle, smartsID: Thrush.SmartsHandle_Thrush.nullHandle] = { thrushInstance: Thrush.ROPE= UserProfile.Token[key: "ThrushClientServerInstance", default: "Morley.Lark"]; thVR: RPC.VersionRange = ThVersions.GetThrushVR; myName _ [ type: "ThSmarts.Lark", instance: UserProfile.Token[key: "BluejayServerInstance", default: "Strowger.Lark"], version: ThVersions.JayVR]; serverPassword _ Names.CurrentPasskey[UserProfile.Token[ key: "BluejayServerPassword", default: "MFLFLX"]]; ThSmartsRpcControl.ExportInterface[ interfaceName: myName, user: myName.instance, password: serverPassword]; BluejaySmarts.jayShh _ IF NOT BluejaySmarts.encryptionRequested THEN Thrush.unencrypted ELSE NamesRPC.StartConversation [ caller: myName.instance, callee: thrushInstance --rName--, key: serverPassword, level: --<>--CBCCheck ! RPC.AuthenticateFailed=>GOTO InitFailed]; ThPartyRpcControl.ImportInterface[ interfaceName: [type: "ThParty.Lark", instance: thrushInstance, version: thVR] ! RPC.ImportFailed=> IF why=wrongVersion THEN { Log.ReportFR["Bluejay version %d too old; import failed", $Bluejay, NIL, card[ThVersions.JayVersion]]; GOTO InitFailed; }]; BluejaySmarts.interfaceIsImported_TRUE; partyID_ThParty.CreateParty[type: recording, rName: NIL]; IF partyID=Thrush.nullHandle THEN ERROR; smartsID _ ThParty.Register[ shh: BluejaySmarts.jayShh, partyID: partyID, interface: NEW[ThSmartsRpcControl.InterfaceName_myName], properties: [x: voiceTerminal[machine: Names.OwnNetAddress[]]]]; IF smartsID=Thrush.nullHandle THEN GOTO InitFailed; EXITS InitFailed => IF BluejaySmarts.interfaceIsImported THEN ThPartyRpcControl.UnimportInterface[]; }; }. ìBluejayRegisterImpl.mesa Last modified by D. Swinehart, August 4, 1984 6:56:24 pm PDT Export ThSmarts Interface << must get from Identify[] in Thrush.LarkSmarts, I guess. >> Import ThParty Interface Register First Jay Party. ʨ˜Jšœ™Jšœ<™