DayZ 1.24
Loading...
Searching...
No Matches
MessageReceiverBase.c
Go to the documentation of this file.
2{
3 // message system
4 PluginMessageManager m_ModuleMessageManager;
5 string m_System;
6
7 void OnReceive(int channel) {}
8 void OnReceiveInt(int channel, int value) {}
9 void OnReceiveFloat(int channel, float value) {}
10 void OnReceiveString(int channel, string value) {}
13
15 {
16 m_ModuleMessageManager = PluginMessageManager.Cast(GetPlugin(PluginMessageManager));
17 }
18
20 {
21 m_ModuleMessageManager.Subscribe(this, channel);
22 }
23
25 {
27 }
28
30 {
31 if (IsPluginManagerExists()) m_ModuleMessageManager.UnsubscribeAll(this);
32 }
33
35 {
37 }
38
39 void BroadcastInt(int channel, int value)
40 {
42 }
43
44 void BroadcastFloat(int channel, float value)
45 {
46 m_ModuleMessageManager.BroadcastFloat(channel, value);
47 }
48
49 void BroadcastString(int channel, string value)
50 {
51 m_ModuleMessageManager.BroadcastString(channel, value);
52 }
53
55 {
56 m_ModuleMessageManager.BroadcastParam(channel, params);
57 }
58
59 //Messaging system
60 void Log(string message)
61 {
63 }
64
65}
PluginBase GetPlugin(typename plugin_type)
bool IsPluginManagerExists()
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133
void OnReceive(int channel)
PluginMessageManager m_ModuleMessageManager
void OnReceiveString(int channel, string value)
void Broadcast(int channel)
void OnReceiveInt(int channel, int value)
void Log(string message)
void BroadcastInt(int channel, int value)
void BroadcastFloat(int channel, float value)
void Subscribe(int channel)
void BroadcastString(int channel, string value)
void OnReceiveParam(int channel, Param params)
This method is called when an object inheriting from this class subscribes to a channel,...
void OnReceiveFloat(int channel, float value)
void BroadcastParam(int channel, Param params)
void Unsubscribe(int channel)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12