private void MainServerClient_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status) { if (status == EventDrivenTCPClient.ConnectionStatus.Connected) { // Initial handshake message this.mainServerClient.Send(PacketHelper.MakeBytesArrayfromHexString("01 A0 00 00 03")); } }
private void AnnouncementServiceTimer_Tick(object sender, EventArgs e) { if (this.mainServerClient.ConnectionState == EventDrivenTCPClient.ConnectionStatus.Connected) { if (this.currentAnnouncementIndex >= this.announcements.Count) { this.currentAnnouncementIndex = 0; } var currentAnnouncement = this.announcements[this.currentAnnouncementIndex].Replace("{ServerName}", this.config.ServerName); if (currentAnnouncement.Length > 60) { currentAnnouncement = currentAnnouncement.Substring(0, 60); } this.mainServerClient.Send(PacketHelper.BuildAnnouncementPacket("[" + this.config.ServerName + "]", currentAnnouncement, this.config.AnnouncementType)); this.currentAnnouncementIndex++; } }