func (queue EventQueue) Run(server *Server, clients map[int]*Client) {
	for _, event := range queue.Events {
		client := clients[event.Client]

		if event.Type == ETConnect {
			fmt.Println("c", client.Nick)
			err := client.Connect(server)
			if err != nil {
				log.Fatal("Could not connect...", err.Error())
			}
		} else if event.Type == ETDisconnect {
			client.Disconnect(server)
			client.Socket = nil
		} else if event.Type == ETLine {
			client.Socket.Write(event.Line)
		} else if event.Type == ETWait {
			log.Println("ETWait events not yet implemented")
		} else {
			log.Println("Got unknown event type:", event.Type)
			spew.Dump(event)
			fmt.Print("\n\n")
		}
	}
	// send finished notice, used for syncing
	queue.Finished <- true
}
// Run goes through our event list.
Run goes through our event list.
// Run goes through our event list .
func (queue EventQueue) Run(server *Server, clients map[int]*Client) {
	for _, event := range queue.Events {
		client := clients[event.Client]
		if event.Type == ETConnect {
			fmt.Println("c", client.Nick)
			err := client.Connect(server)
			if err != nil {
				log.Fatal("Could not connect...", err.Error())
			}
		} else if event.Type == ETDisconnect {
			client.Disconnect(server)
			client.Socket = nil
		} else if event.Type == ETLine {
			client.Socket.Write(event.Line)
		} else if event.Type == ETWait {
			log.Println("ETWait events not yet implemented")
		} else {
			log.Println("Got unknown event type:", event.Type)
			spew.Dump(event)
			fmt.Print("\n\n")
		}
	}
	queue.Finished <- true
}
func ( queue EventQueue ) Run ( server * Server , clients map [ int ] * Client ) { for _ , event := range queue . Events { client := clients [ event . Client ] if event . Type == ETConnect { fmt . Println ( " " , client . Nick ) err := client . Connect ( server ) if err != nil { log . Fatal ( " " , err . Error ( ) ) } } else if event . Type == ETDisconnect { client . Disconnect ( server ) client . Socket = nil } else if event . Type == ETLine { client . Socket . Write ( event . Line ) } else if event . Type == ETWait { log . Println ( " " ) } else { log . Println ( " " , event . Type ) spew . Dump ( event ) fmt . Print ( " \n \n " ) } } queue . Finished <- true }
Run goes through our event list.
Run goes through our event list .
// send finished notice, used for syncing