Skip to content

Commit 25db985

Browse files
committed
fixed:客户端插件的properFlags一直为0
kbengine/kbengine#399
1 parent a667a9f commit 25db985

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Entity.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public Entity()
6060
newp.name = e.name;
6161
newp.utype = e.utype;
6262
newp.properUtype = e.properUtype;
63+
newp.properFlags = e.properFlags;
6364
newp.aliasID = e.aliasID;
6465
newp.defaultValStr = e.defaultValStr;
6566
newp.setmethod = e.setmethod;
@@ -149,7 +150,9 @@ public virtual void callPropertysSetMethods()
149150
{
150151
if(inWorld)
151152
{
152-
//Dbg.DEBUG_MSG(className + "::callPropertysSetMethods(" + prop.name + ")");
153+
if(prop.isOwnerOnly() && id != KBEngineApp.app.entity_id)
154+
continue;
155+
153156
setmethod.Invoke(this, new object[]{oldval});
154157
}
155158
}

Property.cs

+12
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ public bool isBase()
4343
return properFlags == (UInt32)EntityDataFlags.ED_FLAG_BASE_AND_CLIENT ||
4444
properFlags == (UInt32)EntityDataFlags.ED_FLAG_BASE;
4545
}
46+
47+
public bool isOwnerOnly()
48+
{
49+
return properFlags == (UInt32)EntityDataFlags.ED_FLAG_CELL_PUBLIC_AND_OWN ||
50+
properFlags == (UInt32)EntityDataFlags.ED_FLAG_OWN_CLIENT;
51+
}
52+
53+
public bool isOtherOnly()
54+
{
55+
return properFlags == (UInt32)EntityDataFlags.ED_FLAG_OTHER_CLIENTS ||
56+
properFlags == (UInt32)EntityDataFlags.ED_FLAG_OTHER_CLIENTS;
57+
}
4658
}
4759

4860
}

0 commit comments

Comments
 (0)