mirror of
				https://github.com/ErikasKontenis/SabrehavenServer.git
				synced 2025-10-30 19:56:22 +01:00 
			
		
		
		
	commit client
This commit is contained in:
		
							
								
								
									
										22
									
								
								SabrehavenOTClient/modules/crash_reporter/crash_reporter.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								SabrehavenOTClient/modules/crash_reporter/crash_reporter.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| local CRASH_FILE = "exception.dmp" | ||||
|  | ||||
| function init() | ||||
|   if g_resources.fileExists(CRASH_FILE) then | ||||
|     local crashLog = g_resources.readFileContents(CRASH_FILE) | ||||
|     local clientLog = g_logger.getLastLog() | ||||
|     HTTP.post(Services.crash, { | ||||
|       version = APP_VERSION, | ||||
|       build = g_app.getVersion(), | ||||
|       os = g_app.getOs(), | ||||
|       platform = g_window.getPlatformType(), | ||||
|       crash = base64.encode(crashLog), | ||||
|       log = base64.encode(clientLog) | ||||
|     }, function(data, err) | ||||
|       if err then  | ||||
|         return g_logger.error("Error while reporting crash report: " .. err) | ||||
|       end | ||||
|       g_resources.deleteFile(CRASH_FILE) | ||||
|     end)       | ||||
|   end | ||||
| end | ||||
|  | ||||
| @@ -0,0 +1,8 @@ | ||||
| Module | ||||
|   name: crash_reporter | ||||
|   description: Sends crash log to remote server | ||||
|   author: otclient@otclient.ovh | ||||
|   website: otclient.ovh | ||||
|   reloadable: false | ||||
|   scripts: [ crash_reporter ] | ||||
|   @onLoad: init() | ||||
		Reference in New Issue
	
	Block a user
	 ErikasKontenis
					ErikasKontenis