DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ Add()

void Chat::Add ( ChatMessageEventParams params)
inlineprotected

См. определение в файле Chat.c строка 68

69 {
70 int max_lenght = ChatMaxUserLength;
71 int name_lenght = params.param2.Length();
72 int text_lenght = params.param3.Length();
73 int total_lenght = text_lenght + name_lenght;
74 int channel = params.param1;
75
76 if( channel & CCSystem || channel & CCBattlEye) //TODO separate battleye bellow
77 {
78 if( g_Game.GetProfileOption( EDayZProfilesOptions.GAME_MESSAGES ) )
79 return;
80
81 max_lenght = ChatMaxSystemLength; // system messages can be longer
82 }
83 //TODO add battleye filter to options
84 /*else if( channel & CCBattlEye )
85 {
86 if( g_Game.GetProfileOption( EDayZProfilesOptions.BATTLEYE_MESSAGES ) )
87 return;
88 }*/
89 else if( channel & CCAdmin )
90 {
91 if( g_Game.GetProfileOption( EDayZProfilesOptions.ADMIN_MESSAGES ) )
92 return;
93 }
94 else if( channel & CCDirect || channel & CCMegaphone || channel & CCTransmitter || channel & CCPublicAddressSystem )
95 {
96 if( g_Game.GetProfileOption( EDayZProfilesOptions.PLAYER_MESSAGES ) )
97 return;
98 }
99 else if( channel != 0 ) // 0 should be local messages to self
100 {
101 Print("Chat: Unknown channel " + channel);
102 return;
103 }
104
105 if (total_lenght > max_lenght)
106 {
107 int pos = 0;
108 int lenght = Math.Clamp(max_lenght - name_lenght, 0, text_lenght);
109 ref ChatMessageEventParams tmp = new ChatMessageEventParams(params.param1, params.param2, "", params.param4);
110
111 while (pos < text_lenght)
112 {
113 tmp.param3 = params.param3.Substring(pos, lenght);
114 AddInternal(tmp);
115
116 tmp.param2 = "";
117 pos += lenght;
118 lenght = Math.Clamp(text_lenght - pos, 0, max_lenght);
119 }
120 }
121 else
122 {
123 AddInternal(params);
124 }
125 }
DayZGame g_Game
Определения DayZGame.c:3868
EDayZProfilesOptions
Определения EDayZProfilesOptions.c:2
void AddInternal(ChatMessageEventParams params)
Определения Chat.c:127
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Определения gameplay.c:407
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки AddInternal(), Math::Clamp(), g_Game и Print().