Example #1
0
func (ts *PBTableCodec) RecModify(rec datatype.Recorder, row, col int) interface{} {
	out := &s2c.RecordGrid{}
	out.Record = proto.String(rec.GetName())
	out.Row = proto.Int32(int32(row))
	out.Col = proto.Int32(int32(col))
	value, _ := rec.Get(row, col)
	ar := util.NewStoreArchiver(nil)
	ar.Write(value)

	out.Gridinfo = ar.Data()
	return out
}
Example #2
0
func (ts *PBTableCodec) RecSetRow(rec datatype.Recorder, row int) interface{} {
	out := &s2c.RecordSetRow{}
	out.Record = proto.String(rec.GetName())
	out.Row = proto.Int32(int32(row))
	data, err := rec.SerialRow(row)
	if err != nil {
		log.LogError(err)
		return nil
	}
	out.Rowinfo = data
	return out
}
Example #3
0
func (ts *PBTableCodec) SyncTable(rec datatype.Recorder) interface{} {
	data, err := rec.Serial()
	if err != nil {
		return nil
	}
	out := &s2c.CreateRecord{}
	out.Record = proto.String(rec.GetName())
	out.Rows = proto.Int32(int32(rec.GetRows()))
	out.Cols = proto.Int32(int32(rec.GetCols()))
	out.Recinfo = data

	return out
}
Example #4
0
func (gd *GlobalDataHelper) RecModify(self datatype.Entityer, rec datatype.Recorder, row, col int) {
	if !gd.isServer {
		return
	}
	v := gd.dataChange()

	for _, client := range gd.globalclients {
		if client.disable || client.status == STATUS_NONE { //没有开启
			continue
		}

		app := GetAppById(client.appid)
		if app == nil {
			continue
		}

		val, _ := rec.Get(row, col)
		app.CallBack(nil, "GlobalHelper.GlobalDataRecModify", gd.OnDataChanged, self.GetIndex(), v, rec.GetName(), row, col, datatype.NewAny(0, val))
	}
}
Example #5
0
//表格变动同步
func (gd *GlobalDataHelper) RecAppend(self datatype.Entityer, rec datatype.Recorder, row int) {
	if !gd.isServer {
		return
	}

	v := gd.dataChange()

	for _, client := range gd.globalclients {
		if client.disable || client.status == STATUS_NONE { //没有开启
			continue
		}

		app := GetAppById(client.appid)
		if app == nil {
			continue
		}

		rowvalues, _ := rec.SerialRow(row)
		app.CallBack(nil, "GlobalHelper.GlobalDataRecAppend", gd.OnDataChanged, self.GetIndex(), v, rec.GetName(), row, rowvalues)
	}
}
Example #6
0
func (ts *PBTableCodec) RecClear(rec datatype.Recorder) interface{} {
	out := &s2c.RecordClear{}
	out.Record = proto.String(rec.GetName())
	return out
}
Example #7
0
func (ts *PBTableCodec) RecDelete(rec datatype.Recorder, row int) interface{} {
	out := &s2c.RecordDelRow{}
	out.Record = proto.String(rec.GetName())
	out.Row = proto.Int32(int32(row))
	return out
}