Mail system.

I’m making an on-line 3rd person game with the capabilities to talk/message other people who are on-line (though it’s not multiplayer). It uses php to record stats and accounts. I need some help with implementing a mail system, kind of like what they have in WoW. I just don’t know where to start.

Thanks in advance.

You will need mysql. Do you have it?

Yeah, it’s part of a school project and we’ve got that set up. My role in this is setting up a mail system at the moment. I’m alright at scripting, but using php and unity together is getting beyond me.

You could modify that.

Thank you, I will check that out.

The basic idea is simple. You are going to have to create a table with these minimum forms:

ID (UINT) (PRIMARY) (UNIQUE)
SENT (DATETIME)
SENDER (UINT)
RECIPIENT (UINT) (INDEX)
TITLE (TEXT)
MESSAGE (TEXT)

Then send a few queries to create and delete mail as it is created. Additionally, you can create a maintenance function to cull all mail older than X days, etc.

I’d really suggest linking this with a table that contains registered usernames for players, but you could probably do it with e-mail only… You are going to have to be absolutely certain that players can’t have duplicate details if that is the case, so I’d recommend keeping a unique character ID, and referencing character names through that table.