DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CameraTools.c
См. документацию.
1#ifdef DIAG_DEVELOPER
2class CameraToolsMenuServer
3{
4 ref array<Man> m_Subscribers = new array<Man>;
5 void OnRPC(int rpc_type, ParamsReadContext ctx)
6 {
7 switch (rpc_type)
8 {
9 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
10 {
11 Param4<vector, vector,float,float> p4 = new Param4<vector, vector,float,float>(vector.Zero, vector.Zero,0,0);
12 if (ctx.Read(p4))
13 {
14 foreach (int index, Man p : m_Subscribers)
15 {
16 if (p)
17 {
18 GetGame().RPCSingleParam(p, ERPCs.DIAG_CAMERATOOLS_CAM_DATA, p4, true, p.GetIdentity());
19 }
20 else
21 {
22 m_Subscribers.Remove(index);
23 }
24 }
25 }
26 break;
27 }
28 case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
29 {
30 Param2<bool, Man> par2 = new Param2<bool, Man>(false,null);
31
32 if (ctx.Read(par2))
33 {
34 bool enable = par2.param1;
35 Man player = par2.param2;
36
37 bool found = false;
38 foreach (int i, Man m : m_Subscribers)
39 {
40 if (m == player)
41 {
42 if (!enable)
43 {
44 m_Subscribers.Remove(i);
45 return;
46 }
47 found = true;
48 m_Subscribers[i] = player;
49 }
50 }
51 if (!found && enable)//not found in the array, insert it
52 {
53 m_Subscribers.Insert(player);
54 }
55 }
56 break;
57 }
58 }
59 }
60};
61
62class CameraToolsMenuClient
63{
64 Shape m_DebugShape = null;
65
66 void ~CameraToolsMenuClient()
67 {
68 if (m_DebugShape)
69 {
70 m_DebugShape.Destroy();
71 }
72 }
73
74 void DelayedDestroy()
75 {
76 GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( DestroyNow, 2000);
77 }
78
79 void DestroyNow()
80 {
81 delete this;
82 }
83
84 void OnRPC(ParamsReadContext ctx)
85 {
86 if (m_DebugShape)
87 {
88 m_DebugShape.Destroy();
89 m_DebugShape = null;
90 }
91
92 Param4<vector, vector,float,float> p4 = new Param4<vector, vector,float,float>(vector.Zero, vector.Zero,0,0);
93 if ( ctx.Read( p4 ) )
94 {
95 vector pos = p4.param1;
96 vector dir = p4.param2;
97 float plane = p4.param3;
98 float fov = p4.param4 * Math.RAD2DEG;
99
100
101 m_DebugShape = Debug.DrawFrustum(fov, 30, 0.5);
102 vector mat[4];
103 Math3D.DirectionAndUpMatrix(dir,vector.Up,mat);
104 mat[3] = pos;
105 m_DebugShape.SetMatrix(mat);
106
107 }
108 }
109};
110#endif
Shape m_DebugShape
Определения BleedingSource.c:16
ERPCs
Определения ERPCs.c:2
override void OnRPC(ParamsReadContext ctx)
Определения PlayerStatBase.c:69
void Debug()
Определения UniversalTemperatureSource.c:349
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Read(void value_in)
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8