<?php
|
include_once '/Common/CommFunc.php';
|
include_once '/Common/Logging.php';
|
include_once "/db/DBOper.php";
|
include_once "/db/RedisOper.php";
|
|
header("Content-type: text/html; charset=utf-8");
|
|
\Logging\CreateLogging("center.eventreport.php");
|
|
// 2022-05-09T19:17:47 DEBUG Version=
|
// 2022-05-09T19:17:47 DEBUG DeviceFlag=
|
// 2022-05-09T19:17:47 DEBUG SessionID=c8b996d5ffdc71139b1d4bc22874b2f8
|
// 2022-05-09T19:17:47 DEBUG EventID=1100
|
// 2022-05-09T19:17:47 DEBUG ProductID=xbqy
|
// 2022-05-09T19:17:47 DEBUG OperatorID=test
|
// 2022-05-09T19:17:47 DEBUG RegionName=s86
|
// 2022-05-09T19:17:47 DEBUG Time=2022-05-09 19:17:47
|
// 2022-05-09T19:17:47 DEBUG AccountID=yn1233
|
// 2022-05-09T19:17:47 DEBUG PlayerID=280104
|
// 2022-05-09T19:17:47 DEBUG RoleID=ĐạmDiệuHải
|
// 2022-05-09T19:17:47 DEBUG Level=400
|
// 2022-05-09T19:17:47 DEBUG Job=1
|
// 2022-05-09T19:17:47 DEBUG IP=192.168.1.1
|
|
$EventID = $_GET["EventID"];
|
$GameName = $_GET["ProductID"];
|
$Channel = $_GET["OperatorID"];
|
$RegionName = $_GET["RegionName"];
|
$Time = $_GET["Time"];
|
|
\Logging\LogInfo(" _GET:" . print_r($_GET, true));
|
|
if (
|
!$EventID || !$Channel || !$RegionName || !$Time || !$GameName || $GameName != \CommFunc\GetGameName()
|
) {
|
Response(1000, "param error");
|
exit;
|
}
|
|
$ok = false;
|
switch ($EventID) {
|
// 聊天汇报
|
case 9003:
|
$ok = EventReport_Chat();
|
break;
|
// bug反馈
|
case 9002:
|
$ok = EventReport_BugReport();
|
break;
|
|
default:
|
Response(1001, "unknown eventID -> " . $EventID);
|
exit;
|
}
|
if ($ok) {
|
Response();
|
}
|
exit;
|
|
function Response($errorcode = 0, $errormsg = "ok")
|
{
|
$ret = array("errorcode" => $errorcode, "errormsg" => $errormsg);
|
if ($errorcode != 0) {
|
\Logging\LogError($errormsg . " _GET:" . print_r($_GET, true) . " ret:" . print_r($ret, true));
|
}
|
echo \CommFunc\MyJson_encode($ret);
|
}
|
|
function EventReport_Chat()
|
{
|
global $GameName, $Channel;
|
$redisKey = \RedisOper\GetFCRedisKey($GameName, "Chatmonitor", $Channel);
|
$count = \RedisOper\ListPush($redisKey, "R", $_GET); // 插入表尾
|
\CommFunc\GetConfig("Chatmonitor", "CacheChatCount", $maxCount);
|
if ($count > $maxCount) {
|
\RedisOper\ListPop($redisKey, $ret, "L"); // 移除最早一个
|
}
|
return true;
|
}
|
|
function EventReport_BugReport()
|
{
|
$insArray = $_GET;
|
unset($insArray["EventID"]);
|
unset($insArray["ProductID"]);
|
unset($insArray["OperatorID"]);
|
$insArray["Channel"] = $_GET["OperatorID"];
|
if (!\DBOper\Insert("EventReportBug", $insArray)) {
|
return;
|
};
|
return true;
|
}
|