LogStorageService

Records and retrieves information. The function does not work in the World being created.

# Methods

[{"index":"void GetPurchaseLogPagesAsync(DateTime fromDate, DateTime toDate, func callbackFunction) (ServerOnly) (ReleaseOnly)","0":"Retrieves the world's product purchase record. You can specify the date range of the purchase record to be imported by including the fromDate and toDate information. This operation is performed asynchronously. The function passed to the callbackFunction is called once the operation is complete. The callbackFunction's parameter is the purchase record imported. This feature does not work in the world being created. This is a provisional function and is not recommended for use."}]

[{"index":"void LogPurchaseInfo(WorldShopPurchaseInfo purchaseInfo, string message) (ServerOnly) (ReleaseOnly)","0":"Records purchase information. Does not work in the Maker environment."}]

##### inherited from Service:

[{"index":"EventHandlerBase ConnectEvent(string key, IScriptFunction eventHandler)","0":"Links events. When a key-type event occurs in this service, a handler is notified. The handler receives event parameters."}]

[{"index":"EventHandlerBase ConnectEvent(Type eventType, IScriptFunction eventHandler)","0":"Links events. This service notifies a handler when an eventType event occurs. The handler receives event parameters."}]

[{"index":"boolean DisconnectEvent(string key, EventHandlerBase eventHandler)","0":"Disconnects the event with the key-type event and the handler."}]

[{"index":"boolean DisconnectEvent(Type eventType, EventHandlerBase eventHandler)","0":"Disconnects the eventType event from its handler."}]

[{"index":"void SendEvent(EventType sendEvent)","0":"Generates an event."}]

# Examples

#### LogPurchaseInfo

This is an example of recording purchase information.
    
    
    @Component
    script ShopPurchaseHandler extends Component
        @ExecSpace("ServerOnly")
        method void OnBeginPlay()
            local processPurchase = function(purchaseInfo)
            	_LogStorageService:LogPurchaseInfo(purchaseInfo, "Item purchase completed")
            	return true
            end
            
            _WorldShopService:SetProcessPurchaseCallback(processPurchase)
        end
    end
    

#### GetPurchaseLogPagesAsync

This is an example of inquiring about purchase information.
    
    
    @Component
    script PurchaseLogRetriever extends Component
        @ExecSpace("ServerOnly")
        method void OnBeginPlay()
            local fromDate = DateTime(2023, 11, 25)
            local toDate = DateTime(2023, 11, 30)
            
            local onComplete = function(purchaseLogPages)
            
            	while true do
            		local purchaseLogs = purchaseLogPages:GetCurrentPageDatas()
            
            		for index, purchaseLog in ipairs(purchaseLogs) do
            			log(purchaseLog)
            		end
            
            		if purchaseLogPages.IsLastPage == true then
            			break
            		end
            
            		purchaseLogPages:MoveToNextPageAndWait()
            	end
            end
            
            _LogStorageService:GetPurchaseLogPagesAsync(fromDate, toDate, onComplete)
        end
    end
    

# SeeAlso

  * DateTime
  * WorldShopService