brigas-team team mailing list archive
-
brigas-team team
-
Mailing list archive
-
Message #00087
[Blueprint algorithm-unique-player-id] Algoritmo de criação de ID único de jogador
Blueprint changed by Felipe Santos:
Whiteboard changed to:
"A Universally Unique Identifier (UUID) is an identifier standard used
in software construction, standardized by the Open Software Foundation
(OSF) as part of the Distributed Computing Environment (DCE). The intent
of UUIDs is to enable distributed systems to uniquely identify
information without significant central coordination. Information
labeled with UUIDs can therefore be later combined into a single
database without needing to resolve name conflicts. The most widespread
use of this standard is in Microsoft's Globally Unique Identifiers
(GUIDs). Other significant uses include Linux's ext2/ext3 filesystem,
LUKS encrypted partitions, GNOME, KDE, and Mac OS X, all of which use
implementations derived from the uuid library found in the e2fsprogs
package."
O algoritmo para criação do ID do jogador foi implementado usando o
padrão supracitado. O módulo "uuid" do python contém alguns métodos que
ajudaram nesta tarefa. A implementação gera um uuid aleatório ( método
uuid.uuid4() ) e verifica (só por precaução) se há algum jogador
registrado com ele.
--
Algoritmo de criação de ID único de jogador
https://blueprints.launchpad.net/brigas/+spec/algorithm-unique-player-id