Esempio n. 1
0
func (ticker *Ticker) kickUnactive(cid, uid uint32) {
	r, ok := ticker.Casino[cid]
	if ok {
		delete(r.Users, uid)
		r.KickPlayer(uid)
		delete(ticker.Active[cid], uid)
		db.SetLogoutTime(uid)
	}

	rep := LogoutRep{0, uid, "logout"}
	jn, _ := json.Marshal(rep)
	r.Broadcast(jn)
	fmt.Println("kickUnactive", cid, uid)
}
Esempio n. 2
0
func OnLogout(m game.JsonString, c net.Conn) {
	fmt.Println("OnLogout")
	uid, cid := m.GetUid(), m.GetCid()
	r, ok := m.GetRound(Casino)
	if ok {
		uid := m.GetUid()
		r.Logout(uid)
	}
	_, ok = ticker.Active[cid]
	if ok {
		delete(ticker.Active[cid], uid)
	}
	db.SetLogoutTime(uid)

	rep := game.LogoutRep{0, uid, "logout"}
	r.Broadcast(rep)
	fmt.Println("OnLogout rep:", rep)
}