RegisterLoginResponseCallback() 공개 메소드

public RegisterLoginResponseCallback ( LoginResponseCallback callback ) : void
callback LoginResponseCallback
리턴 void
예제 #1
0
        public InventoryManager(GridClient client, NetworkManager network, AgentManager agents)
        {
            _Client = client;
            _Network = network;
            _Agents = agents;
            _Network.RegisterCallback(PacketType.UpdateCreateInventoryItem, new NetworkManager.PacketCallback(UpdateCreateInventoryItemHandler));
            _Network.RegisterCallback(PacketType.SaveAssetIntoInventory, new NetworkManager.PacketCallback(SaveAssetIntoInventoryHandler));
            _Network.RegisterCallback(PacketType.BulkUpdateInventory, new NetworkManager.PacketCallback(BulkUpdateInventoryHandler));
            _Network.RegisterCallback(PacketType.InventoryDescendents, new NetworkManager.PacketCallback(InventoryDescendentsHandler));
            _Network.RegisterCallback(PacketType.FetchInventoryReply, new NetworkManager.PacketCallback(FetchInventoryReplyHandler));
            _Network.RegisterCallback(PacketType.ReplyTaskInventory, new NetworkManager.PacketCallback(ReplyTaskInventoryHandler));

            // Watch for inventory given to us through instant message
            _Agents.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);

            // Register extra parameters with login and parse the inventory data that comes back
            List<string> options = new List<string>(5);
            if (Settings.ENABLE_INVENTORY_STORE)
            {
                options.Add("inventory-root");
                options.Add("inventory-skeleton");
            }
            if (Settings.ENABLE_LIBRARY_STORE)
            {
                options.Add("inventory-lib-root");
                options.Add("inventory-lib-owner");
                options.Add("inventory-skel-lib");
            }
            if (Settings.ENABLE_INVENTORY_STORE || Settings.ENABLE_LIBRARY_STORE)
            {
                // Register extra parameters with login and parse the inventory data that comes back
                _Network.RegisterLoginResponseCallback(
                    new NetworkManager.LoginResponseCallback(Network_OnLoginResponse),
                    options.ToArray());
            }
        }
예제 #2
0
        /// <summary>
        /// Internal constructor
        /// </summary>
        /// <param name="client">A reference to the GridClient Object</param>
        internal FriendsManager(LoggerInstance log, NetworkManager network, InventoryManager inventory, AgentManager self, AvatarManager avatars)
        {
            Log = log;
            Network = network;
            Inventory = inventory;
            Self = self;
            Avatars = avatars;

            Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnect);
            Avatars.OnAvatarNames += new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);
            Self.OnInstantMessage += new AgentManager.InstantMessageCallback(MainAvatar_InstantMessage);

            Network.RegisterCallback(PacketType.OnlineNotification, OnlineNotificationHandler);
            Network.RegisterCallback(PacketType.OfflineNotification, OfflineNotificationHandler);
            Network.RegisterCallback(PacketType.ChangeUserRights, ChangeUserRightsHandler);
            Network.RegisterCallback(PacketType.TerminateFriendship, TerminateFriendshipHandler);
            Network.RegisterCallback(PacketType.FindAgent, OnFindAgentReplyHandler);

            Network.RegisterLoginResponseCallback(new NetworkManager.LoginResponseCallback(Network_OnLoginResponse),
                new string[] { "buddy-list" });
        }
예제 #3
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">Reference to the GridClient object</param>
        public InventoryManager(LoggerInstance log, NetworkManager network, AgentManager self, AssetManager assets)
        {
            _Log = log;
            _Network = network;
            _Assets = assets;
            _Self = self;

            _Network.RegisterCallback(PacketType.UpdateCreateInventoryItem, new NetworkManager.PacketCallback(UpdateCreateInventoryItemHandler));
            _Network.RegisterCallback(PacketType.SaveAssetIntoInventory, new NetworkManager.PacketCallback(SaveAssetIntoInventoryHandler));
            _Network.RegisterCallback(PacketType.BulkUpdateInventory, new NetworkManager.PacketCallback(BulkUpdateInventoryHandler));
            _Network.RegisterCallback(PacketType.MoveInventoryItem, new NetworkManager.PacketCallback(MoveInventoryItemHandler));
            _Network.RegisterCallback(PacketType.InventoryDescendents, new NetworkManager.PacketCallback(InventoryDescendentsHandler));
            _Network.RegisterCallback(PacketType.FetchInventoryReply, new NetworkManager.PacketCallback(FetchInventoryReplyHandler));
            _Network.RegisterCallback(PacketType.ReplyTaskInventory, new NetworkManager.PacketCallback(ReplyTaskInventoryHandler));
            _Network.RegisterEventCallback("ScriptRunningReply", new Caps.EventQueueCallback(ScriptRunningReplyMessageHandler));

            // Watch for inventory given to us through instant message
            _Self.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);

            // Register extra parameters with login and parse the inventory data that comes back
            _Network.RegisterLoginResponseCallback(
                new NetworkManager.LoginResponseCallback(Network_OnLoginResponse),
                new string[] {
                    "inventory-root", "inventory-skeleton", "inventory-lib-root",
                    "inventory-lib-owner", "inventory-skel-lib"});
        }
예제 #4
0
        public SimpleClient()
        {
            Log = new LoggerInstance();
            Network = new NetworkManager(Log);
            Throttle = new AgentThrottle(Network);

            Network.RegisterLoginResponseCallback(
                delegate(bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData)
                {
                    if (loginSuccess) Log.BotName = replyData.FirstName + " " + replyData.LastName;
                });
        }
예제 #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            // These are order-dependant
            Log = new LoggerInstance();
            Network = new NetworkManager(Log);
            Terrain = new TerrainManager(Log, Network);
            Parcels = new ParcelManager(Log, Network, Terrain);
            Self = new AgentManager(Log, Network, Grid);
            Avatars = new AvatarManager(Log, Network);
            Friends = new FriendsManager(Log, Network, Inventory, Self, Avatars);
            Grid = new GridManager(Log, Network);
            Objects = new ObjectManager(Log, Network, Self);
            Groups = new GroupManager(Log, Network, Self);
            Assets = new AssetManager(Log, Network);
            Estate = new EstateTools(Log, Network, Assets);
            Appearance = new AppearanceManager(Log, Network, Inventory, Assets, Objects, Self);
            Inventory = new InventoryManager(Log, Network, Self, Assets);
            Directory = new DirectoryManager(Log, Network);
            Sound = new SoundManager(Log, Network, Self);
            Throttle = new AgentThrottle(Network);

            Settings = new Settings(this);
            //if (Settings.ENABLE_INVENTORY_STORE)
            //    InventoryStore = new Inventory(Inventory);
            //if (Settings.ENABLE_LIBRARY_STORE)
            //    LibraryStore = new Inventory(Inventory);

            //Inventory.OnSkeletonsReceived +=
            //    delegate(InventoryManager manager)
            //    {
            //        if (Settings.ENABLE_INVENTORY_STORE)
            //            InventoryStore.InitializeFromSkeleton(Inventory.InventorySkeleton);
            //        if (Settings.ENABLE_LIBRARY_STORE)
            //            LibraryStore.InitializeFromSkeleton(Inventory.LibrarySkeleton);
            //    };

            Network.RegisterLoginResponseCallback(
                delegate(bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData)
                {
                    if (loginSuccess) Log.BotName = replyData.FirstName + " " + replyData.LastName;
                });
        }
예제 #6
0
        /// <summary>
        /// Constructor, setup callbacks for packets related to our avatar
        /// </summary>
        /// <param name="client">A reference to the <seealso cref="T:OpenMetaverse.GridClient"/> Class</param>
        public AgentManager(LoggerInstance log, NetworkManager network, GridManager grid)
        {
            Log = log;
            Network = network;
            Grid = grid;
            Movement = new AgentMovement(Log, this, network);
            NetworkManager.PacketCallback callback;

            Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
            Network.OnCurrentSimChanged += new NetworkManager.CurrentSimChangedCallback(Network_OnCurrentSimChanged);
            // Teleport callbacks
            callback = new NetworkManager.PacketCallback(TeleportHandler);
            Network.RegisterCallback(PacketType.TeleportStart, callback);
            Network.RegisterCallback(PacketType.TeleportProgress, callback);
            Network.RegisterCallback(PacketType.TeleportFailed, callback);
            Network.RegisterCallback(PacketType.TeleportCancel, callback);
            Network.RegisterCallback(PacketType.TeleportLocal, callback);
            // these come in via the EventQueue
            Network.RegisterEventCallback("TeleportFailed", new Caps.EventQueueCallback(TeleportFailedEventHandler));
            Network.RegisterEventCallback("TeleportFinish", new Caps.EventQueueCallback(TeleportFinishEventHandler));

            // Upload cost callback:
            Network.RegisterCallback(Packets.PacketType.EconomyData, new NetworkManager.PacketCallback(EconomyDataHandler));
            // Instant message callback
            Network.RegisterCallback(PacketType.ImprovedInstantMessage, new NetworkManager.PacketCallback(InstantMessageHandler));
            // Chat callback
            Network.RegisterCallback(PacketType.ChatFromSimulator, new NetworkManager.PacketCallback(ChatHandler));
            // Script dialog callback
            Network.RegisterCallback(PacketType.ScriptDialog, new NetworkManager.PacketCallback(ScriptDialogHandler));
            // Script question callback
            Network.RegisterCallback(PacketType.ScriptQuestion, new NetworkManager.PacketCallback(ScriptQuestionHandler));
            // Script URL callback
            Network.RegisterCallback(PacketType.LoadURL, new NetworkManager.PacketCallback(LoadURLHandler));
            // Movement complete callback
            Network.RegisterCallback(PacketType.AgentMovementComplete, new NetworkManager.PacketCallback(MovementCompleteHandler));
            // Health callback
            Network.RegisterCallback(PacketType.HealthMessage, new NetworkManager.PacketCallback(HealthHandler));
            // Money callback
            Network.RegisterCallback(PacketType.MoneyBalanceReply, new NetworkManager.PacketCallback(BalanceHandler));
            //Agent update callback
            Network.RegisterCallback(PacketType.AgentDataUpdate, new NetworkManager.PacketCallback(AgentDataUpdateHandler));
            // Animation callback
            Network.RegisterCallback(PacketType.AvatarAnimation, new NetworkManager.PacketCallback(AvatarAnimationHandler));
            // Object colliding into our agent callback
            Network.RegisterCallback(PacketType.MeanCollisionAlert, new NetworkManager.PacketCallback(MeanCollisionAlertHandler));
            // Region Crossing
            Network.RegisterCallback(PacketType.CrossedRegion, new NetworkManager.PacketCallback(CrossedRegionHandler));
            Network.RegisterEventCallback("CrossedRegion", new Caps.EventQueueCallback(CrossedRegionEventHandler));
            // CAPS callbacks
            Network.RegisterEventCallback("EstablishAgentCommunication", new Caps.EventQueueCallback(EstablishAgentCommunicationEventHandler));
            // Incoming Group Chat
            Network.RegisterEventCallback("ChatterBoxInvitation", new Caps.EventQueueCallback(ChatterBoxInvitationEventHandler));
            // Outgoing Group Chat Reply
            Network.RegisterEventCallback("ChatterBoxSessionEventReply", new Caps.EventQueueCallback(ChatterBoxSessionEventReplyEventHandler));
            Network.RegisterEventCallback("ChatterBoxSessionStartReply", new Caps.EventQueueCallback(ChatterBoxSessionStartReplyEventHandler));
            Network.RegisterEventCallback("ChatterBoxSessionAgentListUpdates", new Caps.EventQueueCallback(ChatterBoxSessionAgentListUpdatesEventHandler));
            // Login
            Network.RegisterLoginResponseCallback(new NetworkManager.LoginResponseCallback(Network_OnLoginResponse));
            // Alert Messages
            Network.RegisterCallback(PacketType.AlertMessage, new NetworkManager.PacketCallback(AlertMessageHandler));
            // script control change messages, ie: when an in-world LSL script wants to take control of your agent.
            Network.RegisterCallback(PacketType.ScriptControlChange, new NetworkManager.PacketCallback(ScriptControlChangeHandler));
            // Camera Constraint (probably needs to move to AgentManagerCamera TODO:
            Network.RegisterCallback(PacketType.CameraConstraint, new NetworkManager.PacketCallback(CameraConstraintHandler));
            Network.RegisterCallback(PacketType.ScriptSensorReply, new NetworkManager.PacketCallback(ScriptSensorReplyHandler));
            Network.RegisterCallback(PacketType.AvatarSitResponse, new NetworkManager.PacketCallback(AvatarSitResponseHandler));
        }