当前位置: 首页>>代码示例>>C#>>正文


C# Client.TasClient类代码示例

本文整理汇总了C#中Springie.Client.TasClient的典型用法代码示例。如果您正苦于以下问题:C# TasClient类的具体用法?C# TasClient怎么用?C# TasClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TasClient类属于Springie.Client命名空间,在下文中一共展示了TasClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AutoHost

    public AutoHost(TasClient tas, Spring spring, AutoHostConfig conf)
    {
      if (conf == null) LoadConfig(); else config = conf;
      SaveConfig();

      this.tas = tas;
      this.spring = spring;

      tas.Said += new EventHandler<TasSayEventArgs>(tas_Said);

      pollTimer = new Timer(PollTimeout * 1000);
      pollTimer.Enabled = false;
      pollTimer.AutoReset = false;
      pollTimer.Elapsed += new ElapsedEventHandler(pollTimer_Elapsed);

      spring.SpringExited += new EventHandler(spring_SpringExited);
      spring.GameOver += new EventHandler<SpringLogEventArgs>(spring_GameOver);

      tas.BattleUserLeft += new EventHandler<TasEventArgs>(tas_BattleUserLeft);
      tas.UserRemoved += new EventHandler<TasEventArgs>(tas_UserRemoved);
      tas.UserStatusChanged += new EventHandler<TasEventArgs>(tas_UserStatusChanged);
      tas.BattleUserJoined += new EventHandler<TasEventArgs>(tas_BattleUserJoined);
      tas.BattleMapChanged += new EventHandler<TasEventArgs>(tas_BattleMapChanged);
      tas.BattleUserStatusChanged += new EventHandler<TasEventArgs>(tas_BattleUserStatusChanged);
      tas.BattleLockChanged += new EventHandler<TasEventArgs>(tas_BattleLockChanged);

      mapLinker = new MapLinker(spring);
      mapDownloader = new MapDownloader(spring);
      mapDownloader.DownloadCompleted += new EventHandler<TasEventArgs>(mapDownloader_DownloadCompleted);
      mapDownloader.DownloadProgressChanged += new EventHandler<TasEventArgs>(mapDownloader_DownloadProgressChanged);

      tas.BattleFound += new EventHandler<TasEventArgs>(tas_BattleFound);
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:33,代码来源:AutoHost.cs

示例2: UnSyncKicker

 public UnSyncKicker(TasClient tas) {
   this.tas = tas;
   checkTimer.Elapsed += new ElapsedEventHandler(checkTimer_Elapsed);
   checkTimer.Enabled = true;
   tas.BattleUserJoined += new EventHandler<TasEventArgs>(tas_BattleUserJoined);
   tas.BattleUserLeft += new EventHandler<TasEventArgs>(tas_BattleUserLeft);
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:7,代码来源:UnSyncKicker.cs

示例3: PlanetWarsHandler

        public PlanetWarsHandler(string host, int port, AutoHost autoHost, TasClient tas, MainConfig config)
        {
            this.autoHost = autoHost;
            this.tas = tas;
            this.host = host;
            account = new AuthInfo(config.AccountName, config.PlanetWarsServerPassword);

            server = (ISpringieServer) Activator.GetObject(typeof (ISpringieServer), String.Format("tcp://{0}:{1}/IServer", host, port));
            // fill factions for channel monitoring and join channels
            planetWarsChannels = new List<string>();
            var factions = server.GetFactions(account);
            foreach (var fact in factions) {
                string name = fact.Name.ToLower();
                planetWarsChannels.Add(name);
                if (!config.JoinChannels.Contains(name)) {
                    var list = new List<string>(config.JoinChannels);
                    list.Add(name);
                    config.JoinChannels = list.ToArray();
                    if (tas != null && tas.IsConnected && tas.IsLoggedIn) tas.JoinChannel(name);
                }
            }
            timer.Interval = 2000;
            timer.Elapsed += timer_Elapsed;
            timer.AutoReset = true;
            timer.Start();
        }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:26,代码来源:PlanetWarsHandler.cs

示例4: AutoManager

 public AutoManager(AutoHost ah, TasClient tas, Spring spring)
 {
   this.ah = ah;
   this.tas = tas;
   this.spring = spring;
   timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
   timer.Start();
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:AutoManager.cs

示例5: FilterMaps

    internal static int FilterMaps(string[] words, TasClient tas, Spring spring, out string[] vals, out int[] indexes)
    {
      string[] temp = new string[spring.UnitSync.MapList.Keys.Count];
      int cnt = 0;
      foreach (string s in spring.UnitSync.MapList.Keys) { temp[cnt++] = s; }
      return Filter(temp, words, out vals, out indexes);

    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:AutoHost_commands.cs

示例6: BanList

    public BanList(AutoHost ah, TasClient tas)
    {
      this.tas = tas;
      this.ah = ah;

      tas.BattleUserIpRecieved += tas_BattleUserIpRecieved;
      tas.BattleUserJoined += tas_BattleUserJoined;
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:BanList.cs

示例7: BanList

    public BanList(AutoHost ah, TasClient tas)
    {
      this.tas = tas;
      this.ah = ah;

      tas.BattleUserIpRecieved += new EventHandler<TasEventArgs>(tas_BattleUserIpRecieved);
      tas.BattleUserJoined += new EventHandler<TasEventArgs>(tas_BattleUserJoined);
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:BanList.cs

示例8: FilterUsers

 internal static int FilterUsers(string[] words, TasClient tas, Spring spring, out string[] vals, out int[] indexes)
 {
   TasClient.Battle b = tas.GetBattle();
   string[] temp = new string[b.Users.Count];
   int i = 0;
   foreach (TasClient.UserBattleStatus u in b.Users) {
     temp[i++] = u.name;
   }
   return Filter(temp, words, out vals, out indexes);
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:10,代码来源:AutoHost_commands.cs

示例9: KickUnsynced

 protected void KickUnsynced(TasClient tas) {
   for (int i = 0; i < users.Count; ++i) {
     TasClient.UserBattleStatus u;
     if (tas.IsConnected && tas.GetBattle().ContainsUser(users[i], out u)) {
       if (u.SyncStatus == TasClient.SyncStatuses.Unknown && (DateTime.Now - times[i]) > TimeSpan.FromSeconds(timeout)) {
         tas.Kick(users[i]);
       }
     }
   }
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:10,代码来源:UnSyncKicker.cs

示例10: AutoUpdater

    /************************************************************************/
    /*    PUBLIC METHODS                                                    */
    /************************************************************************/

    /// <summary>
    /// Initializes auto downloader
    /// </summary>
    public AutoUpdater(Spring spring, TasClient tas)
    {
      this.spring = spring;
      this.tas = tas;

      timer = new Timer();
      timer.Interval = updateCheckInterval*1000*60;
      timer.AutoReset = true;
      timer.Elapsed += timer_Elapsed;
      timer.Start();
      spring.SpringExited += spring_SpringExited;
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:19,代码来源:AutoUpdater.cs

示例11: AutoUpdater

    /************************************************************************/
    /*    PUBLIC METHODS                                                    */
    /************************************************************************/
    /// <summary>
    /// Initializes auto downloader
    /// </summary>
    public AutoUpdater(Spring spring, TasClient tas)
    {
      this.spring = spring;
      this.tas = tas;

      timer = new System.Timers.Timer();
      timer.Interval = updateCheckInterval * 1000 * 60;
      timer.AutoReset = true;
      timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
      timer.Start();

      spring.SpringExited += new EventHandler(spring_SpringExited);
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:19,代码来源:AutoUpdater.cs

示例12: AbstractPoll

 public AbstractPoll(TasClient tas, Spring spring, AutoHost ah)
 {
   this.tas = tas;
   this.spring = spring;
   this.ah = ah;
   string[] usrs;
   int[] indexes;
   AutoHost.FilterUsers(new string[0], tas, spring, out usrs, out indexes);
   foreach (string s in usrs) {
     if (s != tas.UserName) {
       users.Add(s);
       votes.Add(0);
     }
   }
   initialUserCount = users.Count;
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:16,代码来源:Polls.cs

示例13: AbstractPoll

		public AbstractPoll(TasClient tas, Spring spring, AutoHost ah)
		{
			this.tas = tas;
			this.spring = spring;
			this.ah = ah;

			initialUserCount = 0;
			var b = tas.GetBattle();
			if (b != null) {
				foreach (var us in b.Users) {
					if (us.name != tas.UserName) {
						users.Add(us.name);
						votes.Add(0);
						if (!us.IsSpectator) initialUserCount++;
					}
				}
			}
		}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:18,代码来源:Polls.cs

示例14: Stats

    public Stats(TasClient tas, Spring spring)
    {
      this.tas = tas;
      this.spring = spring;

      LoadAccounts();

      tas.LoginAccepted += new EventHandler<TasEventArgs>(tas_LoginAccepted);
      if (Program.main.config.GargamelMode) {
        tas.UserRemoved += new EventHandler<TasEventArgs>(tas_UserRemoved);
        tas.BattleUserIpRecieved += new EventHandler<TasEventArgs>(tas_BattleUserIpRecieved);
        tas.UserStatusChanged += new EventHandler<TasEventArgs>(tas_UserStatusChanged);
      }
      spring.SpringStarted += new EventHandler(spring_SpringStarted);
      spring.PlayerJoined += new EventHandler<SpringLogEventArgs>(spring_PlayerJoined);
      spring.PlayerLeft += new EventHandler<SpringLogEventArgs>(spring_PlayerLeft);
      spring.PlayerLost += new EventHandler<SpringLogEventArgs>(spring_PlayerLost);
      spring.PlayerDisconnected += new EventHandler<SpringLogEventArgs>(spring_PlayerDisconnected);
      spring.GameOver += new EventHandler<SpringLogEventArgs>(spring_GameOver);
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:20,代码来源:Stats.cs

示例15: Stats

		public Stats(TasClient tas, Spring spring)
		{
			this.tas = tas;
			this.spring = spring;

			LoadAccounts();

			tas.LoginAccepted += tas_LoginAccepted;
			if (Program.main.config.GargamelMode) {
				tas.UserRemoved += tas_UserRemoved;
				tas.BattleUserIpRecieved += tas_BattleUserIpRecieved;
				tas.UserStatusChanged += tas_UserStatusChanged;
			}
			spring.SpringStarted += spring_SpringStarted;
			spring.PlayerJoined += spring_PlayerJoined;
			spring.PlayerLeft += spring_PlayerLeft;
			spring.PlayerLost += spring_PlayerLost;
			spring.PlayerDisconnected += spring_PlayerDisconnected;
			spring.GameOver += spring_GameOver;
		}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:20,代码来源:Stats.cs


注:本文中的Springie.Client.TasClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。