I did a Google search, since I had never run into this error code, and I came up with two different types of answers. The general consensus of the answers were basically the same message but did have some details that were different.
One of the answers suggested that it was a foul up due to entering incorrect password combinations via the multilayer passwords that we have to enter when you use the Play Online authenticator also known as the Play Online security token. This solution I'm really not sure how much validity I want to give it, because I know I've entered incorrect passwords and I don't really ever recall receiving a 5312 error code.
The second solution suggested that your system maybe recovering from a virus or Trojans then there may be some residual effects leftover. That thread, I have to admit, is way more technical than I really have the ability to understand the technical aspects of what they were discussing. I will paste a link to both for you to read below so that you can read them and see if they can help you.
If all else fails you can always call FFXI's customer support, but be aware this is a Toll call and it will cost you money to call them so make sure you call from a phone you get free long distance. I have to be very honest with you I'm someone that does know the game very well but I do not know programming so this is a subject that I am a little uneasy giving advice for.
One other option is you could go to FFXIAH.com to the forum area and start new form thread regarding this error message and ask for input. I know for a fact that this forum is very active so they'll probably be a ton of people who will log into the thread and pipe up with all different types of input ....... Hopefully Skyfiredancer (talk) 07:39, June 16, 2015 (UTC)
1-858-790-7529 Hours Mon-Fri 9am-6pm (not a free call - charges apply)