1 [
ComponentEditorProps(
category:
"GameScripted/Editor", description:
"Transmitting info about dedicated server. Works only with SCR_EditorBaseEntity!", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
7 [
Attribute(
"1",
desc:
"How often is info about serevr broadcasted.")]
8 protected float m_fInterval;
10 protected ref ScriptInvoker m_OnReceive =
new ScriptInvoker();;
12 ScriptInvoker GetOnReceive()
17 protected void Transmit()
19 int fps = System.GetFPS();
20 int memoryKB = System.MemoryAllocationKB();
21 int tickCount = System.GetTickCount();
23 Rpc(Receive, fps, memoryKB, tickCount);
25 [
RplRpc(RplChannel.Unreliable, RplRcver.Owner)]
26 protected void Receive(
int fps,
int memoryKB,
int tickCount)
28 m_OnReceive.Invoke(fps, memoryKB, tickCount);
31 override protected void EOnEditorActivateServer()
33 GetGame().GetCallqueue().CallLater(Transmit, m_fInterval * 1000,
true);
35 override protected void EOnEditorDeactivateServer()
37 GetGame().GetCallqueue().Remove(Transmit);