You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation.html
+125Lines changed: 125 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -263,6 +263,131 @@ <h3>Integration with Bug Reports</h3>
263
263
<strong>Example Scene:</strong> The plugin includes <code>DeviceAuthExample.cs</code> in the Samples folder, demonstrating complete integration between device authentication and bug reporting systems.
264
264
</div>
265
265
266
+
<h2>Optional Components</h2>
267
+
268
+
<p>The plugin includes two optional components that can enhance bug reports with additional diagnostic information. These components are <strong>not attached to the prefabs by default</strong> and must be manually added to provide enhanced debugging capabilities.</p>
269
+
270
+
<h3>GeolocationProvider</h3>
271
+
272
+
<divclass="note">
273
+
<strong>Purpose:</strong> Automatically collects the user's country and ISP information based on their IP address to help identify location-specific issues and provide geographic context for bug reports.
274
+
</div>
275
+
276
+
<h4>How It Works</h4>
277
+
278
+
<ol>
279
+
<li><strong>Automatic Detection:</strong> Uses BetaHub's ping endpoint to detect the user's country and ISP via IP geolocation</li>
280
+
<li><strong>Header Parsing:</strong> Extracts geolocation information from response headers:
281
+
<ul>
282
+
<li>Country data from headers like <code>X-Viewer-Country</code>, <code>CF-IPCountry</code></li>
283
+
<li>ASN (Autonomous System Number) data from <code>X-Viewer-ASN</code> header</li>
284
+
</ul>
285
+
</li>
286
+
<li><strong>ISP Resolution:</strong> ASN data is automatically resolved to ISP/company names on the BetaHub dashboard for easier analysis</li>
287
+
<li><strong>Bug Report Integration:</strong> Country and ISP data are automatically included in bug reports as custom fields</li>
288
+
</ol>
289
+
290
+
<h4>Setup Instructions</h4>
291
+
292
+
<ol>
293
+
<li>In your scene, select the GameObject containing your <code>BugReportUI</code> component</li>
294
+
<li>Click <strong>Add Component</strong> and search for <code>GeolocationProvider</code>, or drag the script from the project window</li>
295
+
<li>Configure the provider in the inspector:
296
+
<ul>
297
+
<li><strong>Enable Geolocation:</strong> Toggle to enable/disable country code collection</li>
298
+
<li><strong>Enable ASN Collection:</strong> Toggle to enable/disable ISP/ASN data collection</li>
299
+
<li><strong>Geolocation Endpoint:</strong> API endpoint for geolocation (default: <code>https://ping.betahub.io/ping.txt</code>)</li>
<li>The component will automatically link itself to the <code>BugReportUI</code> on the same GameObject</li>
304
+
</ol>
305
+
306
+
<divclass="note">
307
+
<strong>Automatic Setup:</strong> When <code>GeolocationProvider</code> is attached to the same GameObject as <code>BugReportUI</code>, it will automatically configure itself and display a success message in the console. If placed on a different GameObject, you'll see a warning message with setup instructions.
308
+
</div>
309
+
310
+
<h3>LatencyProvider</h3>
311
+
312
+
<divclass="note">
313
+
<strong>Purpose:</strong> Measures network latency to help diagnose network-related issues and provide connection quality context for bug reports.
314
+
</div>
315
+
316
+
<h4>How It Works</h4>
317
+
318
+
<ol>
319
+
<li><strong>Ping Methods:</strong> Supports two measurement methods:
320
+
<ul>
321
+
<li><strong>ICMP Ping:</strong> Uses Unity's built-in Ping class for traditional network ping (default)</li>
322
+
<li><strong>HTTP Ping:</strong> Uses UnityWebRequest for HTTP-based latency measurement</li>
323
+
<li><strong>Automatic Fallback:</strong> Automatically switches from ICMP to HTTP if ICMP fails consistently (after 3 consecutive failures per host)</li>
324
+
</ul>
325
+
</li>
326
+
<li><strong>Collection Modes:</strong> Two modes for data collection:
327
+
<ul>
328
+
<li><strong>OnBugReport:</strong> Collects pings only when bug report window opens (default)</li>
329
+
<li><strong>Continuous:</strong> Continuously collects pings in the background at regular intervals</li>
330
+
</ul>
331
+
</li>
332
+
<li><strong>Multiple Host Support:</strong> Can ping multiple ICMP target hosts simultaneously for comprehensive network analysis</li>
333
+
<li><strong>Multiple Requests:</strong> Performs up to 10 ping requests per host to calculate accurate statistics</li>
334
+
<li><strong>Early Termination:</strong> If user submits the bug report before all pings complete, uses available data</li>
335
+
<li><strong>Comprehensive Statistics:</strong> Calculates minimum, maximum, and average latency from successful requests, plus packet loss statistics</li>
336
+
<li><strong>Results Format:</strong> Includes detailed data like <code>"min/avg/max = 45ms/67ms/89ms (8/10 requests), Lost: 2/10 (20.0%)"</code> in bug reports</li>
337
+
</ol>
338
+
339
+
<h4>Setup Instructions</h4>
340
+
341
+
<ol>
342
+
<li>In your scene, select the GameObject containing your <code>BugReportUI</code> component</li>
343
+
<li>Click <strong>Add Component</strong> and search for <code>LatencyProvider</code>, or drag the script from the project window</li>
344
+
<li>Configure the provider in the inspector:
345
+
<ul>
346
+
<li><strong>Enable Latency:</strong> Toggle to enable/disable latency measurement</li>
347
+
<li><strong>Collection Mode:</strong> Choose between OnBugReport (default) or Continuous collection</li>
348
+
<li><strong>Ping Method:</strong> Select ICMP (default) or HTTP ping method</li>
349
+
<li><strong>ICMP Target Hosts:</strong> List of hosts for ICMP ping (default: ping.betahub.io)</li>
350
+
<li><strong>HTTP Endpoint:</strong> API endpoint for HTTP latency testing (default: <code>https://ping.betahub.io/ping.txt</code>)</li>
351
+
<li><strong>Min Ping Requests:</strong> Minimum number of ping requests per host (default: 10, range: 1-20)</li>
352
+
<li><strong>Timeout Seconds:</strong> Request timeout per ping (default: 5 seconds)</li>
353
+
<li><strong>Delay Between Requests:</strong> Delay between consecutive pings (default: 0.1 seconds)</li>
354
+
<li><strong>Ping Interval:</strong> Interval between background pings in continuous mode (default: 15 seconds)</li>
355
+
</ul>
356
+
</li>
357
+
<li>The component will automatically link itself to the <code>BugReportUI</code> on the same GameObject</li>
358
+
</ol>
359
+
360
+
<divclass="warning">
361
+
<strong>Performance Considerations:</strong> Latency testing performs network requests while the bug report UI is open. The default settings (10 requests with 0.1s delays) complete in approximately 1-2 seconds under normal conditions. If users frequently submit reports very quickly, consider reducing <code>Max Ping Requests</code> or increasing <code>Delay Between Requests</code> to balance accuracy with responsiveness.
362
+
</div>
363
+
364
+
<h4>Troubleshooting</h4>
365
+
366
+
<ul>
367
+
<li><strong>"No latency data available":</strong> All ping requests failed. Check network connectivity and endpoint accessibility.</li>
368
+
<li><strong>"No country information found":</strong> Geolocation service didn't return expected headers. This may indicate network issues or endpoint changes.</li>
369
+
<li><strong>Warning messages in console:</strong> If components are not on the same GameObject as <code>BugReportUI</code>, you'll see warnings with setup instructions.</li>
370
+
</ul>
371
+
372
+
<h4>Data Integration</h4>
373
+
374
+
<p>When both components are enabled, bug reports will include custom fields like:</p>
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ For continued use and more extensive testing, we strongly recommend creating you
29
29
-**Video recording**: Record a video of the bug happening in-game. The video is automatically recorded and attached to the bug report.
30
30
-**Log collection**: Collect logs from the game and attach them to the bug report. By default, Unity logs are collected, but you can also add custom logs.
31
31
-**Screenshot of the game**: A screenshot of the game is automatically attached to the bug report when the user submits a bug.
32
+
-**Geolocation and latency data**: Optional components for collecting user's country information and network latency measurements to help with debugging location-specific and network-related issues.
32
33
-**Working Example Scene**: The plugin comes with a working example scene that demonstrates how to use the plugin, serving as a good starting point for your implementation.
33
34
-**Customizable**: Customize the bug submission form to ask for more information or to change the look and feel of the form.
34
35
@@ -46,6 +47,8 @@ For continued use and more extensive testing, we strongly recommend creating you
46
47
47
48
The installation and setup documentation is available [here](https://www.betahub.io/docs/integration-guides/).
48
49
50
+
For detailed information about optional components like geolocation and latency collection, see the included [Documentation.html](Documentation.html) file.
51
+
49
52
## Device Authentication (Optional)
50
53
51
54
The plugin supports an optional device authentication flow that provides a seamless user experience for bug reporting.
// Custom field validator for validating provider requirements
90
+
privateCustomFieldValidatorcustomFieldValidator;
91
+
80
92
// If set, this email address will be used as the default email address of the reporter.
81
93
// This is a hidden field since it's purpose is to be pre-filled programmatically by the developer if the user is somehow already logged in with a specific email address.
0 commit comments