| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
|   | 
| ##@package GY_Query_SetItemUnLock  | 
| # ½â·âÎïÆ·  | 
| #  | 
| # @author mark  | 
| # @date 2010-3-31  | 
| # @version 1.1  | 
| #  | 
| # @change: "2012-05-16 15:00" jiang C++Ð޸ĽӿÚGameServer_QueryPlayerByIDºÍGameServer_QueryPlayerResult  | 
| #  | 
| #------------------------------------------------------------------------------   | 
| """Version = 2012-05-16 15:00"""  | 
| #------------------------------------------------------------------------------   | 
| #µ¼Èë  | 
| import GameWorld  | 
| import ChConfig  | 
| #---------------------------------------------------------------------  | 
| #È«¾Ö±äÁ¿  | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
| #Â߼ʵÏÖ  | 
| ## ÇëÇóÂß¼  | 
| #  @param query_Type ÇëÇóÀàÐÍ  | 
| #  @param query_ID ÇëÇóµÄÍæ¼ÒID  | 
| #  @param packCMDList ·¢°üÃüÁî [ ]  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return "" or None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def DoLogic(query_Type , query_ID , packCMDList , tick):  | 
|     curFindPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)  | 
|       | 
|     if not curFindPlayer or curFindPlayer.IsEmpty():  | 
|         return ''  | 
|       | 
|     #²ÎÊýΪ ±³°üID£¬±³°üË÷Òý£¬ÎïÆ·GUID£¬ÎïÆ·Ë÷Òý  | 
|     #packCMDList = [packID , packIndex , itemGUID , cmdIndex]  | 
|     curItem = curFindPlayer.GetItemManager().GetPack( int( packCMDList[0] ) ).GetAt( int( packCMDList[1] ) )  | 
|       | 
|     reslut = __DoLogic_ItemLock( curItem , str( packCMDList[2] ) )  | 
|       | 
|     sendMsg = '%s'%(reslut)  | 
|     curFindPlayer.GameServer_QueryPlayerByID( ChConfig.queryType_sqtDataServer_GMCommand ,   | 
|                               int( packCMDList[3] ), 'SetItemUnLock', sendMsg, len(sendMsg))  | 
|     return  | 
|   | 
| ## Ëø¶¨ÎïÆ·  | 
| #  @param curItem µ±Ç°ÎïÆ·  | 
| #  @param itemGUID ÎïÆ·ID  | 
| #  @return str  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def __DoLogic_ItemLock( curItem , itemGUID ):  | 
|     if not curItem or curItem.IsEmpty():  | 
|         return 'NoItem'  | 
|       | 
|     if curItem.GetGUID() != itemGUID:  | 
|         return 'NoGUID'  | 
|       | 
|     if not curItem.GetIsLocked():  | 
|         return 'IsUnLocked'  | 
|       | 
|     curItem.SetIsLocked( False )  | 
|     return 'True'  | 
| #---------------------------------------------------------------------  | 
| #Ö´Ðнá¹û  | 
| ## Ö´Ðнá¹û  | 
| #  @param curPlayer ·¢³öÇëÇóµÄÍæ¼Ò  | 
| #  @param callFunName ¹¦ÄÜÃû³Æ  | 
| #  @param funResult ²éѯµÄ½á¹û  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def DoResult(curPlayer , callFunName , funResult , tick):  | 
|     return  |