本文整理汇总了C#中Springie.Client.TasEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TasEventArgs类的具体用法?C# TasEventArgs怎么用?C# TasEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TasEventArgs类属于Springie.Client命名空间,在下文中一共展示了TasEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: tas_BattleFound
void tas_BattleFound(object sender, TasEventArgs e)
{
string map = Utils.Glue(e.ServerParams.ToArray(), 10).Split('\t')[0];
if (!spring.UnitSync.MapList.ContainsKey(map)) {
if (config.AutoDownloadNewMaps) mapDownloader.DownloadMap(map);
}
}
示例2: OnFailure
public void OnFailure(object sender, TasEventArgs args)
{
if (InvokeRequired) Invoke(new TasEvent(OnFailure), sender, args);
else {
string mes = "Command failed:";
tServer.AppendText(mes + Utils.Glue(args.ServerParams.ToArray()) + "\r\n");
}
}
示例3: tas_BattleUserIpRecieved
private void tas_BattleUserIpRecieved(object sender, TasEventArgs e)
{
UpdateWithUserIp(e.ServerParams[0], IPAddress.Parse(e.ServerParams[1]));
BannedUser b;
if (IsBanned(e.ServerParams[0], out b)) {
tas.Say(TasClient.SayPlace.Battle, "", e.ServerParams[0] + " (" + b.Name + ") is banned for " + b.Reason, true);
tas.Kick(e.ServerParams[0]);
}
}
示例4: mapDownloader_DownloadCompleted
void mapDownloader_DownloadCompleted(object sender, TasEventArgs e)
{
string mes;
if (e.ServerParams.Count > 1 && e.ServerParams[1] != "") {
mes = e.ServerParams[0] + " download failed: " + e.ServerParams[1];
} else {
mes = e.ServerParams[0] + " download finished!";
spring.Reload(false, true);
}
if (tas.IsConnected) tas.Say(TasClient.SayPlace.Battle, "", mes, true);
}
示例5: tas_BattleUserJoined
void tas_BattleUserJoined(object sender, TasEventArgs e)
{
string name = e.ServerParams[0];
string welc = config.Welcome;
if (welc != "") {
welc = welc.Replace("%1", name);
welc = welc.Replace("%2", GetUserLevel(name).ToString());
welc = welc.Replace("%3", MainConfig.SpringieVersion);
SayBattle(welc);
}
if (config.DisplayMapLink) SayBattle("maplink: " + linker.GetMapBounceLink(tas.GetBattle().Map.Name));
HandleKickSpecServerLocking();
HandleAutoLocking();
HandleMinRankKicking();
if (minCpuSpeed > 0) {
User u;
if (tas.GetExistingUser(name, out u)) {
if (u.cpu != 0 && u.cpu < minCpuSpeed * 1000) {
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
SayBattle(name + ", your CPU speed is below minimum set for this server:" + minCpuSpeed + "GHz - sorry");
ComKick(TasSayEventArgs.Default, new string[] { u.name });
}
}
}
}
示例6: tas_ConnectionLost
private void tas_ConnectionLost(object sender, TasEventArgs e)
{
autoHost.Stop();
recon.Start();
}
示例7: tas_BattleMapChanged
void tas_BattleMapChanged(object sender, TasEventArgs e)
{
if (config.DisplayMapLink) SayBattle("maplink: " + linker.GetMapBounceLink(tas.GetBattle().Map.Name));
}
示例8: Tas_ConnectionLost
private void Tas_ConnectionLost(object sender, TasEventArgs e)
{
if (InvokeRequired) Invoke(new TasEvent(Tas_ConnectionLost), sender, e);
else {
notifyIcon1.Icon = Resources.err;
listBoxBattle.Items.Clear();
listBoxChannel.Items.Clear();
rehostToolStripMenuItem.Enabled = false;
}
}
示例9: tas_Connected
// im connected, let's login
private void tas_Connected(object sender, TasEventArgs e)
{
tas.Login(config.AccountName, config.AccountPassword, MainConfig.SpringieVersion);
}
示例10: Tas_UserRemoved
private void Tas_UserRemoved(object sender, TasEventArgs e)
{
if (InvokeRequired) Invoke(new TasEvent(Tas_UserRemoved), sender, e);
else {
int i = GetUserIndex(listBoxChannel, e.ServerParams[0]);
if (i != -1) listBoxChannel.Items.RemoveAt(i);
}
}
示例11: tas_BattleUserLeft
private void tas_BattleUserLeft(object sender, TasEventArgs e)
{
CheckForBattleExit();
HandleKickSpecServerLocking();
HandleAutoLocking();
if (spring.IsRunning) spring.SayGame(e.ServerParams[0] + " has left lobby");
if (e.ServerParams[0] == bossName) {
SayBattle("boss has left the battle");
bossName = "";
}
if (tas.GetBattle().IsLocked && tas.GetBattle().Users.Count < 2) {
// player left and only 2 remaining (springie itself + some noob) -> unlock
tas.ChangeLock(false);
}
}
示例12: tas_BattleOpened
private void tas_BattleOpened(object sender, TasEventArgs e)
{
tas.DisableUnits(UnitInfo.ToStringList(config.DisabledUnits));
}
示例13: tas_BattleUserStatusChanged
private void tas_BattleUserStatusChanged(object sender, TasEventArgs e)
{
UserBattleStatus u;
Battle b = tas.GetBattle();
if (b != null && b.ContainsUser(e.ServerParams[0], out u)) {
/*if (u.SyncStatus == SyncStatuses.Unsynced) {
SayBattle("kicking " + u.name + " - has incorrect spring or mod version");
tas.Kick(u.name);
}*/
if (KickSpectators && u.IsSpectator == true && u.name != tas.UserName) {
SayBattle(config.KickSpectatorText);
ComKick(TasSayEventArgs.Default, new string[] {u.name});
}
HandleAutoLocking();
int cnt = 0;
foreach (UserBattleStatus ubs in b.Users) if (!ubs.IsSpectator && ubs.IsReady) cnt++;
string usname;
int allyno;
if (!manager.Enabled) {
if ((cnt == config.MaxPlayers || (autoLock > 0 && autoLock == cnt)) && AllReadyAndSynced(out usname) && AllUniqueTeams(out usname) && BalancedTeams(out allyno)) {
SayBattle("server is full, starting");
Thread.Sleep(1000); // just to make sure that other clients update their game info and balance ends
ComStart(TasSayEventArgs.Default, new string[] {});
}
}
}
}
示例14: tas_BattleUserIpRecieved
void tas_BattleUserIpRecieved(object sender, TasEventArgs e)
{
User u;
if (tas.GetExistingUser(e.ServerParams[0], out u)) {
SendCommand(gatherScript, "a=joinplayer&name=" + u.name + "&rank=" + u.rank + "&ip=" + e.ServerParams[1], true, true);
}
}
示例15: tas_UserRemoved
void tas_UserRemoved(object sender, TasEventArgs e)
{
SendCommand(gatherScript, "a=removeplayer&name=" + e.ServerParams[0], true, true);
}