| 1375 | } |
| 1376 | |
| 1377 | NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_CHAT(Packet &p) |
| 1378 | { |
| 1379 | if (this->status < STATUS_PRE_ACTIVE) { |
| 1380 | /* Illegal call, return error and ignore the packet */ |
| 1381 | return this->SendError(NETWORK_ERROR_NOT_AUTHORIZED); |
| 1382 | } |
| 1383 | |
| 1384 | NetworkAction action = (NetworkAction)p.Recv_uint8(); |
| 1385 | DestType desttype = (DestType)p.Recv_uint8(); |
| 1386 | int dest = p.Recv_uint32(); |
| 1387 | |
| 1388 | Debug(net, 9, "client[{}] Receive_CLIENT_CHAT(): action={}, desttype={}, dest={}", this->client_id, action, desttype, dest); |
| 1389 | |
| 1390 | std::string msg = p.Recv_string(NETWORK_CHAT_LENGTH); |
| 1391 | int64_t data = p.Recv_uint64(); |
| 1392 | |
| 1393 | NetworkClientInfo *ci = this->GetInfo(); |
| 1394 | switch (action) { |
| 1395 | case NETWORK_ACTION_CHAT: |
| 1396 | case NETWORK_ACTION_CHAT_CLIENT: |
| 1397 | case NETWORK_ACTION_CHAT_COMPANY: |
| 1398 | NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data); |
| 1399 | break; |
| 1400 | default: |
| 1401 | IConsolePrint(CC_WARNING, "Kicking client #{} (IP: {}) due to unknown chact action.", ci->client_id, this->GetClientIP()); |
| 1402 | return this->SendError(NETWORK_ERROR_NOT_EXPECTED); |
| 1403 | } |
| 1404 | return NETWORK_RECV_STATUS_OKAY; |
| 1405 | } |
| 1406 | |
| 1407 | NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_SET_NAME(Packet &p) |
| 1408 | { |
nothing calls this directly
no test coverage detected