Beispiel #1
0
func (c *friendCmd) Execute(args []string) error {
	client, err := ikaring.CreateClient()
	if err != nil {
		return err
	}

	if err = login(client); err != nil {
		return err
	}

	list, err := client.GetFriendList()
	if err != nil {
		return err
	}

	if len(list) == 0 {
		fmt.Println("フレンドはオフラインです")
	}

	for _, f := range list {
		fmt.Printf("%s\n", f.Name)
		fmt.Printf("\t%s\n", f.Mode)
	}
	return nil
}
Beispiel #2
0
func (c *stageCmd) Execute(args []string) error {
	client, err := ikaring.CreateClient()
	if err != nil {
		return err
	}

	if err = login(client); err != nil {
		return err
	}

	info, err := client.GetStageInfo()
	if err != nil {
		return err
	}

	if info.FesSchedules != nil {
		for _, s := range *info.FesSchedules {
			fmt.Printf("%v\n", s)
		}
	}

	if info.Schedules != nil {
		for _, s := range *info.Schedules {
			fmt.Printf("%v\n", s)
		}
	}
	return nil
}
Beispiel #3
0
func (c *rankCmd) Execute(args []string) error {
	client, err := ikaring.CreateClient()
	if err != nil {
		return err
	}

	if err = login(client); err != nil {
		return err
	}

	info, err := client.GetRanking()
	if err != nil {
		return err
	}

	if len(info.Regular) > 0 {
		fmt.Println(Green + "レギュラーマッチ" + End)
		for _, p := range info.Regular {
			fmt.Printf("\t[%d] %3d %s (%s)\n", p.Rank, p.Score, p.Name, p.Weapon)
		}
	}

	if len(info.Gachi) > 0 {
		fmt.Println(Pink + "ガチマッチ" + End)
		for _, p := range info.Gachi {
			fmt.Printf("\t[%d] %3d %s (%s)\n", p.Rank, p.Score, p.Name, p.Weapon)
		}
	}

	if len(info.Festival) > 0 {
		fmt.Println(Blue + "フェス" + End)
		for _, p := range info.Festival {
			top100 := ""
			if p.Top100 {
				top100 = Red + "百ケツ!\t" + End
			} else {
				top100 = "\t"
			}
			fmt.Fprintf(stdout, "%s[%d] %3d %s(%s)\n", top100, p.Rank, p.Score, p.Name, p.Weapon)
		}
	}

	return nil
}