Пример #1
0
func main() {

	err := agentCore.New("", func(s bool) {
		fmt.Println("Successfully Registered Agent!!!!")
		agentCore.GetInstance().Client.OnEvent("userstatechanged", commands.GoOffline)
	})

	if err == nil {
		forever := make(chan bool)
		<-forever
	}

}
Пример #2
0
func Attach(serverClass string, callback func(s bool)) {

	err := agentCore.New(serverClass, func(s bool) {
		if s == true {
			agentCore.GetInstance().Client.OnEvent("userstatechanged", commands.GoOffline)
		}
		callback(s)
	})

	if err == nil {
		agentCore.GetInstance().Client.OnCommand("globalconfigrecieved", GlobalConfigRecieved)
	} else {
		fmt.Println("Error Creating Client!!!")
	}

}