func PKT_pve_list(reader *packet.Packet) (tbl pve_list, err error) { narr, err2 := reader.ReadU16() checkErr(err2) tbl.F_items = make([]pve_list_item, narr) for i := 0; i < int(narr); i++ { tbl.F_items[i], err = PKT_pve_list_item(reader) } return }
func PKT_LIST(reader *packet.Packet) (tbl LIST, err error) { narr, err2 := reader.ReadU16() checkErr(err2) tbl.F_items = make([]ID_SCORE, narr) for i := 0; i < int(narr); i++ { tbl.F_items[i], err = PKT_ID_SCORE(reader) } return }
func HandleRequest(hostid int32, reader *packet.Packet) []byte { defer _HandleError() b, err := reader.ReadU16() if err != nil { log.Println("read protocol error") } fmt.Println("proto: ", b) handle := ProtoHandler[b] if handle != nil { ret, err := handle(hostid, reader) fmt.Println(ret) if err == nil { return ret } } return nil }
func HandleRequest(hostid int32, reader *packet.Packet, output chan []byte) { defer helper.PrintPanicStack() seqid, err := reader.ReadU64() // read seqid if err != nil { log.Println("Read Sequence Id failed.", err) return } b, err := reader.ReadU16() if err != nil { log.Println("read protocol error") return } handle := ProtoHandler[b] if handle != nil { ret := handle(hostid, reader) if len(ret) != 0 { helper.SendChan(seqid, ret, output) } } }