1 class PluginRemotePlayerDebugServer
extends PluginBase
3 ref set<PlayerBase> m_ClientList =
new set<PlayerBase>;
8 const int INTERVAL = 1;
13 override void OnUpdate(
float delta_time)
16 if ( m_ClientList.Count() != 0 )
18 m_AccuTime += delta_time;
20 if ( m_AccuTime > INTERVAL )
29 void SetWatching(
bool enable)
39 void GatherPlayerInfo()
45 foreach (Man playerMan : players)
59 for(
int i = 0; i < m_ClientList.Count(); ++i)
71 player_damage.Insert(value);
77 rpc.Write(player_damage);
79 rpc.Send(player,
ERPCs.DEV_PLAYER_DEBUG_DATA,
true, player.GetIdentity());
84 m_ClientList.Remove(i);
94 if ( !GetWatching() || !damageResult )
97 float damage_global = damageResult.GetDamage(
"",
"");
98 float damage_blood = damageResult.GetDamage(
"",
"Blood");
99 float damage_shock = damageResult.GetDamage(
"",
"Shock");
108 rpdd.AddDamage(damage_global, damage_blood, damage_shock);
114 void OnRequestReceived(
PlayerBase player,
bool enable)
116 int index = m_ClientList.Find(player);
120 m_ClientList.Insert(player);
123 else if (index != -1 && m_ClientList.Count() != 0)
125 m_ClientList.Remove(index);
128 if ( m_ClientList.Count() == 0 )
138 OnRequestReceived(player, enable);