mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 11:59:40 +01:00
Track client access time.
This commit is contained in:
parent
dbaa73a319
commit
32bee68407
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
@ -20,6 +21,7 @@ type Client struct {
|
|||||||
wallOps bool
|
wallOps bool
|
||||||
server *Server
|
server *Server
|
||||||
channels ChannelSet
|
channels ChannelSet
|
||||||
|
atime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClientSet map[*Client]bool
|
type ClientSet map[*Client]bool
|
||||||
|
@ -34,6 +34,7 @@ func NewServer(name string) *Server {
|
|||||||
go func() {
|
go func() {
|
||||||
for m := range recv {
|
for m := range recv {
|
||||||
log.Printf("%s -> %T%+v", m.client.Id(), m.message, m.message)
|
log.Printf("%s -> %T%+v", m.client.Id(), m.message, m.message)
|
||||||
|
m.client.atime = time.Now()
|
||||||
m.message.Handle(server, m.client)
|
m.message.Handle(server, m.client)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user