func CreateSteamID(input string) (*SteamID, error) {
	s := &SteamID{
		universe:  universe.INVALID,
		idType:    steamIDType.INVALID,
		instance:  instance.ALL,
		accountid: 0,
	}

	if len(input) == 0 {
		return s, errors.New("There was no input given")
	}

	// r := regexp.MustCompile(`STEAM_(?P<Universe>[0-5]):(?P<IDType>[0-1]):(?P<ID>[0-9]+)`)
	isSteamID2 := regexp.MustCompile(`^STEAM_([0-5]):([0-1]):([0-9]+)$`)
	isSteamID3 := regexp.MustCompile(`^\[([a-zA-Z]):([0-5]):([0-9]+)(:[0-9]+)?\]$`)

	if isSteamID2.MatchString(input) {
		matches := isSteamID2.FindStringSubmatch(input)
		iUniverse, _ := strconv.Atoi(matches[1])
		accountid1, _ := strconv.Atoi(matches[3])
		accountid2, _ := strconv.Atoi(matches[2])

		// universe.GetUniverse(iUniverse)
		if iUniverse > 0 {
			s.universe = universe.Universe(iUniverse)
		} else {
			s.universe = universe.PUBLIC
		}

		s.idType = steamIDType.INDIVIDUAL
		s.instance = instance.DESKTOP

		s.accountid = (accountid1 * 2) + accountid2
	} else if isSteamID3.MatchString(input) {
		matches := isSteamID3.FindStringSubmatch(input)
		iUniverse, _ := strconv.Atoi(matches[2])
		iAccountid, _ := strconv.Atoi(matches[3])

		s.universe = universe.Universe(iUniverse)
		s.accountid = iAccountid

		typeChar := matches[1]

		if len(matches[4]) > 0 {
			iInstance, _ := strconv.Atoi(string(matches[4][1]))
			s.instance = instance.Instance(iInstance)
		} else if typeChar == "U" {
			s.instance = instance.DESKTOP
		}

		if typeChar == "C" {
			s.instance = instance.Instance(int(s.instance) | int(chat.Clan))
		} else if typeChar == "L" {
			s.instance = instance.Instance(int(s.instance) | int(chat.Lobby))
			s.idType = steamIDType.CHAT
		} else {
			s.idType = steamIDType.GetType(typeChar)
		}
	} else {
		i, _ := strconv.ParseUint(input, 10, 64)
		s.accountid = int(i) & 0xFFFFFFFF >> 0

		i = i >> 32
		s.instance = instance.Instance(int(i) & 0xFFFFF)

		i = i >> 20
		s.idType = steamIDType.Type(int(i) & 0xF)

		i = i >> 4
		s.universe = universe.Universe(int(i))
	}

	return s, nil
}
// CreateSteamID creates a steamID object

CreateSteamID creates a steamID object
// CreateSteamID creates a steamID object
func CreateSteamID(input string) (*SteamID, error) {
	s := &SteamID{
		universe:  universe.INVALID,
		idType:    steamIDType.INVALID,
		instance:  instance.ALL,
		accountid: 0,
	}
	if len(input) == 0 {
		return s, errors.New("There was no input given")
	}
	isSteamID2 := regexp.MustCompile(`^STEAM_([0-5]):([0-1]):([0-9]+)$`)
	isSteamID3 := regexp.MustCompile(`^\[([a-zA-Z]):([0-5]):([0-9]+)(:[0-9]+)?\]$`)
	if isSteamID2.MatchString(input) {
		matches := isSteamID2.FindStringSubmatch(input)
		iUniverse, _ := strconv.Atoi(matches[1])
		accountid1, _ := strconv.Atoi(matches[3])
		accountid2, _ := strconv.Atoi(matches[2])
		if iUniverse > 0 {
			s.universe = universe.Universe(iUniverse)
		} else {
			s.universe = universe.PUBLIC
		}
		s.idType = steamIDType.INDIVIDUAL
		s.instance = instance.DESKTOP
		s.accountid = (accountid1 * 2) + accountid2
	} else if isSteamID3.MatchString(input) {
		matches := isSteamID3.FindStringSubmatch(input)
		iUniverse, _ := strconv.Atoi(matches[2])
		iAccountid, _ := strconv.Atoi(matches[3])
		s.universe = universe.Universe(iUniverse)
		s.accountid = iAccountid
		typeChar := matches[1]
		if len(matches[4]) > 0 {
			iInstance, _ := strconv.Atoi(string(matches[4][1]))
			s.instance = instance.Instance(iInstance)
		} else if typeChar == "U" {
			s.instance = instance.DESKTOP
		}
		if typeChar == "C" {
			s.instance = instance.Instance(int(s.instance) | int(chat.Clan))
		} else if typeChar == "L" {
			s.instance = instance.Instance(int(s.instance) | int(chat.Lobby))
			s.idType = steamIDType.CHAT
		} else {
			s.idType = steamIDType.GetType(typeChar)
		}
	} else {
		i, _ := strconv.ParseUint(input, 10, 64)
		s.accountid = int(i) & 0xFFFFFFFF >> 0
		i = i >> 32
		s.instance = instance.Instance(int(i) & 0xFFFFF)
		i = i >> 20
		s.idType = steamIDType.Type(int(i) & 0xF)
		i = i >> 4
		s.universe = universe.Universe(int(i))
	}
	return s, nil
}
func CreateSteamID ( input string ) ( * SteamID , error ) { s := & SteamID { universe : universe . INVALID , idType : steamIDType . INVALID , instance : instance . ALL , accountid : 0 , } if len ( input ) == 0 { return s , errors . New ( " " ) } isSteamID2 := regexp . MustCompile ( `^STEAM_([0-5]):([0-1]):([0-9]+)$` ) isSteamID3 := regexp . MustCompile ( `^\[([a-zA-Z]):([0-5]):([0-9]+)(:[0-9]+)?\]$` ) if isSteamID2 . MatchString ( input ) { matches := isSteamID2 . FindStringSubmatch ( input ) iUniverse , _ := strconv . Atoi ( matches [ 1 ] ) accountid1 , _ := strconv . Atoi ( matches [ 3 ] ) accountid2 , _ := strconv . Atoi ( matches [ 2 ] ) if iUniverse > 0 { s . universe = universe . Universe ( iUniverse ) } else { s . universe = universe . PUBLIC } s . idType = steamIDType . INDIVIDUAL s . instance = instance . DESKTOP s . accountid = ( accountid1 * 2 ) + accountid2 } else if isSteamID3 . MatchString ( input ) { matches := isSteamID3 . FindStringSubmatch ( input ) iUniverse , _ := strconv . Atoi ( matches [ 2 ] ) iAccountid , _ := strconv . Atoi ( matches [ 3 ] ) s . universe = universe . Universe ( iUniverse ) s . accountid = iAccountid typeChar := matches [ 1 ] if len ( matches [ 4 ] ) > 0 { iInstance , _ := strconv . Atoi ( string ( matches [ 4 ] [ 1 ] ) ) s . instance = instance . Instance ( iInstance ) } else if typeChar == " " { s . instance = instance . DESKTOP } if typeChar == " " { s . instance = instance . Instance ( int ( s . instance ) | int ( chat . Clan ) ) } else if typeChar == " " { s . instance = instance . Instance ( int ( s . instance ) | int ( chat . Lobby ) ) s . idType = steamIDType . CHAT } else { s . idType = steamIDType . GetType ( typeChar ) } } else { i , _ := strconv . ParseUint ( input , 10 , 64 ) s . accountid = int ( i ) & 0xFFFFFFFF >> 0 i = i >> 32 s . instance = instance . Instance ( int ( i ) & 0xFFFFF ) i = i >> 20 s . idType = steamIDType . Type ( int ( i ) & 0xF ) i = i >> 4 s . universe = universe . Universe ( int ( i ) ) } return s , nil }
CreateSteamID creates a steamID object
CreateSteamID creates a steamID object
// r := regexp.MustCompile(`STEAM_(?P<Universe>[0-5]):(?P<IDType>[0-1]):(?P<ID>[0-9]+)`)
 // universe.GetUniverse(iUniverse)
