Example #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName = "Office2010Blue";
            DevExpress.Xpf.Core.ApplicationThemeHelper.UpdateApplicationThemeName();

            accountController     = new AccountController();
            productTypeController = new ProductTypeController();
            productController     = new ProductController();
            orderController       = new OrderController();
            inventoryController   = new InventoryController();
            connectionController  = new ConnectionController();

            BaseDirectory           = System.AppDomain.CurrentDomain.BaseDirectory;
            BaseImageDirectory      = BaseDirectory + "Data\\Images\\";
            DefaultAccountImagePath = BaseImageDirectory + "user-1-glyph-icon.png";
            DefaultProductImagePath = BaseImageDirectory + "Product-256.png";
            DefaultExportOrderPath  = BaseDirectory + "Data\\GuessInvoice\\";
            DefaultInventoryPath    = BaseImageDirectory + "Data\\Inventories\\";

            System.IO.Directory.CreateDirectory(BaseImageDirectory);
            System.IO.Directory.CreateDirectory(DefaultExportOrderPath);
            System.IO.Directory.CreateDirectory(DefaultInventoryPath);
            System.IO.Directory.CreateDirectory(BaseImageDirectory + "Product\\");
        }
Example #2
0
    void Update()
    {
        if (Application.platform != RuntimePlatform.Android && Application.platform != RuntimePlatform.IPhonePlayer)
        {
            if (Camera.main.GetComponent <ScreenCapture>() == null)
            {
                screenCapture = Camera.main.gameObject.AddComponent <ScreenCapture>();
            }
            else
            {
                screenCapture = Camera.main.GetComponent <ScreenCapture>();
            }
        }

        if (ConnectionController.MyConnectionState == ConnectionController.ConnectionState.NotConnected)
        {
            return;
        }
        screenWidth  = Screen.width;
        screenHeight = Screen.height;

        if (screenCapture != null && screenCapture.capturedTexture != null)
        {
            desktopData = new DesktopData();
            desktopData.showTouchscreenKeyboard = false;
            desktopData.imageData           = screenCapture.capturedTexture.EncodeToJPG(settings.ScreenShareQuality);
            desktopData.screenOrientation   = settings.DeviceOrientation;
            desktopData.currentWebcamDevice = currentWebcamDevice;
            ConnectionController.SendData(desktopData);
        }
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _updatePostView.NavigationBar  = NavigationController?.NavigationBar;
            _updatePostView.NavigationItem = NavigationItem;
            _updatePostView.SetConfigToolbar();

            _interactor = new InteractorUpdatePost(PostId, new UpdatePostController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseCreatePost, DataService.NotificationCenter,
                                                                                    DataService.RepositoryController.RepoQc, DataService.RepositoryController.RepositoryPost), DataService.RepositoryController.RepositoryUpdatePost,
                                                   DataService.RepositoryController.RepositoryPost, DataService.RepositoryController.RepositoryUserAuth);

            _presenter = new PresenterUpdatePost(_updatePostView, _interactor, new RouterUpdatePost(this), new UpdatePostStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser), Localization.Lang);


            ImagePicker = new ImagePickerDispatcher
            {
                OnGetImageFromGallery = (imageString) =>
                {
                    _presenter.ImageSelected(imageString);
                }
            };

            HideShowKeyboard hideShowKeyboard = new HideShowKeyboard(_updatePostView);

            NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidShowNotification, hideShowKeyboard.KeyBoardUpNotification);
            NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, hideShowKeyboard.KeyBoardDownNotification);
        }
Example #4
0
        public void BeforeEach()
        {
            IServiceCollection serviceCollection = ServiceConfiguration.InitServiceCollection();
            IServiceProvider   serviceProvider   = ServiceConfiguration.BuildServiceProvider();

            Configuration = serviceProvider.GetRequiredService <IConfiguration>();


            controller           = serviceProvider.GetRequiredService <ConnectionController>();
            accountRepository    = serviceProvider.GetRequiredService <IRepository <User, string> >();
            connectionRepository = serviceProvider.GetRequiredService <IRepository <Connection, long> >();
            IPasswordHasher <User> passwordHasher = serviceProvider.GetRequiredService <IPasswordHasher <User> >();

            account = new User
            {
                Username = "******",
                Email    = "*****@*****.**"
            };
            account.Password = passwordHasher.HashPassword(account, "password123");
            account          = accountRepository.Save(account);

            model = new LoginModel
            {
                Email    = "*****@*****.**",
                Password = "******",
                OS       = "Windows",
                Browser  = "Firefox"
            };
        }
Example #5
0
        private void DoFeedRideTypeComboBox()
        {
            var rideType = ConnectionController.GetInstance().RideTypes.ToList();

            rideTypes   = rideType;
            DataContext = rideTypes;
        }
Example #6
0
        //db-golang
        //table

        private void connection_Click(object sender, EventArgs e)
        {
            //TODO : Проверка входных данных
            connectionController = new ConnectionController(adressBox.Text, (uint)portBox.Value, databaseBox.Text, tableBox.Text);//"https://461e33af8aa9.ngrok.io/");
            ConnectionAsync();
            SaveConnection();
        }
Example #7
0
    private void SetControllerCrossReferences(ConnectionController connectionController)
    {
        if (connectionController == null)
        {
            Debug.Log("connectionController");
        }
        if (connectionController?.StaticModel == null)
        {
            Debug.Log("StaticModel");
        }
        if (connectionController?.StaticModel?.Node1 == null)
        {
            Debug.Log("Node1");
        }
        if (nodeDictionary == null)
        {
            Debug.Log("nodeDictionary");
        }
        if (nodeDictionary[connectionController.StaticModel.Node1] == null)
        {
            Debug.Log("nodeDictionary[connectionController.StaticModel.Node1]");
        }
        NodeController nodeController1 = nodeDictionary[connectionController.StaticModel.Node1].GetComponent <NodeController>();
        NodeController nodeController2 = nodeDictionary[connectionController.StaticModel.Node2].GetComponent <NodeController>();

        nodeController1.Connections.Add(connectionController);
        nodeController2.Connections.Add(connectionController);
        connectionController.SetNodeControllers(nodeController1, nodeController2);
    }
Example #8
0
        private void LogOut()
        {
            DataService.RepositoryController.Init();
            ConnectionController.GetInstance().DisconnectSockets();

            var locale = Localization.Lang as IAlert;

            AlertDialog.Builder alert = new AlertDialog.Builder(this);

            alert.SetMessage(locale.BadToken);

            alert.SetPositiveButton(locale.OK, (senderAlert, args) =>
            {
                FinishAffinity();
                Intent intent = new Intent(ApplicationContext, typeof(AuthActivity));
                intent.AddFlags(ActivityFlags.ClearTop);
                StartActivity(intent);
            });

            Dialog dialog = alert.Create();

            if (!IsFinishing)
            {
                RunOnUiThread(() =>
                {
                    dialog.Show();
                });
            }
        }
Example #9
0
        public void RenewMembership(MembershipRenewal renewal)
        {
            this._tracer.Trace("Method: MembershipService.RenewMembership: MembershipNumber={0}", renewal.MembershipNumber);

            try
            {
                if (!string.IsNullOrEmpty(renewal.MembershipNumber))
                {
                    var sdk = ConnectionController.ConnectToCrm(this._tracer);
                    if (sdk != null)
                    {
                        _tracer.Trace("membershipTypeId={0}, amount={1}", renewal.MembershipType.MembershipTypeId, renewal.MembershipType.Price);

                        MembershipController mc = new MembershipController(sdk, this._tracer);

                        bool renewed = mc.RenewMembership(renewal);
                        this._tracer.Trace("mc.RenewMembership={0}", renewed);

                        if (!renewed)
                        {
                            throw new Exception("Unable to renew the membership, this might be because the membership is in an invalid state.");
                        }
                    }
                    else
                    {
                        string message = "Unable to connect to CRM. Check web.config";
                        this._tracer.Trace(message);
                        throw new Exception(message);
                    }
                }
                else
                {
                    throw new Exception("Invalid input. The Member cannot be null for a Membership");
                }
            }
            catch (FaultException <OrganizationServiceFault> fe)
            {
                if (fe.Detail != null)
                {
                    this._tracer.Trace(fe.Detail.ToString());
                }

                this._tracer.Trace(fe.ToString());

                string reference = renewal.MembershipNumber;
                throw new WebFaultException <Error>(ConvertToError(fe, reference), HttpStatusCode.InternalServerError);
            }
            catch (Exception ex)
            {
                this._tracer.Trace(ex.ToString());

                string reference = renewal.MembershipNumber;
                throw new WebFaultException <Error>(ConvertToError(ex, reference), HttpStatusCode.InternalServerError);
            }
            finally
            {
                // write to the log file
                this._tracer.WriteToLog(this._logPath);
            }
        }
Example #10
0
        public void ConnectionController_ConnectCommand_Status()
        {
            // Setup
            var testSubject = new ConnectionController(this.host);

            // Case 1: has connection, is busy
            this.host.TestStateManager.IsConnected = true;
            this.host.VisualStateManager.IsBusy    = true;

            // Act + Verify
            Assert.IsFalse(testSubject.ConnectCommand.CanExecute(), "Connected already and busy");

            // Case 2: has connection, not busy
            this.host.VisualStateManager.IsBusy = false;

            // Act + Verify
            Assert.IsFalse(testSubject.ConnectCommand.CanExecute(), "Connected already");

            // Case 3: no connection, is busy
            this.host.TestStateManager.IsConnected = false;
            this.host.VisualStateManager.IsBusy    = true;

            // Act + Verify
            Assert.IsFalse(testSubject.ConnectCommand.CanExecute(), "Busy");

            // Case 4: no connection, not busy
            this.host.VisualStateManager.IsBusy = false;

            // Act + Verify
            Assert.IsTrue(testSubject.ConnectCommand.CanExecute(), "No connection and not busy");
        }
Example #11
0
        public NetworkNode(NetworkNodeModel parameters)
            : base(
                parameters.NetworkAddress, parameters.IpAddress, parameters.CableCloudListeningPort,
                parameters.SignallingCloudListeningPort)
        {
            CableCloudMessage.MaxAtmCellsNumber = parameters.MaxAtmCellsNumberInCableCloudMessage;

            CommutationMatrix              = new CommutationMatrix(new CommutationTable(), parameters.NumberOfPorts);
            CommutationMatrix.UpdateState += (sender, state) => OnUpdateState(state);

            _connectionController                = new ConnectionController(parameters.NetworkAddress);
            _connectionController.UpdateState   += (sender, state) => OnUpdateState(state);
            _connectionController.MessageToSend += (sender, message) => Send(message);


            _linkResourceManager                     = new LinkResourceManager(parameters.NetworkAddress);
            _linkResourceManager.UpdateState        += (sender, state) => OnUpdateState(state);
            _linkResourceManager.MessageToSend      += (sender, message) => Send(message);
            _linkResourceManager.CommutationCommand += ConnectionControllerOnCommutationCommand;

            NetworkNodeAgent = new NetworkNodeAgent(parameters.NetworkAddress, parameters.IpAddress,
                                                    parameters.NetworkManagmentSystemListeningPort);
            NetworkNodeAgent.UpdateState           += (sender, state) => OnUpdateState(state);
            NetworkNodeAgent.ConfigurationReceived += NetworkNodeAgentOnConfigurationReceived;

            StartThread();
        }
    public void ShowReadyForConnection()
    {
        ShowFirstScrollView();
        BeginHorCentered();
        GUILayout.Label("<size=20><b>Ready for connection with " + connectedDeviceName + "</b></size>");
        EndHorCentered();

        BeginHorCentered();
        GUILayout.Label("<size=12>When you press play, a connection with the device will be established.</size>");
        EndHorCentered();

        EndFirstScrollView();

        BeginHorCentered();

        if (GUILayout.Button("Choose other device", GUILayout.Width(150)))
        {
            ConnectionSettings.RemoteSettings();
            ConnectionController.CloseConnection();
            myState = MyState.refreshing;
            DiscoverDevices();
        }
        EndHorCentered();


        GUILayout.EndVertical();
    }
        public void Edit_Post_Should_Update_Connection_When_Valid()
        {
            // arrange
            FakeConnectionRepository connectionRepository = new FakeConnectionRepository();

            connectionRepository.AddConnection(new ConnectionModel()
            {
                ConnectionId = 1, Name = "connection1"
            });

            FormCollection formCollection = new FormCollection();

            formCollection["Name"] = "connectionA";
            formCollection["ConnectionParameterKey1"]   = "key1";
            formCollection["ConnectionParameterValue1"] = "value1";

            ConnectionController connectionController = new ConnectionController(connectionRepository);

            connectionController.ValueProvider = formCollection.ToValueProvider();

            // act
            ViewResult      viewResult = connectionController.Edit(1, formCollection) as ViewResult;
            ConnectionModel connection = connectionRepository.GetConnection(1);

            // assert
            Assert.IsTrue(connection.Name == "connectionA");
        }
Example #14
0
        public void RemoveDeadClients()
        {
            var socket          = new MockSocket();
            var dispatcherInbox = new BoundedInbox();
            var client          = new ConnectionController(dispatcherInbox, socket, ClientId.Next());

            client.OnRequestReceived = () => { };

            socket.ExpectConnected(() => false);

            var dispatcher = new DispatchController(dispatcherInbox, new BoundedInbox(), new BoundedInbox[4],
                                                    new IdentityHash());

            dispatcher.OnConnectionAccepted = (_) => { };
            dispatcher.AddConnection(client);
            dispatcher.HandleNewConnection();

            var firstMessage = new byte[100];
            var message      = new Message(firstMessage);

            message.Header.ClientId           = client.ClientId;
            message.Header.MessageSizeInBytes = 100;
            message.Header.MessageKind        = MessageKind.CloseConnection;

            Assert.True(dispatcherInbox.TryWrite(firstMessage));

            dispatcher.HandleRequest();

            socket.ExpectAllDone();
        }
Example #15
0
 public LoginForm()
 {
     connectionController = new ConnectionController();
     userController       = new UserController();
     InitializeComponent();
     BeforeShown();
 }
Example #16
0
        private void Listen()
        {
            while (ServerRunning)
            {
                if (socket.Poll(-1, SelectMode.SelectRead))
                {
                    var task = socket.AcceptAsync();
                    task.ContinueWith((taskResult) =>
                    {
                        var clientSocket = taskResult.Result;

                        clients.Add(clientSocket);

                        var tcpClient = new TcpSocket(clientSocket);

                        SocketMapper.Mapper(clientSocket, tcpClient);

                        ConnectionController?.HandleConnection(tcpClient);

                        resetEvent.Set();
                    });
                }
                else if (socket.Poll(10, SelectMode.SelectError))
                {
                    ConnectionController?.HandleError(this);
                    break;
                }
            }
        }
Example #17
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.AuthActivity);
            DroidDAL.HockeyAppRegister(this);

            _view = FindViewById <AuthView>(Resource.Id.auth_view);

            InitStatusBar();

            ThemeHolder.Init(DataService.RepositoryController.RepositoryThemes);
            _interactor = new InteractorAuth(new AuthController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseAuth), new ValidationRA());
#if MOCK
            _presenter = new PresenterAuthMOCK(_view, _interactor, new RouterAuth(this), FacebookCallLoginAction, GoogleCallLoginAction, VkCallLoginAction, OkCallLoginAction,
                                               new AuthStylesHolderDroid <GlobalControlsTheme>(new ThemeParser <GlobalControlsTheme>()), DataService.RepositoryController.RepositoryRA.LangRA);
#else
            _presenter = new PresenterAuth(_view, _interactor, new RouterAuth(this), FacebookCallLoginAction, GoogleCallLoginAction, VkCallLoginAction, OkCallLoginAction,
                                           new AuthStylesHolderDroid <GlobalControlsTheme>(new ThemeParser <GlobalControlsTheme>()), DataService.RepositoryController.RepositoryRA.LangRA);
#endif
            _presenter.SetConfig();

            _callbackManager  = CallbackManagerFactory.Create();
            _facebookCallback = new FacebookCallback(_interactor);
            LoginManager.Instance.RegisterCallback(_callbackManager, _facebookCallback);
            _interactor.OnSocialLogOut += SocialLogOut;
        }
Example #18
0
        public void ConnectionController_ConnectCommand_SolutionNotFully_Open_Status_AlwaysFalse()
        {
            // Arrange
            var testSubject = new ConnectionController(this.host);

            this.projectSystemHelper.SetIsSolutionFullyOpened(false);

            // Case 1: has connection, is busy
            this.host.TestStateManager.IsConnected = true;
            this.host.VisualStateManager.IsBusy    = true;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeFalse("Solution not fully open");

            // Case 2: has connection, not busy
            this.host.TestStateManager.IsConnected = true;
            this.host.VisualStateManager.IsBusy    = false;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeFalse("Solution not fully open");

            // Case 3: no connection, is busy
            this.host.TestStateManager.IsConnected = false;
            this.host.VisualStateManager.IsBusy    = true;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeFalse("Busy");

            // Case 4: no connection, not busy
            this.host.TestStateManager.IsConnected = false;
            this.host.VisualStateManager.IsBusy    = false;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeFalse("Solution not fully open");
        }
Example #19
0
    void Awake()
    {
        ws = GameObject.FindGameObjectWithTag("ServerController").
             GetComponent <ConnectionController> ();

        ws.OnConnect((sender, e) => {
            Debug.Log("Connected at server");
            ws.Emit("login", nickname);
            loginPanel.SetActive(false);
            chatPanel.SetActive(true);
        });

        ws.On("message", (data) => {
            ChatMessage chatMessage = JsonConvert.DeserializeObject <ChatMessage> (data);

            Vector3 framePos = new Vector3(content.position.x,
                                           content.position.y,
                                           content.position.z);

            GameObject goFrame = Instantiate(messageFrame,
                                             framePos,
                                             Quaternion.identity)
                                 as GameObject;

            goFrame.transform.SetParent(content);

            MessageFrame mf      = goFrame.GetComponent <MessageFrame> ();
            mf.nameFrame.text    = chatMessage.name;
            mf.messageFrame.text = chatMessage.message;

            messageField.text = "";
        });
    }
 protected void AddOptions(ListControl list, ListParameterSettings customParameterSettings, ParameterInfo parameterSettings)
 {
     // add options from both if necessary
     if (customParameterSettings.Command.Length > 0)
     {
         var connectionString = default(string);
         if (customParameterSettings.ConnectionId < 0)
         {
             // get report set connection
             var objReportSetController = new ReportSetController();
             var objReportSetInfo       = objReportSetController.GetReportSet(parameterSettings.ReportSetId);
             connectionString = objReportSetInfo.ReportSetConnectionString;
         }
         else
         {
             var objConnectionInfo = ConnectionController.GetConnection(customParameterSettings.ConnectionId);
             connectionString = objConnectionInfo.ConnectionString;
         }
         SQLUtil.AddOptionsFromQuery(list, ReplaceOptionTokens(customParameterSettings.Command), connectionString, customParameterSettings.Default, customParameterSettings.CommandCacheTimeout);
     }
     if (customParameterSettings.List.Length > 0)
     {
         SQLUtil.AddOptionsFromList(list, customParameterSettings.List, customParameterSettings.Default);
     }
 }
        public void Edit_Post_Should_Redisplay_With_Errors_When_Invalid()
        {
            // arrange
            FakeConnectionRepository connectionRepository = new FakeConnectionRepository();

            connectionRepository.AddConnection(new ConnectionModel()
            {
                ConnectionId = 1, Name = "connection1"
            });

            FormCollection formCollection = new FormCollection();

            formCollection["Name"] = String.Empty;

            ConnectionController connectionController = new ConnectionController(connectionRepository);

            connectionController.ValueProvider = formCollection.ToValueProvider();

            // act
            ViewResult viewResult = connectionController.Edit(1, formCollection) as ViewResult;

            // assert
            Assert.IsTrue(viewResult.ViewData.Model is ConnectionModel);
            Assert.IsTrue(viewResult.ViewData.ModelState["Name"].Errors.Count > 0);
        }
Example #22
0
        public void ConnectionController_ConnectCommand_Status()
        {
            // Arrange
            var testSubject = new ConnectionController(this.host);

            // Case 1: has connection, is busy
            this.host.TestStateManager.IsConnected = true;
            this.host.VisualStateManager.IsBusy    = true;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeFalse("Connected already and busy");

            // Case 2: has connection, not busy
            this.host.VisualStateManager.IsBusy = false;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeFalse("Connected already");

            // Case 3: no connection, is busy
            this.host.TestStateManager.IsConnected = false;
            this.host.VisualStateManager.IsBusy    = true;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeFalse("Busy");

            // Case 4: no connection, not busy
            this.host.VisualStateManager.IsBusy = false;

            // Act + Assert
            testSubject.ConnectCommand.CanExecute().Should().BeTrue("No connection and not busy");
        }
        public void Edit_Post_Should_Redisplay_With_Errors_When_Duplicate_Name()
        {
            // arrange
            FakeConnectionRepository connectionRepository = new FakeConnectionRepository();

            connectionRepository.AddConnection(new ConnectionModel()
            {
                ConnectionId = 1, Name = "connection1"
            });
            connectionRepository.AddConnection(new ConnectionModel()
            {
                ConnectionId = 2, Name = "connection2"
            });

            FormCollection formCollection = new FormCollection();

            formCollection["Name"] = "connection2";
            formCollection["ConnectionParameterKey1"]   = "key1";
            formCollection["ConnectionParameterValue1"] = "value1";

            ConnectionController connectionController = new ConnectionController(connectionRepository);

            connectionController.ValueProvider = formCollection.ToValueProvider();

            // act
            ViewResult viewResult = connectionController.Edit(1, formCollection) as ViewResult;

            // assert
            Assert.IsTrue(viewResult.ViewData.ModelState["Name"].Errors.Count == 1);
        }
Example #24
0
        private void DoFeedDepartmentComboBox()
        {
            var department = ConnectionController.GetInstance().Departments.ToList();

            departments = department;
            DataContext = departments;
        }
Example #25
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _interactor = new InteractorRegPass(new RegController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseReg), DataService.RepositoryController.RepositoryRA, new ValidationRA());
            _presenter  = new PresenterRegPass(_registrationPassword, _interactor, new RouterRegPass(this), new RegPassStylesHolderIOS <GlobalControlsTheme>(new ThemeParser <GlobalControlsTheme>()), DataService.RepositoryController.RepositoryRA.LangRA);
            _presenter.SetConfig();
        }
Example #26
0
 //creating ConnController/FileManager & path selection
 public MainWindow()
 {
     myConnection  = new ConnectionController();
     myFileManager = new FileManager();
     InitializeComponent();
     currentPath = "D:\\";
     Refresh(currentPath);
 }
Example #27
0
 private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     sheetIndex = ((TabControl)sender).SelectedIndex;
     PlacementController.draw();
     ConnectionController.draw();
     StructuralController.draw();
     BoxController.draw();
 }
 // Use this for initialization
 void Awake()
 {
     networkController    = Graph.GetComponent <NetworkController>();
     inputController      = Graph.GetComponent <InputController>();
     nodeController       = Graph.GetComponent <NodeController>();
     connectionController = Graph.GetComponent <ConnectionController>();
     headerController     = Header.GetComponent <HeaderController>();
 }
Example #29
0
        /// <summary>
        /// Starts the server.
        /// </summary>
        public async void Start()
        {
            ServerLogger.Info("Preparing and initializing the server...");
            ServerLogger.Info($"The server is hosted on { await OSRequirements.GetIPAddress()}.");

            ConnectionController.Start();
            IsRunning = true;
        }
Example #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerManager"/> class.
 /// </summary>
 public ServerManager(int port)
 {
     PacketManager        = new PacketManager();
     ConnectionController = new ConnectionController(port, this);
     ChatroomManager      = new ChatroomManager(this);
     PrivateRoomManager   = new PrivateRoomManager(this);
     DatabaseManager      = new DatabaseManager(this, false);
 }
Example #31
0
 /// --------------------------------------------------------------------------------
 /// <summary>
 /// Creates a new Database instance specifying the database to connect to and SQL
 /// syntax to use with the database. Each function call of the Database class opens
 /// and closes a connection. Therefore, connection pooling should be enabled
 /// for optimal performance.
 /// </summary>
 ///
 /// <param name="strConnectionString">
 /// A database connection string to either a Microsoft Access, SQLServer, Pervasive or MySQL
 /// database. For example, 'Provider=Microsoft.Jet.OLEDB.4.0;Data
 /// Source=northwind.mdb;Jet OLEDB:Database Password=;'.
 /// </param>
 ///
 /// <param name="eConnectionType">
 /// Indicates the SQL syntax to generate for the database specified in strConnectionString.
 /// </param>
 /// --------------------------------------------------------------------------------
 ///
 public Database(string strConnectionString, ConnectionType eConnectionType)
 {
     pobjConnection = new ConnectionController(strConnectionString, eConnectionType);
     pobjTransactions = new TransactionsClass(pobjConnection);
 }
 void Awake()
 {
     _socket = GetComponent<SocketIOConnection>();
     Instance = this;
 }
Example #33
0
 void Start()
 {
     if (Application.isPlaying)
     {
         _connection = ConnectionController.Instance;
         Servers = new List<ServerListItem>();
         Servers.Add(SampleItem);
         gameObject.SetActive(false);
         LoginController = FindObjectOfType<LoginController>();
     }
     else
     {
         gameObject.SetActive(ShowInEditor);
     }
 }
Example #34
0
 internal TransactionsClass(ConnectionController objConnection)
 {
     pobjConnectionController = objConnection;
 }
Example #35
0
 /// <summary>
 /// Initializes the Database instance with the database connection to utilise.
 /// The connection is not opened until it is required.
 /// The supplied connection should not be opened.
 /// </summary>
 /// <param name="objDatabaseConnection">An unopened connection to the database.</param>
 /// <remarks></remarks>
 public Database(IDbConnection objDatabaseConnection, ConnectionType eConnectionType)
 {
     pobjConnection = new ConnectionController(objDatabaseConnection, eConnectionType);
     pobjTransactions = new TransactionsClass(pobjConnection);
 }