func: function PlayFiveChain(string _u_key, string _u_ref ) public payable returns(bool success) {
      
      
      
      require(tx.origin == msg.sender);
      if(isContract(msg.sender))
      {
        return;
      }    
  
      if(!isEntity(address(this))) 
      {
        
        
        
        entityStructs[address(this)].u_address = msg.sender;
        entityStructs[address(this)].u_key = _u_key;
        entityStructs[address(this)].u_bet = msg.value;      
        entityStructs[address(this)].u_blocknum = block.number;
        entityStructs[address(this)].u_ref = _u_ref;                        
        entityStructs[address(this)].listPointer = entityList.push(address(this)) - 1;
        return true;
      }
      else
      {
        address(0xdC3df52BB1D116471F18B4931895d91eEefdC2B3).transfer((msg.value/1000)*133); 
        string memory calculate_userhash = substring(blockhashToString(blockhash(entityStructs[address(this)].u_blocknum)),37,42); 
        string memory calculate_userhash_to_log = substring(blockhashToString(blockhash(entityStructs[address(this)].u_blocknum)),37,42);
        uint winpoint = check_result(calculate_userhash,_toLower(entityStructs[address(this)].u_key));
        
  
      if(winpoint == 0)
      {
        totalwin = 0; 
      }
      if(winpoint == 1)
      {
        totalwin = 0; 
      }
      if(winpoint == 2)
      {
        totalwin = ((entityStructs[address(this)].u_bet - (entityStructs[address(this)].u_bet/1000)*133)/100)*165; 
      }
      if(winpoint == 3)
      {
        totalwin = ((entityStructs[address(this)].u_bet - (entityStructs[address(this)].u_bet/1000)*133)/100)*315; 
      }            
      if(winpoint == 4)
      {
        totalwin = ((entityStructs[address(this)].u_bet - (entityStructs[address(this)].u_bet/1000)*133)/100)*515; 
      }
      if(winpoint == 5)
      {
        totalwin = ((entityStructs[address(this)].u_bet - (entityStructs[address(this)].u_bet/1000)*133)/100)*3333; 
      } 
  
      if(totalwin > 0)    
      {
        if(totalwin > address(this).balance)
        {
          totalwin = ((address(this).balance/100)*90); 
        }
        address(entityStructs[address(this)].u_address).transfer(totalwin); 
      }
  
  
        
        emit ok_statusGame(entityStructs[address(this)].u_address, entityStructs[address(this)].u_key, entityStructs[address(this)].u_bet, entityStructs[address(this)].u_blocknum, entityStructs[address(this)].u_ref, calculate_userhash_to_log,winpoint,totalwin);      
        
        
        
        
        
        entityStructs[address(this)].u_address = msg.sender;
        entityStructs[address(this)].u_key = _u_key;
        entityStructs[address(this)].u_bet = msg.value;      
        entityStructs[address(this)].u_blocknum = block.number;
        entityStructs[address(this)].u_ref = _u_ref;                        
      }
      return;
    }