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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
 
#´´½¨ÈÕÆÚ£º2012-5-15 ÏÂÎç4:26:32
#×÷Õߣºzhouliang
include_once '/Common/Logging.php';
include_once '/ProjComm/CommonOperate.php';
include_once '/Common/CommFunc.php';
include_once '/Common/BufferOperate.php';
include_once '/Common/MongoCommon.php';
 
 
\Logging\CreateLogging( 'EventTool' );
 
\Logging\LogInfo( '¿ªÊ¼´¦Àí...' );
 
if (\CommFunc\GetIP() != "119.146.200.105")
{
    \Logging\LogInfo( "ip:".\CommFunc\GetIP() );
    exit();
}
if( !\CommFunc\CheckPostParam("pack", '{"ErrorNo":"1","ErrorStr":"Param pack error"}') )
{
    exit();
}
 
if( !\CommFunc\CheckPostParam("sign", '{"ErrorNo":"2","ErrorStr":"Param sign error"}') )
{
    exit();
}
 
$arrayPack = json_decode( $_POST['pack'] , true );
 
\Logging\LogInfo( "json_decodeµÄ½á¹ûÊÇ".var_export( $arrayPack, True ) );
 
 
//¿ÉÒÔÖ±½Ó´¦Àí
#¿ªÊ¼Á¬½ÓÊý¾Ý¿â
$dbOpt=new \MongoCommon\MongoDBOpt( '..\\InterfaceConfig.php', "ServerName" , "EventDBName");
 
if( !$dbOpt->Init() )
{
    #echo 'Êý¾Ý¿â³õʼ»¯Ê§°Ü!Ô­Òò:'.$dbOpt->GetLastError().'Çë¼ì²éÅäÖÃ';
    $resultjson['status'] = -2;
    echo json_encode($resultjson);
    exit;
}
 
//\Logging\LogInfo( 'eventtoolÁ¬½ÓÊý¾Ý¿â³É¹¦.' );
 
$skip=0;
$perPage=20;
$sortarr= array();
#²éÕÒÕ˺ÅÊÇ·ñÓÐÕË»§¿ÉÒÔʹÓÃ
/*
if($arrayPack['pack_type'] == "GMTServer_Horse")
{
 
    $findArray=array('PlayerName'=>$arrayPack["name"]);
 
    $dbName = "tagHorseSJRecord";
    $sortarr = array("afterclasslv"=>-1,"afterstarlv"=>-1,'afterexp'=>-1);
}
else if ($arrayPack['pack_type'] == "GMTServer_Wing")
{
    $findArray=array('PlayerName'=>$arrayPack["name"]);
 
    $dbName = "tagWingSJRecord";
    $sortarr = array("afterclasslv"=>-1, 'afterexp'=>-1);
}
*/
$findArray=json_decode($arrayPack["finder"], true);
 
if (isset($findArray["itemName"]) and $findArray["itemName"])
{
    $findArray["itemName"] = new MongoRegex("/.*".urldecode($findArray["itemName"]).".*/i");
}
 
$dbName = $arrayPack["tableName"];
$sortarr = json_decode($arrayPack["sorter"], true);
 
 
$skip=0;
$perPage=20;
if(isset($arrayPack["skip"]))
{
    $skip=$arrayPack["skip"];
}
 
if(isset($arrayPack["perPage"]))
{
    $perPage=$arrayPack["perPage"];
}
 
//²éÑ¯Íæ¼Ò±í
$resuntCnt = $dbOpt->GetDataCount($dbName, $findArray);
if ($resuntCnt == 0)
{
    echo json_encode(array("ResultType"=>101));
    exit();
}
 
$retArray;
$result = $dbOpt->GetData($dbName, $findArray, $retArray,array(), $skip, $perPage,$sortarr);
 
//{"ResultType": 0, "ResultMsg": {"forbidTalk": false, "forbidLogin": false}, "pack_type": "GMT_GetPlayerForbid"}
if($result)
{
    echo json_encode(array("ResultType"=>0, "ResultMsg"=>$retArray, "totalCnt"=>$resuntCnt));
    //\Logging\LogInfo( 'Êý¾Ý¿âÖ±½Ó²éѯ½á¹û'.print_r($retArray, true) );
}
else
{
    echo json_encode(array("ResultType"=>103));
}
 
 
\Logging\LogInfo( '½áÊø´¦Àí..' );
?>