hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?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;
}