1 [
ComponentEditorProps(
category:
"GameScripted/Test", description:
"Test component showcasing doing the replication from script the RIGHT way")]
15 [
RplProp(condition: RplCondition.NoOwner, onRplName:
"OnTestChanged")]
25 Print(
"RPC TestRpc EXECUTED: " + testNum, LogLevel.NORMAL);
31 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
48 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
51 Print(
"RPC NetTestRpc EXECUTED: " + testNum, LogLevel.NORMAL);
57 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
68 m_iTest = Math.RandomIntInclusive(0, 100);
70 Print(
"RPLPROP m_iTest CHANGED on SERVER: " +
m_iTest, LogLevel.NORMAL);
78 Print(
"RPLPROP m_iTest CHANGED on CLIENT: " +
m_iTest, LogLevel.NORMAL);
85 Print(
"RPC TestFire EXECUTED", LogLevel.NORMAL);
90 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
114 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast, RplCondition.NoOwner)]
123 super.OnPostInit(owner);
124 SetEventMask(owner, EntityEvent.FRAME | EntityEvent.INIT);
125 owner.SetFlags(EntityFlags.ACTIVE,
false);
137 override void EOnFrame(IEntity owner,
float timeSlice)
139 if (Debug.KeyState(KeyCode.KC_P))
141 Debug.ClearKey(KeyCode.KC_P);
142 int rndRPCNum = Math.RandomIntInclusive(0, 100);
144 Print(
"Requesting TestRpc: " + rndRPCNum, LogLevel.NORMAL);