Beispiel #1
0
        void QueryAuthInterface()
        {
            int callID = Communicator.Call("kiara.implements", new List <string> {
                "auth"
            });

            Communicator.AddReplyHandler(callID, HandleQueryAuthInterfaceReply);
        }
Beispiel #2
0
        void HandleQueryAuthInterfaceReply(CallReply reply)
        {
            if (!reply.Success)
                Logger.Fatal("Failed to request auth service: {0}", reply.Message);

            List<bool> retValue = reply.RetValue.ToObject<List<bool>>();
            if (!retValue[0])
                Logger.Fatal("No auth service.");

            int callID = Communicator.Call("auth.login", GenerateRandomLogin(), "");
            Communicator.AddReplyHandler(callID, HandleAuthorizationReply);
        }
        void HandleQueryAuthInterfaceReply(CallReply reply)
        {
            if (!reply.Success)
            {
                Console.WriteLine("Failed to request auth service: {0}", reply.Message);
            }

            List <object> retValue = (List <object>)reply.RetValue;

            if (!(bool)retValue[0])
            {
                Console.WriteLine("No auth service.");
            }

            int callID = Communicator.Call("auth.login", GenerateRandomLogin(), "");

            Communicator.AddReplyHandler(callID, HandleAuthorizationReply);
        }