| 2952 | } |
| 2953 | |
| 2954 | void NetworkBase::ServerHandleChat(Connection& connection, Packet& packet) |
| 2955 | { |
| 2956 | auto szText = packet.readString(); |
| 2957 | if (szText.empty()) |
| 2958 | return; |
| 2959 | |
| 2960 | if (connection.player != nullptr) |
| 2961 | { |
| 2962 | NetworkGroup* group = GetGroupByID(connection.player->group); |
| 2963 | if (group == nullptr || !group->canPerformAction(Permission::chat)) |
| 2964 | { |
| 2965 | return; |
| 2966 | } |
| 2967 | } |
| 2968 | |
| 2969 | std::string text(szText); |
| 2970 | if (connection.player != nullptr) |
| 2971 | { |
| 2972 | if (!ProcessChatMessagePluginHooks(connection.player->id, text)) |
| 2973 | { |
| 2974 | // Message not to be relayed |
| 2975 | return; |
| 2976 | } |
| 2977 | } |
| 2978 | |
| 2979 | const char* formatted = FormatChat(connection.player, text.c_str()); |
| 2980 | ChatAddHistory(formatted); |
| 2981 | ServerSendChat(formatted); |
| 2982 | } |
| 2983 | |
| 2984 | void NetworkBase::Client_Handle_GAME_ACTION([[maybe_unused]] Connection& connection, Packet& packet) |
| 2985 | { |
nothing calls this directly
no test coverage detected