<commit_before>package main

import (
	"fmt"
	"github.com/DeedleFake/census/ps2/events"
)

func main() {
	c, err := events.NewClient("", "", "example")
	if err != nil {
		panic(err)
	}
	defer c.Close()

	err = c.Subscribe(events.Sub{
		Events: []string{
			"BattleRankUp",
			"FacilityControl",
		},
		Chars:  events.SubAll,
		Worlds: events.SubAll,
	})
	if err != nil {
		panic(err)
	}

	for {
		ev, err := c.Next()
		if err != nil {
			panic(err)
		}

		switch ev := ev.(type) {
		case *events.FacilityControlEvent:
			switch ev.NewFactionID {
			case ev.OldFactionID:
				fmt.Printf("%v: The %v maintainted ownership of %v.\n",
					ev.WorldID,
					ev.NewFactionID,
					ev.FacilityID,
				)
			default:
				fmt.Printf("%v: The %v captured %v from the %v.\n",
					ev.WorldID,
					ev.NewFactionID,
					ev.FacilityID,
					ev.OldFactionID,
				)
			}

		case *events.BattleRankUpEvent:
			if ev.BattleRank >= 90 {
				fmt.Printf("Congratulations to %v on reaching level %v.\n", ev.CharacterID, ev.BattleRank)
			}

		default:
			fmt.Printf("%#v\n", ev)<commit_msg>eventstester: Show zone names for facility capture events.<commit_after>package main

import (
	"fmt"
	"github.com/DeedleFake/census/ps2/events"
)

func main() {
	c, err := events.NewClient("", "", "example")
	if err != nil {
		panic(err)
	}
	defer c.Close()

	err = c.Subscribe(events.Sub{
		Events: []string{
			"BattleRankUp",
			"FacilityControl",
		},
		Chars:  events.SubAll,
		Worlds: events.SubAll,
	})
	if err != nil {
		panic(err)
	}

	for {
		ev, err := c.Next()
		if err != nil {
			panic(err)
		}

		switch ev := ev.(type) {
		case *events.FacilityControlEvent:
			switch ev.NewFactionID {
			case ev.OldFactionID:
				fmt.Printf("%v: The %v maintainted ownership of %v on %v.\n",
					ev.WorldID,
					ev.NewFactionID,
					ev.FacilityID,
					ev.ZoneID,
				)
			default:
				fmt.Printf("%v: The %v captured %v on %v from the %v.\n",
					ev.WorldID,
					ev.NewFactionID,
					ev.FacilityID,
					ev.ZoneID,
					ev.OldFactionID,
				)
			}

		case *events.BattleRankUpEvent:
			if ev.BattleRank >= 90 {
				fmt.Printf("Congratulations to %v on reaching level %v.\n", ev.CharacterID, ev.BattleRank)
			}

		default:
			fmt.Printf("%#v\n", ev)
{'fraction_non_alphanumeric': 0.1553659631791648, 'fraction_numerical': 0.002694207453973956, 'mean_word_length': 2.75716694772344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4527544', 'n_tokens_mistral': 1039, 'n_tokens_neox': 871, 'n_words': 188}