Пример #1
0
        /// <summary>
        /// Setup the clients configuration.
        /// </summary>
        void Awake()
        {
            this.ViewHandlerMappers           = new Dictionary <IView, ViewMapper>();
            this.waitingSelectionConfirmation = new Dictionary <string, IView>();

            this.HubMethodTypeMapping = new Dictionary <Type, string>
            {
                { typeof(ActiveQuad), "UpdateQuad" }
            };

            this.ClientMethodTypeMapping = new Dictionary <string, ISignalRMsgParserJson>
            {
                { "ActiveQuads", new HubToClientMsgParserJson <List <ActiveQuad> >() },
                { "ConfirmQuadSelection", new HubToClientMsgParserJson <Services.Models.QuadSelectionConfirmed>() }
            };

            this.HubConnectionParams = new HubConnectionParams("ActiveQuadsHub", "localhost:8080", false);

            //Get the SignalR Client Controller.
            this.clientController = GameObject
                                    .FindObjectOfType <SignalRClientController>()
                                    .GetComponent <SignalRClientController>() as ISignalRClientController;

            //Get StatusFeeds view
            this.statusFeedsNotify = FindObjectOfType <StatusFeedsView>()
                                     .GetComponent <StatusFeedsView>() as IStatusFeedNotify;

            //Regsiter SignalRlient Container callback
            this.Register <List <ActiveQuad> >("ActiveQuads", this.ActiveQuadsCallback);
            this.Register <Services.Models.QuadSelectionConfirmed>("ConfirmQuadSelection", this.QuadSelectionConfirmedCallback);
        }
        /// <summary>
        /// Setup the clients configuration.
        /// </summary>
        void Awake()
        {
            this.ViewHandlerMappers = new Dictionary<IView, ViewMapper>();
            this.waitingSelectionConfirmation = new Dictionary<string, IView>();

            this.HubMethodTypeMapping = new Dictionary<Type, string>
            {
                {typeof(ActiveQuad), "UpdateQuad" }
            };

            this.ClientMethodTypeMapping = new Dictionary<string, ISignalRMsgParserJson>
            {
                { "ActiveQuads", new HubToClientMsgParserJson<List<ActiveQuad>>()},
                { "ConfirmQuadSelection", new HubToClientMsgParserJson<Services.Models.QuadSelectionConfirmed>() }
            };

            this.HubConnectionParams = new HubConnectionParams("ActiveQuadsHub", "localhost:8080", false);

            //Get the SignalR Client Controller.
            this.clientController = GameObject
                .FindObjectOfType<SignalRClientController>()
                .GetComponent<SignalRClientController>() as ISignalRClientController;

            //Get StatusFeeds view
            this.statusFeedsNotify = FindObjectOfType<StatusFeedsView>()
                .GetComponent<StatusFeedsView>() as IStatusFeedNotify;

            //Regsiter SignalRlient Container callback
            this.Register<List<ActiveQuad>>("ActiveQuads", this.ActiveQuadsCallback);
            this.Register<Services.Models.QuadSelectionConfirmed>("ConfirmQuadSelection", this.QuadSelectionConfirmedCallback);
        }