예제 #1
0
        protected static void HandlePlayerDisconnect(AuthPacket packet)
        {
            int UID = packet.Message.ID;

            var check  = Server.Players.Model.Where(c => c.GetUID == UID);
            var member = db.Pangya_Member.FirstOrDefault(c => c.UID == UID);

            if (check.Any())
            {
                Server.Players.Remove(check.First());
            }
            if (member != null)
            {
                member.Logon = 0;

                db.SaveChanges();

                packet.ID = AuthPacketEnum.SEND_DISCONNECT_PLAYER;
                Server.SendToAll(packet);
            }
        }