// breakIntoStacksOf100OrLessSteaMIDs divides a list of steam IDs into stacks of one
// hundred IDs or less. The GetPlayerSummary API only accepts up to 100 steam IDs per
// call
// Returns lists of formatted IDs that the steam API will take like
// {"1233,4324,5435,5677,2432","34689,1035,7847,4673,9384"}
breakIntoStacksOf100OrLessSteaMIDs divides a list of steam IDs into stacks of one
hundred IDs or less.
// breakIntoStacksOf100OrLessSteaMIDs divides a list of steam IDs into stacks of one // hundred IDs or less . The GetPlayerSummary API only accepts up to 100 steam IDs per // call // Returns lists of formatted IDs that the steam API will take like // { " 1233 4324 5435 5677 2432 " " 34689 1035 7847 4673 9384 " }
func breakIntoStacksOf100OrLessSteamIDs(friendIDs []string) []string {
	totalFriendCount := len(friendIDs)
	steamIDList := []string{}
	fullOneHundredIDLists, remainder := divideAndGetRemainder(totalFriendCount, 100)
	if fullOneHundredIDLists == 0 {
		idList := []string{}
		idList = append(idList, friendIDs...)
		steamIDList = append(steamIDList, strings.Join(idList, ","))
		return steamIDList
	}
	for i := 0; i < fullOneHundredIDLists; i++ {
		idList := []string{}
		for j := 0; j < 100; j++ {
			idList = append(idList, friendIDs[j+(i*100)])
		}
		steamIDList = append(steamIDList, strings.Join(idList, ","))
	}
	if remainder == 0 {
		return steamIDList
	}
	firstIndex := fullOneHundredIDLists * 100
	idList := []string{}
	for i := firstIndex; i < firstIndex+remainder; i++ {
		idList = append(idList, friendIDs[i])
	}
	steamIDList = append(steamIDList, strings.Join(idList, ","))
	return steamIDList
}
func breakIntoStacksOf100OrLessSteamIDs ( friendIDs [ ] string ) [ ] string { totalFriendCount := len ( friendIDs ) steamIDList := [ ] string { } fullOneHundredIDLists , remainder := divideAndGetRemainder ( totalFriendCount , 100 ) if fullOneHundredIDLists == 0 { idList := [ ] string { } idList = append ( idList , friendIDs ... ) steamIDList = append ( steamIDList , strings . Join ( idList , " " ) ) return steamIDList } for i := 0 ; i < fullOneHundredIDLists ; i ++ { idList := [ ] string { } for j := 0 ; j < 100 ; j ++ { idList = append ( idList , friendIDs [ j + ( i * 100 ) ] ) } steamIDList = append ( steamIDList , strings . Join ( idList , " " ) ) } if remainder == 0 { return steamIDList } firstIndex := fullOneHundredIDLists * 100 idList := [ ] string { } for i := firstIndex ; i < firstIndex + remainder ; i ++ { idList = append ( idList , friendIDs [ i ] ) } steamIDList = append ( steamIDList , strings . Join ( idList , " " ) ) return steamIDList }
breakIntoStacksOf100OrLessSteaMIDs divides a list of steam IDs into stacks of one
hundred IDs or less.
breakIntoStacksOf100OrLessSteaMIDs divides a list of steam IDs into stacks of one hundred IDs or less .
// If less than one hundred total IDs // There are 100 or more total IDs // For each batch of 100 users // There were a clean multiple of 100 steamIDs // There was not a clean multiple of 100 steamIDs