private static void Process() { if (VerifyJob(Job) && VerifyModel(Model) && VerifyName(CharName) && NameAvailable) { var character = CreateCharacter(); character.GameSocket = Player.GameSocket; character.GameSocket.Ref = character; character.AccountId = Player.AccountId; character.Password = Player.Password; Player = character; Player.LoginType = LoginType.Login; SelectorSystem.AddCharacterTo(Player.AccountId, Player); Player.ForceSend(MsgText.Create(Constants.System, Constants.Allusers, Constants.AnswerOk, MsgTextType.Dialog), 29 + Constants.System.Length + Constants.Allusers.Length + Constants.AnswerOk.Length); } else { Player.ForceSend(MsgText.Create(Constants.System, Constants.Allusers, "Taken or invalid name. (A-Y | 0-9)", MsgTextType.Dialog), 29 + Constants.System.Length + Constants.Allusers.Length + "Taken or invalid name. (A-Y | 0-9)".Length); } }
private static void FriendApply(Player player, ref MsgFriend packet) { if (GameWorld.Find(packet.UniqId, out Player target)) { if (target.FriendRequestTarget == player.UniqueId) { player.ForceSend(BufferPool.Clone(packet), packet.Size); target.ForceSend(packet, packet.Size); player.Send(Create(target, MsgFriendActionType.FriendAccept, MsgFriendStatusType.Online)); target.Send(Create(player, MsgFriendActionType.FriendAccept, MsgFriendStatusType.Online)); if (player.Friends == null) { player.Friends = new List <int>(); } if (target.Friends == null) { target.Friends = new List <int>(); } if (!player.Friends.Contains(target.UniqueId)) { player.Friends.Add(target.UniqueId); } if (!target.Friends.Contains(player.UniqueId)) { target.Friends.Add(player.UniqueId); } } else { player.FriendRequestTarget = target.UniqueId; target.ForceSend(packet, packet.Size); } } }