aboutsummaryrefslogtreecommitdiff
path: root/clients.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-12-08 09:49:40 +0800
committerRunxi Yu <me@runxiyu.org>2024-12-08 09:49:40 +0800
commit112722f1c8de842f6c8b672ea73b3cae182274ba (patch)
tree41cc23dc14b36c3c53b1dbb18cad7d334e9758af /clients.go
parentPrimitive client states (diff)
downloadmeseircd-112722f1c8de842f6c8b672ea73b3cae182274ba.tar.gz
meseircd-112722f1c8de842f6c8b672ea73b3cae182274ba.tar.zst
meseircd-112722f1c8de842f6c8b672ea73b3cae182274ba.zip
Primitive nick registration
Diffstat (limited to 'clients.go')
-rw-r--r--clients.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/clients.go b/clients.go
index 1a363cc..a181f99 100644
--- a/clients.go
+++ b/clients.go
@@ -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{}