func forwardEvent(evtName string) func(e events.Event) interface{} { return func(e events.Event) interface{} { u := events.GetUserId(e) // forward to XNA helper.ToXna(evtName, u.Id) return nil } }
func (t *Manager) RemoveMember(teamId, userId, userIndex int) { if teamId != -1 { uName := t.Roster[teamId][userIndex].User.Name t.Roster[teamId][userIndex] = t.Roster[teamId][len(t.Roster[teamId])-1] t.Roster[teamId] = t.Roster[teamId][0 : len(t.Roster[teamId])-1] t.removeMemberKeys(userId) t.removeMemberFromTeam(userId, teamId) userIdKey := fmt.Sprintf("username:%v:uid", uName) db.Redis.Del(userIdKey) helper.ToXna("user:disconnect", userId) } }
func (t *Manager) removeTeam(teamId int) { teamKey := fmt.Sprintf("team:%v:users", teamId) db.Redis.Del(teamKey) delete(t.Roster, teamId) helper.ToXna("collector:destroy", teamId) }