Unique Avatars? - 06/08/2004 6:20 PM
I have my own custom avatar solution that prevents two people from having the same avatar, but there is too much manual intervention on my part. I have an idea to cut this down quite a bit, but I need some help.
I have already modified the avatar selection popup supplied by Infopop to only be an avatar gallery of sorts, but I plan to modify it further to once again make it select and assign your avatar. The trouble is, I won’t allow two people to have the same avatar. I need to create some sort of flat file that holds the names of the avatars that are taken and have it check this file before allowing an avatar to be assigned. This is the hard part.
What would be the best format or organization for the file? Are there more efficient ways to search a file like this? Do I have to use some file locking method to prevent people from reading/writing to the file at the same time?
Or is there a better and entirely different way to solve the problem of unique avatars?
I have already modified the avatar selection popup supplied by Infopop to only be an avatar gallery of sorts, but I plan to modify it further to once again make it select and assign your avatar. The trouble is, I won’t allow two people to have the same avatar. I need to create some sort of flat file that holds the names of the avatars that are taken and have it check this file before allowing an avatar to be assigned. This is the hard part.
What would be the best format or organization for the file? Are there more efficient ways to search a file like this? Do I have to use some file locking method to prevent people from reading/writing to the file at the same time?
Or is there a better and entirely different way to solve the problem of unique avatars?