public override void Handle(EzClient client, EzPacket packet) { packet.Data.ReadByte(); int selectedServerId = packet.Data.ReadByte(); _logger.Debug("Selected Server: {0}", selectedServerId + 1); ServerPoint selectedServer = Server.GetServerPoint(selectedServerId); client.WorldServer = selectedServer; Bridge.Request <List <ChannelInfo>, EzClient, EzPacket>(selectedServer.Bridge.ToIpEndPoint(), new Request <ModeType>(ChannelInfoHandler.Id, client.Mode), OnChannelInfoResponse, client, packet); }
/// <summary> /// 接続する /// </summary> /// <returns></returns> private bool Connect(AbstractState state) { if (!IsOperatable) { return(false); } State = state; CRLFSocket socket = new CRLFSocket(); socket.ReadLine += new EventHandler <ReadLineEventArgs>(ProcessData); // FIXME: Closedに対する処理は未実装 ServerPoint server = serverPointList[random.Next(serverPointList.Count)]; return(socket.Connect(server.Host, server.Port)); }
private void Button_Click(object sender, RoutedEventArgs e) { try { lock (this.obj) { this.Stop.IsEnabled = true; this.Start.IsEnabled = false; this.flag = ServerPoint.Start; if (this.serv == null) { this.CreadeSer(); } this.th = new Thread(this.AwaitClient); th.Start(); this.ShowMess("Start Server OK"); } } catch (ThreadAbortException tae) { MessageBox.Show(tae.Message); } }
private void Button_Click_2(object sender, RoutedEventArgs e) { this.flag = ServerPoint.Stop; this.StopServ(); }