mirror repo of https://github.com/littlequartz/clink. a socket programming assignment for Sistem Terdistribusi
Go to file
Syahdan 52d4602e33 feat(chat): colorize usernames by ID; refine IDs/usernames and /name parsing
Server:
- Generate 6-char IDs from lowercase hex alphabet "abcdef0123456789"
- Default username now uses the ID as-is (no extra ToLower)
- Use strings.CutPrefix for robust “/name ” command parsing

Client:
- Add colorizeLine to apply ANSI colors based on 6-hex-digit ID
  - Colorize chat lines: "<name> (<id>): <msg>"
  - Colorize [join]/[leave] notices
  - Colorize [rename] events
  - Colorize Welcome banner
- Apply colorizeLine to incoming netMsg before appending

Notes:
- ID regex patterns accept 6 hex digits (case-insensitive), rendered in lowercase
- Keeps non-matching lines unchanged
2025-10-15 11:27:16 +07:00
go.mod feat(server): usernames, IDs, and commands; sanitize names; richer join/leave messages 2025-10-15 11:25:56 +07:00
go.sum feat(server): usernames, IDs, and commands; sanitize names; richer join/leave messages 2025-10-15 11:25:56 +07:00
main.go feat(chat): colorize usernames by ID; refine IDs/usernames and /name parsing 2025-10-15 11:27:16 +07:00
server.go feat(chat): colorize usernames by ID; refine IDs/usernames and /name parsing 2025-10-15 11:27:16 +07:00