static public void BuildPlayerInfo(ref PacketOut Out, Character_social Social) { EventInterface Interface = Social.GetEvent <EventInterface>(); if (Interface != null && Interface.HasPlayer()) { BuildPlayerInfo(ref Out, Interface.GetPlayer()); } else { BuildPlayerInfo(ref Out, (uint)Social.DistCharacterId, Social.DistName, false, 0, 0, 0); } }
public void RemoveFriend(string Name) { Log.Success("RemoveFriend", "Name=" + Name); Player Plr = GetPlayer(); if (Plr == null) { return; } Name = Name.ToLower(); Character_social Social = GetSocial(Name); if (Social == null) { Plr.SendLocalizeString("", GameData.Localized_text.TEXT_SN_LISTS_ERR_PLAYER_NOT_FOUND); return; } EventInterface Interface = Social.GetEvent <EventInterface>(); if (Interface == null) { return; } Interface.RemoveEventNotify(EventName.PLAYING, OnPlayerConnect); Interface.RemoveEventNotify(EventName.LEAVE, OnPlayerLeave); PacketOut Out = new PacketOut((byte)Opcodes.F_SOCIAL_NETWORK); Out.WriteUInt16(0); Out.WriteByte(1); Out.WriteByte(1); // Count Out.WriteByte(1); Out.WriteUInt32((uint)Social.DistCharacterId); Plr.SendPacket(Out); Plr.SendLocalizeString(Social.DistName, GameData.Localized_text.TEXT_SN_FRIEND_REMOVE); _Socials.Remove(Social); CharMgr.Database.DeleteObject(Social); }
public static void BuildPlayerInfo(ref PacketOut Out, Character_social Social) { EventInterface Interface = Social.GetEvent<EventInterface>(); if (Interface != null && Interface.HasPlayer()) BuildPlayerInfo(ref Out, Interface.GetPlayer()); else BuildPlayerInfo(ref Out, (uint)Social.DistCharacterId, Social.DistName, false, 0, 0, 0); }