diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 09:49:40 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 09:49:40 +0800 |
commit | 112722f1c8de842f6c8b672ea73b3cae182274ba (patch) | |
tree | 41cc23dc14b36c3c53b1dbb18cad7d334e9758af /clients.go | |
parent | Primitive client states (diff) | |
download | meseircd-112722f1c8de842f6c8b672ea73b3cae182274ba.tar.gz meseircd-112722f1c8de842f6c8b672ea73b3cae182274ba.tar.zst meseircd-112722f1c8de842f6c8b672ea73b3cae182274ba.zip |
Primitive nick registration
Diffstat (limited to 'clients.go')
-rw-r--r-- | clients.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -3,11 +3,12 @@ package main import ( "net" "log/slog" + "sync" ) type Client struct { conn *net.Conn - UID [6]byte + UID string Nick string Ident string Host string @@ -41,7 +42,7 @@ func (client Client) ClientSource() string { } func (client Client) ServerSource() string { - return string(client.Server.SID[:]) + string(client.UID[:]) + return client.UID } type ClientState uint8 @@ -51,3 +52,6 @@ const ( ClientStatePreRegistration ClientStateRegistered ) + +var uidToClient = sync.Map{} +var nickToClient = sync.Map{} |