It sounds like you experienced abuse, but not from your family.
The abuse you experienced caused you to retreat and ultimately become lonely.
Then the loneliness led you to act in a co-dependent manner.
So abuse -> withdraw -> lonely -> act co-dependent -> attract more abuse
How accurate is the above?