public void ConnectTest()
        {
            if (testManager.IsConnected)
            {
                testManager.Disconnect();
            }

            testManager.Connect();
            Assert.IsTrue(testManager.IsConnected);
        }
Exemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            try
            {
                //MySQLDatabase.Connect();
                DBConnectionManager.Connect("Data Source=AFR0-PC\\SQLEXPRESS;" +
                                            "Initial Catalog=TSO;Asynchronous Processing=true;Integrated Security=SSPI;");
            }
            catch (NoDBConnection NoDB)
            {
                MessageBox.Show(NoDB.Message);
                Environment.Exit(0);
            }

            Logger.Initialize("Log.txt");
            Logger.InfoEnabled  = true;
            Logger.DebugEnabled = true;
            Logger.WarnEnabled  = true;

            NetworkFacade.ClientListener = new LoginListener();
            NetworkFacade.ClientListener.OnReceiveEvent += new OnReceiveDelegate(m_Listener_OnReceiveEvent);

            //LoginRequest - Variable size.
            LoginClient.RegisterLoginPacketID(0x00, 0);
            //CharacterInfoRequest - Variable size.
            LoginClient.RegisterLoginPacketID(0x05, 0);
            //CityInfoRequest - Variable size.
            LoginClient.RegisterLoginPacketID(0x06, 0);
            //CharacterCreate - Variable size.
            LoginClient.RegisterLoginPacketID(0x07, 0);

            NetworkFacade.ClientListener.Initialize(2106);

            NetworkFacade.CServerListener = new CityServerListener();
            NetworkFacade.CServerListener.OnReceiveEvent += new OnCityReceiveDelegate(m_CServerListener_OnReceiveEvent);

            //CityServerLogin - Variable size.
            CityServerClient.RegisterCityPacketID(0x00, 0);
            //KeyFetch - Variable size.
            CityServerClient.RegisterCityPacketID(0x01, 0);
            //Pulse - two bytes.
            CityServerClient.RegisterCityPacketID(0x02, 2);

            NetworkFacade.CServerListener.Initialize(2348);
        }