/// <summary> /// 启动服务器 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnStart_Click(object sender, EventArgs e) { CardUtility.Init(txtCardPath.Text); btnStartTcp.Enabled = false; btnStopTcp.Enabled = true; SystemManager.Init(); ServerThread = new Thread(TcpSocketServer.StartTcpServer); ServerThread.IsBackground = true; ServerThread.Start(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnStartHttp_Click(object sender, EventArgs e) { CardUtility.Init(txtCardPath.Text); btnStartHttp.Enabled = false; btnStopHttp.Enabled = true; SystemManager.Init(); //MONGODB MongoServer innerServer; innerServer = MongoServer.Create(@"mongodb://localhost:28030"); innerServer.Connect(); MongoDatabase LogDB = innerServer.GetDatabase("HearthStone"); MongoCollection logCol = LogDB.GetCollection("log"); //SystemManager.Logger += SystemManager.InnerLog; SystemManager.Logger += (x) => { logCol.Insert <CSharpUtility.LogRec>(x); }; WebSocketServer.Start(); }
private void CardManager_Load(object sender, EventArgs e) { //HardCoding Only for Test CardUtility.Init(@"C:\炉石Git\炉石设计\Card"); //init fillter cmbCardFilter.Items.Clear(); cmbCardFilter.Items.Add("全部"); cmbCardFilter.Items.Add("随从"); cmbCardFilter.Items.Add("法术"); cmbCardFilter.Items.Add("武器"); cmbCardFilter.SelectedIndex = 0; //Set Header of ListView lstCards.Clear(); lstCards.Columns.Add("序列号"); lstCards.Columns.Add("名称"); lstCards.Columns.Add("描述"); lstCards.Columns.Add("使用成本"); lstCards.Columns.Add("分类"); lstCards.Columns.Add("细分"); SetCardListView(); }