Example #1
0
//------------------------------------------------ Forward to Hub/Group
func GroupForward(req *IPCObject) bool {
	defer _hub_err()
	msg := hub.FORWARDIPC{F_IPC: req.Json()}
	ret := _call(packet.Pack(hub.Code["forwardgroup_req"], &msg, nil))
	reader := packet.Reader(ret)
	tbl, err := hub.PKT_INT(reader)

	if err != nil || tbl.F_v == 0 {
		return false
	}

	return true
}
Example #2
0
func Ping() bool {
	defer _hub_err()
	req := hub.INT{}
	req.F_v = 1
	ret := _call(packet.Pack(hub.Code["ping_req"], &req, nil))
	reader := packet.Reader(ret)
	tbl, _ := hub.PKT_INT(reader)
	if tbl.F_v != req.F_v {
		return false
	}

	return true
}
Example #3
0
func Logout(id int32) bool {
	defer _hub_err()
	req := hub.ID{}
	req.F_id = id
	ret := _call(packet.Pack(hub.Code["logout_req"], &req, nil))
	reader := packet.Reader(ret)
	tbl, err := hub.PKT_INT(reader)

	if err != nil || tbl.F_v == 0 {
		return false
	}

	return true
}
Example #4
0
func Protect(id int32, until time.Time) bool {
	defer _hub_err()

	req := hub.ID{}
	req.F_id = id
	ret := _call(packet.Pack(hub.Code["protect_req"], &req, nil))
	reader := packet.Reader(ret)
	tbl, err := hub.PKT_INT(reader)

	if err != nil || tbl.F_v == 0 {
		return false
	}

	return true
}