| <?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( '½áÊø´¦Àí..' ); | 
| ?> |