void tas_BattleUserJoined(object sender, BattleUserEventArgs e1) { if (e1.BattleID != tas.MyBattleID) { return; } string name = e1.UserName; string welc = config.Welcome; if (!string.IsNullOrEmpty(welc)) { welc = welc.Replace("%1", name); welc = welc.Replace("%2", GetUserLevel(name).ToString()); welc = welc.Replace("%3", MainConfig.SpringieVersion); SayBattlePrivate(name, welc); } if (spring.IsRunning) { spring.AddUser(e1.UserName, e1.ScriptPassword); TimeSpan started = DateTime.Now.Subtract(spring.GameStarted); started = new TimeSpan((int)started.TotalHours, started.Minutes, started.Seconds); SayBattlePrivate(name, String.Format("THIS GAME IS CURRENTLY IN PROGRESS, PLEASE WAIT UNTIL IT ENDS! Running for {0}", started)); SayBattlePrivate(name, "If you say !notify, I will message you when the current game ends."); } if (SpawnConfig == null) { try { var serv = GlobalConst.GetSpringieService(); PlayerJoinResult ret = serv.AutohostPlayerJoined(tas.MyBattle.GetContext(), tas.ExistingUsers[name].AccountID); if (ret != null) { if (!string.IsNullOrEmpty(ret.PrivateMessage)) { tas.Say(SayPlace.User, name, ret.PrivateMessage, false); } if (!string.IsNullOrEmpty(ret.PublicMessage)) { tas.Say(SayPlace.Battle, "", ret.PublicMessage, true); } if (ret.ForceSpec) { tas.ForceSpectator(name); } if (ret.Kick) { tas.Kick(name); } } } catch (Exception ex) { SayBattle("ServerManage error: " + ex, false); } } if (SpawnConfig != null && SpawnConfig.Owner == name) // owner joins, set him boss { ComBoss(TasSayEventArgs.Default, new[] { name }); } }
void TasClient_BattleUserLeft(object sender, BattleUserEventArgs e) { var battleID = e.BattleID; var battleIcon = GetBattleIcon(battleID); battleIcon.SetPlayers(); BattleChanged(this, new EventArgs <BattleIcon>(battleIcon)); }
void OnBattleUserJoined(BattleUserEventArgs e) { if (mapTrack && e.UserName == playerName) { var bid = e.BattleID; SendRequest(tas.ExistingBattles[bid].MapName); SendRequest(tas.ExistingBattles[bid].ModName); } }
void TasClient_BattleUserJoined(object sender, BattleUserEventArgs e1) { var battleID = e1.BattleID; if (Program.TasClient.MyBattle != null && battleID == Program.TasClient.MyBattle.BattleID) { var userName = e1.UserName; var userBattleStatus = Program.TasClient.MyBattle.Users.Single(u => u.Name == userName); AddUser(userBattleStatus.Name); AddLine(new JoinLine(userName)); } }
void TasClient_BattleUserJoined(object sender, BattleUserEventArgs e1) { var battleID = e1.BattleID; var tas = (TasClient)sender; if (tas.MyBattle != null && battleID == tas.MyBattle.BattleID) { var userName = e1.UserName; AddUser(userName); AddLine(new JoinLine(userName)); } }
void TasClient_BattleUserJoined(object sender, BattleUserEventArgs e1) { var userName = e1.UserName; if (userName != UserName) { return; } var joinedBattleID = e1.BattleID; var battle = Program.TasClient.ExistingBattles[joinedBattleID]; AddLine(new FriendJoinedBattleLine(userName, battle)); }
void TasClient_BattleUserLeft(object sender, BattleUserEventArgs e) { var userName = e.UserName; if (userName == Program.Conf.LobbyPlayerName) { minimapFuncBox.Visible = false; //hide buttons when leaving game playerListItems.Clear(); playerBox.Items.Clear(); } if (PlayerListItems.Any(i => i.UserName == userName)) { RemoveUser(userName); AddLine(new LeaveLine(userName)); } }
void TasClient_BattleUserJoined(object sender, BattleUserEventArgs e1) { var battleID = e1.BattleID; var tas = (TasClient)sender; if (tas.MyBattle != null && battleID == tas.MyBattle.BattleID) { var userName = e1.UserName; UserBattleStatus userBattleStatus; if (tas.MyBattle.Users.TryGetValue(userName, out userBattleStatus)) { AddUser(userBattleStatus.Name); AddLine(new JoinLine(userName)); } } }
void tas_BattleUserLeft(object sender, BattleUserEventArgs e1) { if (e1.BattleID != tas.MyBattleID) { return; } CheckForBattleExit(); if (spring.IsRunning) { spring.SayGame(e1.UserName + " has left the room"); } if (e1.UserName == bossName) { SayBattle("boss has left the battle"); bossName = ""; } }
void tas_BattleUserLeft(object sender, BattleUserEventArgs e1) { if (e1.BattleID != tas.MyBattleID) return; CheckForBattleExit(); if (spring.IsRunning) spring.SayGame(e1.UserName + " has left the room"); if (e1.UserName == bossName) { SayBattle("boss has left the battle"); bossName = ""; } }
void tas_BattleUserJoined(object sender, BattleUserEventArgs e1) { OnBattleUserJoined(e1); }
void TasClient_BattleUserLeft(object sender, BattleUserEventArgs e) { var battleID = e.BattleID; var battleIcon = GetBattleIcon(battleID); battleIcon.SetPlayers(); BattleChanged(this, new EventArgs<BattleIcon>(battleIcon)); }
void TasClient_BattleUserLeft(object sender, BattleUserEventArgs e) { var userName = e.UserName; if (userName == Program.Conf.LobbyPlayerName) { minimapFuncBox.Visible = false; //hide buttons when leaving game playerListItems.Clear(); playerBox.Items.Clear(); filtering = false; playerSearchBox.Text = string.Empty; } if (PlayerListItems.Any(i => i.UserName == userName)) { RemoveUser(userName); AddLine(new LeaveLine(userName)); } }
void tas_BattleUserJoined(object sender, BattleUserEventArgs e1) { if (e1.BattleID != tas.MyBattleID) return; string name = e1.UserName; string welc = config.Welcome; if (!string.IsNullOrEmpty(welc)) { welc = welc.Replace("%1", name); welc = welc.Replace("%2", GetUserLevel(name).ToString()); welc = welc.Replace("%3", MainConfig.SpringieVersion); SayBattlePrivate(name, welc); } if (spring.IsRunning) { spring.AddUser(e1.UserName, e1.ScriptPassword); TimeSpan started = DateTime.Now.Subtract(spring.GameStarted); started = new TimeSpan((int)started.TotalHours, started.Minutes, started.Seconds); SayBattlePrivate(name, String.Format("THIS GAME IS CURRENTLY IN PROGRESS, PLEASE WAIT UNTIL IT ENDS! Running for {0}", started)); SayBattlePrivate(name, "If you say !notify, I will message you when the current game ends."); } if (SpawnConfig == null) { try { var serv = GlobalConst.GetSpringieService(); PlayerJoinResult ret = serv.AutohostPlayerJoined(tas.MyBattle.GetContext(), tas.ExistingUsers[name].AccountID); if (ret != null) { if (!string.IsNullOrEmpty(ret.PrivateMessage)) tas.Say(SayPlace.User, name, ret.PrivateMessage, false); if (!string.IsNullOrEmpty(ret.PublicMessage)) tas.Say(SayPlace.Battle, "", ret.PublicMessage, true); if (ret.ForceSpec) tas.ForceSpectator(name); if (ret.Kick) tas.Kick(name); } } catch (Exception ex) { SayBattle("ServerManage error: " + ex, false); } } if (SpawnConfig != null && SpawnConfig.Owner == name) // owner joins, set him boss ComBoss(TasSayEventArgs.Default, new[] { name }); }
void TasClient_BattleUserJoined(object sender, BattleUserEventArgs e1) { var userName = e1.UserName; if (userName != UserName) return; var joinedBattleID = e1.BattleID; var battle = Program.TasClient.ExistingBattles[joinedBattleID]; AddLine(new FriendJoinedBattleLine(userName, battle)); }