예제 #1
0
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
	}
}
예제 #2
0
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)
	}
}
예제 #3
0
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)
}