I am writing a multiplayer game that has account system and character creation system like standart MMORPGs. I have a question about name creating issue. I think that I can create a static variable on Player class that keeps created player names but it confused me. It will tell me name is valid or unvalid depends on the other players has this name.
Questions;
Does implementation does make sense ?
If i have 1000 players, is it means it consumes 1000 times of memory of this list? Or it just consume as like there is one?
What is your suggestion for place that I can keep player name list? A new class?
SELECT count(*) FROM characters WHERE name="WhatPlayerEntered"
. Many databases also allow you to define a UNIQUE-constraint on certain fields, so you can just try to insert the new character and you will receive an error message when it already exists. \$\endgroup\$