:DitoLand
Studio ManualAPI ReferenceVideo TutorialSample
  • DitoLand Developer
  • 📚Glossary
  • 🥳EVENT
    • 2024 메타버스 개발자 경진대회
    • 🎊[종료] 🖥 전남관광메타버스 스탬프 투어 인증 이벤트
  • Notice
    • 약관 개정(2024.06.17)
    • 약관 개정 (2024.03.04)
    • 약관 개정 (2023.08.25)
    • 약관 개정 (2022.12.14)
  • Manual
    • Studio
    • Resources
    • Studio Workflow Tips
    • NPC
    • NavMeshVolume
    • Land Teleport
    • Enterprise Account
    • Enterprise Studio Manual
    • Coroutine
    • AddTimeEvent
    • SaveUserData
    • Set Object Parameter
    • Toolbox Upload
    • Debugging (Breakpoint)
    • Gun Toy
    • Coupon / Event Key
    • Optimization
    • AI FSM
    • SpreadSheet
    • Mod Kit
    • AddReplicateValue / ConnectChangeEventFunction
    • Event Execution Order
    • WorldTree Search Filter
    • Object
    • Coordinate
    • Inworld Product
    • Management UserData & Leaderboard
    • Channel
    • World Event
    • Matchmaking
    • Collecting Game Logs
    • External Avatar
  • Coding Style
  • API Reference
    • Global
      • Variables
    • Lua
      • Built-in
      • NotSupport
    • Enums
      • AttachPoint
      • Bone
      • CharacterType
      • ChatCategoryType
      • ChatVisibleType
      • CollisionResponse
      • ControlMode
      • DivideTeamType
      • EventKeyState
      • InputMode
      • InventoryState
      • Key
      • KeyInputType
      • LuckyDrawOrderState
      • MaterialType
      • MediaStateType
      • ModeAnimStateType
      • ObjectSelectType
      • ObjectType
      • PathFollowingStatus
      • PointSpawnType
      • ProgressFillType
      • ProjectionType
      • QuickSlotState
      • ReplicateType
      • ScrollOrientationType
      • SimulatePhysicsType
      • SpawnType
      • TeamType
      • TeleportErrorType
      • TouchType
      • TransformPlayType
      • UIDisplayType
      • UIWidgetType
      • WidgetAnchorType
    • Common
      • BindEvent
      • Character
      • Collision
      • Color
      • CouponReturnData
      • DateTime
      • Environment
      • EventKeyReturnData
      • FactorPhysics
      • FiniteState
      • FiniteStateMachine
      • Game
      • GameStatisticsData
      • HitResult
      • Item
      • LandTransferData
      • Matrix
      • MouseHitResult
      • Object
      • Physics
      • ScriptPhase
      • TimeEvent
      • Track
      • Vector
      • WorldObject
    • Client
      • AnimStateBase
      • AnimStateMachine
      • AnimStateMachineSetting
      • BlendAnimationDataSetting
      • BlendAnimState
      • BlendAnimStateSetting
      • Button
      • Camera
      • CameraClient
      • Character
      • CharacterAnimationSetting
      • CharacterAppearanceSetting
      • CharacterBaseSetting
      • CharacterClient
      • CharacterSetting
      • Collider
      • Collision
      • DPad
      • Environment
      • FiniteStateMachine
      • Frame
      • FX
      • Game
      • GridBox
      • HyperLinkButton
      • Image
      • Input
      • InputGroup
      • InventoryBox
      • Item
      • ListView
      • LocalPlayer
      • Media
      • MediaView
      • NPC
      • ObjectGroup
      • ObjectNoneClient
      • PDFView
      • Physics
      • PointLight
      • ProgressBar
      • RemotePlayer
      • ScreenButton
      • ScreenUI
      • Script
      • ScrollBox
      • SequenceAnimState
      • SequenceAnimStateSetting
      • Sound
      • SpotLight
      • StaticMesh
      • SurfaceUI
      • Text
      • TextBox
      • UIScene
      • WebBrowser
      • WebForum
      • WidgetBase
      • YouTubeView
    • Server
      • Character
      • CharacterAnimationSetting
      • CharacterAppearanceSetting
      • CharacterBaseSetting
      • CharacterServer
      • CharacterSetting
      • Collider
      • Collision
      • Environment
      • FactorPhysics
      • FiniteStateMachine
      • FX
      • Game
      • Item
      • Media
      • NPC
      • Physics
      • Player
      • PointLight
      • Script
      • ScriptObjectGroup
      • ScriptObjectNoneServer
      • Sound
      • Spawner
      • SpawnPoint
      • SpawnPointGroup
      • SpotLight
      • StaticMesh
      • Team
      • UIScene
      • Widget
  • Tutorial
    • Script Tutorial
      • 스크립트 심화 강좌
        • 1. 스크립트의 종류, 호출 순서, 호출, 통신
        • 2. 동기화, 파라미터, 예외사항
        • 3. 디토랜드로 루아 활용하기
  • Sample
    • Scripting
    • Event
    • Collision & Physics
    • Transform
    • UI
    • Camera
    • Input
    • FX
    • Sound
  • Guide for Developers
    • Guide For Unity Developer
    • Guide For Roblox Developer
  • Release Note
    • Script Changes
      • 1.5.0 Map Changes
      • 1.2.0 Map Changes
      • 1.1.0 Map Changes
      • 1.0.0 Map Changes
      • 0.9.0 Map Changes
      • 0.7.0 Map Changes
      • 0.6.0 Map Changes
      • 0.5.0 Map Changes
      • 0.4.0 Map Changes
      • 0.3.0 Map Changes
      • 0.2.0 Map Changes
    • Known Issues
Powered by GitBook
On this page
  • 💻 스크립트에서 로그 기록
  • 📥 기록된 로그 데이터 다운로드
  • ✍ 기록 데이터 활용

Was this helpful?

  1. Manual

Collecting Game Logs

스크립트에서 로그를 기록하여, 월드에 접속한 플레이어들의 행동 데이터를 수집할 수 있는 기능이에요.

💻 스크립트에서 로그 기록

ServerScript 에서는 SaveLog 함수를, ClientScript 에서는 SaveMyLog 함수를 사용해서 로그를 기록할 수 있어요.

해당 함수가 호출된 시점의 시간, 해당 플레이어 정보, 인덱스 및 값이 기록돼요.

-- ServerScript
local function SaveLogData(player, value) 
    local playerID = player:GetPlayerID() 
		
    local dataKey = "Gold"  -- 기록할 로그의 데이터 키에요.
    local index_1 = 1       -- 기록할 로그의 1번 인덱스에요. 데이터 키의 하위 정보를 기록하고 싶다면 사용하고, 생략할 수도 있어요.
    local index_2 = 1000    -- 기록할 로그의 2번 인덱스에요. 데이터 키의 하위 정보를 기록하고 싶다면 사용하고, 생략할 수도 있어요.       
    
    Game:SaveLog(dataKey, playerID, value)
    Game:SaveLog(dataKey, index_1, playerID, value)
    Game:SaveLog(dataKey, index_1, index_2, playerID, value)
end     
Game:ConnectEventFunction("SaveLogData", SaveLogData)
-- ClientScript
local function SaveLogData(value) 	  
    local dataKey = "Gold"  -- 기록할 로그의 데이터 키에요.
    local index_1 = 1       -- 기록할 로그의 1번 인덱스에요. 데이터 키의 하위 정보를 기록하고 싶다면 사용하고, 생략할 수도 있어요.
    local index_2 = 1000    -- 기록할 로그의 2번 인덱스에요. 데이터 키의 하위 정보를 기록하고 싶다면 사용하고, 생략할 수도 있어요.        
    
    Game:SaveMyLog(dataKey, value)
    Game:SaveMyLog(dataKey, index_1, value)
    Game:SaveMyLog(dataKey, index_1, index_2, value)
end     

📌 로그의 1번 인덱스, 2번 인덱스, 값 은 number 형태만 기록할 수 있어요.

Game:SaveLog(dataKey, **index_1**, **index_2**, playerID, **value**)

아래 로그 기록 예시들을 참고해주세요.

  1. 특정 플레이어가 어떤 기기로 월드를 플레이 했는지(value) 기록하는 예시에요.

    -- ClientScript
    local function SaveLogData(value) 	 
        -- 기록할 로그의 데이터 키에요. 
        local dataKey = "ExperienceDevice"
    		
        -- 모바일 / PC 여부를 number 형태로 변환해서 기록해요.
        local isMobileDevice = Input:IsMobileTouchScreen() --Bool
        local value = -1     
        if     isMobileDevice then value = 0
        else                       value = 1
        end
    		
        Game:SaveMyLog(dataKey, value)
    end     

  2. 특정 플레이어가 어떤 종류의 재화 (index_1) 를, 어떤 소비처 (index_2) 에, 얼마만큼 소비했는지 (value) 를 기록하는 예시에요.

    -- ServerScript
    local function SaveLogData(player, assetType, usedPlace, value) 
        local playerID = player:GetPlayerID() 
    		
        -- 기록할 로그의 데이터 키에요.
        local dataKey = "PlayerAccount"                   
    		
        -- 소비한 재화 종류를 number 형태로 변환해서, 1번 인덱스에 기록해요.
        local index_1 = -1     
        if     assetType == "FreeAsset" then index_1 = 1
        elseif assetType == "PaidAsset" then index_1 = 2
        elseif assetType == "SubAsset"  then index_1 = 3
        end
    		
        -- 소비처 종류를 number 형태로 변환해서, 2번 인덱스에 기록해요.
        local index_2 = -1     
        if     usedPlace == "SkinShop"   then index_2 = 1
        elseif usedPlace == "WeaponShop" then index_2 = 2
        elseif usedPlace == "Gacha"      then index_2 = 3
        end               
    		
        Game:SaveLog(dataKey, index_1, index_2, playerID, value)
    end     
    Game:ConnectEventFunction("SaveLogData", SaveLogData)


📥 기록된 로그 데이터 다운로드

기록된 로그 데이터는, 월드 설정 페이지 > 로그 데이터 관리 페이지에서 CSV 파일로 다운로드 🔽 할 수 있어요.

조회할 데이터를 입력 후, [CSV로 추출하기] 버튼을 눌러주세요.

  • 데이터 키 값

    👉 SaveLog, SaveMyLog 함수에 첫번째 인자로 사용되는 키를 입력해주세요.

  • 플레이어 ID

    👉 특정 플레이어의 로그 값을 확인하고 싶다면,

    마이디토 > 닉네임 옆에서 확인할 수 있는 #000000 로 이루어진 숫자 를 입력해주세요.

    👉 전체 플레이어의 로그 값을 확인하고 싶은 경우엔, ‘전체’ 를 체크✅ 하면 돼요.

  • 기간

    👉 로그가 기록된 기간 중, 조회하고 싶은 기간을 선택해주세요.

📄 CSV 파일에서 다음 데이터를 얻을 수 있어요.

  • 해당 로그가 기록된 시간 (타임스탬프 & UTC 시간)

  • 플레이어 닉네임 / 플레이어 ID

  • 데이터 키 / 1번 인덱스 / 2번 인덱스 / 기록 값


✍ 기록 데이터 활용

기록된 데이터를 지표 및 밸런싱에 활용해보세요.

✅ 특정 플레이어가 어떤 종류의 재화를, 어떤 소비처에, 얼마만큼 소비했는지를 기록하는 경우,

  • 인기가 없는 소비처를 파악해서, 개선이 필요한 부분을 찾거나

  • 특정 플레이어에게서 부적절한 소비가 있지는 않았는지 확인해볼 수 있어요.

✅ 접속 시간대, 접속 유지 시간 등 시간과 관련된 로그를 기록하고 싶은 경우 ostime 으로 기록해보세요. 기록한 ostime 값은 엑셀에서 다음과 같이 변환하여 확인할 수 있으니 참고해주세요.

  1. ostime 기록 값에 아래 함수를 적용해주세요.

    =(((기록값 셀+32400)/60)/60)/24 + DATE(1970,1,1)

  2. 함수를 적용한 셀에 다음과 같이 서식을 적용하면, 날짜와 시간을 표시할 수 있어요.

PreviousMatchmakingNextExternal Avatar

Last updated 11 months ago

Was this helpful?