feat: impl release hand & next speaker selection

This commit is contained in:
efim
2023-11-09 06:20:43 +00:00
parent aa048efbd3
commit 480d007e6c
5 changed files with 199 additions and 48 deletions

View File

@@ -5,25 +5,28 @@ import (
"encoding/json"
"errors"
"fmt"
"math/rand"
"log"
"github.com/redis/go-redis/v9"
)
type Person struct {
PersonId int
Name string
PasswordHash string
type PersonId int
// TODO move to rooms i guess
func RandomPersonId() PersonId {
randInt := rand.Int()
if randInt == 0 {
randInt = 1
}
return PersonId(randInt)
}
type Room struct {
Name string // will be unique ID
AdminIds []int
type Person struct {
Id PersonId
Name string
PasswordHash string
Paricipants []Person
// TODO hands, for each type of hand?
// i guess participants order fixed for now?
// and i'll still need 'current' for each hand level
}
// well, it seems that i'd better do marshalling into bytes then