Exemple #1
0
func (msg *SetRealmServers) Serialize(out io.Writer) error {
	// golang sucks
	values := make([]interface{}, len(msg.Servers))
	for i, server := range msg.Servers {
		values[i] = server
	}

	fmt.Fprint(out, types.NewMultipleFormatter("|", values...))
	return nil
}
Exemple #2
0
func (msg *SetRealmServerPlayers) Serialize(out io.Writer) error {
	values := make([]interface{}, len(msg.Players))
	for i, players := range msg.Players {
		values[i] = players
	}

	sub := uint64(msg.SubscriptionEnd.Sub(time.Now()).Nanoseconds()) / 1e6

	fmt.Fprint(out, sub, "|", types.NewMultipleFormatter("|", values...))

	return nil
}
Exemple #3
0
func (msg *SetRealmServerPlayers) Serialize(out io.Writer) error {
	values := make([]interface{}, len(msg.Players))
	for i, players := range msg.Players {
		values[i] = players
	}

	var remainingSubscription int64
	diff := msg.SubscriptionEnd.Sub(time.Now())
	if diff.Nanoseconds() > 0 {
		remainingSubscription = diff.Nanoseconds() / 1e6
	}

	fmt.Fprint(out, remainingSubscription, "|", types.NewMultipleFormatter("|", values...))

	return nil
}