diff --git a/HubConnection.go b/HubConnection.go index 3981184..7539908 100644 --- a/HubConnection.go +++ b/HubConnection.go @@ -56,6 +56,13 @@ func (this *HubConnection) UserExists(nick string) bool { return already_existed } +func (this *HubConnection) UserCount() int { + this.userLock.RLock() + defer this.userLock.RUnlock() + + return len(this.users) +} + func (this *HubConnection) userJoined_NameOnly(nick string) { if !this.UserExists(nick) { this.userLock.Lock()