Select command from reconstructor / Units save command when controlled
This commit is contained in:
@@ -34,6 +34,14 @@ public class Annotations{
|
||||
|
||||
}
|
||||
|
||||
/** Indicates that a field should not be synced to clients (but may still be non-transient) */
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface NoSync{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** Indicates that a component field is imported from other components. This means it doesn't actually exist. */
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
|
||||
@@ -118,7 +118,7 @@ public class EntityIO{
|
||||
}
|
||||
}
|
||||
|
||||
void writeSync(MethodSpec.Builder method, boolean write, Seq<Svar> syncFields, Seq<Svar> allFields) throws Exception{
|
||||
void writeSync(MethodSpec.Builder method, boolean write, Seq<Svar> allFields) throws Exception{
|
||||
this.method = method;
|
||||
this.write = write;
|
||||
|
||||
@@ -138,6 +138,7 @@ public class EntityIO{
|
||||
//add code for reading revision
|
||||
for(RevisionField field : rev.fields){
|
||||
Svar var = allFields.find(s -> s.name().equals(field.name));
|
||||
if(var == null || var.has(NoSync.class)) continue;
|
||||
boolean sf = var.has(SyncField.class), sl = var.has(SyncLocal.class);
|
||||
|
||||
if(sl) cont("if(!islocal)");
|
||||
|
||||
@@ -490,7 +490,7 @@ public class EntityProcess extends BaseProcessor{
|
||||
|
||||
//SPECIAL CASE: sync I/O code
|
||||
if((first.name().equals("readSync") || first.name().equals("writeSync"))){
|
||||
io.writeSync(mbuilder, first.name().equals("writeSync"), syncedFields, allFields);
|
||||
io.writeSync(mbuilder, first.name().equals("writeSync"), allFields);
|
||||
}
|
||||
|
||||
//SPECIAL CASE: sync I/O code for writing to/from a manual buffer
|
||||
|
||||
Reference in New Issue
Block a user