private void OnOtherCharacterDisconnected(object sender, EventArgs e) { KeyValuePair <string, long> kvPair = (KeyValuePair <string, long>)sender; if (Character.IsFriendOfCharacter(kvPair.Value)) { if (Character != null && Character.Name != kvPair.Key) { _client.SendPacket(Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("CHARACTER_LOGGED_OUT"), kvPair.Key), 10)); _client.SendPacket(Character.GenerateFinfo(kvPair.Value)); } } }
private void OnOtherCharacterDisconnected(object sender, EventArgs e) { Tuple <long, string> loggedOutCharacter = (Tuple <long, string>)sender; if (Character.IsFriendOfCharacter(loggedOutCharacter.Item1)) { if (Character != null && Character.CharacterId != loggedOutCharacter.Item1) { _client.SendPacket(Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("CHARACTER_LOGGED_OUT"), loggedOutCharacter.Item2), 10)); _client.SendPacket(Character.GenerateFinfo(loggedOutCharacter.Item1, false)); } } }
private void OnOtherCharacterConnected(object sender, EventArgs e) { Tuple <string, long> loggedInCharacter = (Tuple <string, long>)sender; if (Character.IsFriendOfCharacter(loggedInCharacter.Item2)) { if (Character != null && Character.Name != loggedInCharacter.Item1) { _client.SendPacket(Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("CHARACTER_LOGGED_IN"), loggedInCharacter.Item1), 10)); _client.SendPacket(Character.GenerateFinfo(null, loggedInCharacter.Item2)); } } }
private void OnOtherCharacterConnected(object sender, EventArgs e) { Tuple <long, string> loggedInCharacter = (Tuple <long, string>)sender; if (Character.IsFriendOfCharacter(loggedInCharacter.Item1)) { if (Character != null && Character.CharacterId != loggedInCharacter.Item1) { _client.SendPacket(Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("CHARACTER_LOGGED_IN"), loggedInCharacter.Item2), 10)); _client.SendPacket(Character.GenerateFinfo(loggedInCharacter.Item1, true)); } } FamilyCharacter chara = Character.Family?.FamilyCharacters.FirstOrDefault(s => s.CharacterId == loggedInCharacter.Item1); if (chara != null && loggedInCharacter.Item1 != Character?.CharacterId) { _client.SendPacket(Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("CHARACTER_FAMILY_LOGGED_IN"), loggedInCharacter.Item2, Language.Instance.GetMessageFromKey(chara.Authority.ToString().ToUpper())), 10)); } }
public void KickAll(Character exeptCharacter = null, bool exeptFriends = false) { Sessions.Where(s => exeptCharacter == null || s.Character != exeptCharacter && (!exeptFriends || !exeptCharacter.IsFriendOfCharacter(s.Character.CharacterId))).ToList() .ForEach(s => ServerManager.Instance.ChangeMap(s.Character.CharacterId, s.Character.MapId, s.Character.MapX, s.Character.MapY)); }