RAGECOOP / RAGECOOP-V

Drive around the interstate with your buddy, enjoy GTAs environment, make own missions and events or just chill in Grove Street! 🌐
https://ragecoop.com
MIT License
59 stars 18 forks source link

Packet error with resource #12

Closed oldnapalm closed 2 years ago

oldnapalm commented 2 years ago

Actually the error in log was from an old CoopClient.dll I had in scripts folder. Removing it there's no crash and no error in log, just packet error from resource https://github.com/RAGECOOP/RAGECOOP-V/issues/12#issuecomment-1163110802

If I connect and disconnect twice, on the 3rd connection the game crashes.

[ERROR] Caught fatal unhandled exception:
System.InvalidOperationException: Native.Function.Call can only be called from the main thread.
   em GTA.Native.Function.ThrowInvalidOperationExceptionForInvalidNativeCall()
   em GTA.Native.Function.ReturnValueFromNativeIfNotNull[T](UInt64* result)
   em CoopClient.Entities.EntitiesThread.OnTick(Object sender, EventArgs e)
   em SHVDN.Script.MainLoop()
[ERROR] The exception was thrown while executing the script CoopClient.Entities.EntitiesThread.
Sardelka9515 commented 2 years ago

Hi @oldnapalm, nice to see you here, the project has been reworked and I'm the current maintainer. You can download latest nightly build here, which is likely to solve the above issue

oldnapalm commented 2 years ago

The issue seems to be solved in the latest build, but most likely it's in the resource I'm trying to update, now I get this in the second connection

2022-06-20 08_57_04-Grand Theft Auto V

Sardelka9515 commented 2 years ago

The resource system is still in work, this issue be addressed once it's completed.

oldnapalm commented 2 years ago

No luck with https://github.com/RAGECOOP/RAGECOOP-V/commit/42c038d8ab7d5801ccb4c232ea7f062698d3ee9e

Can the first argument of SendNativeCall be changed to GTA.Native.Hash as well?

oldnapalm commented 2 years ago

Sorry, it was my fault. I had a CoopClient.dll (used by GTBikeV) in the scripts folder, the error in log was from it. Removed it and now I have no crash and no errors in log, just these errors in notifications (to be clear, those are from my resource)

2022-06-22 10_35_10-Grand Theft Auto V

2022-06-22 10_41_40-Grand Theft Auto V

Sardelka9515 commented 2 years ago

Can the first argument of SendNativeCall be changed to GTA.Native.Hash as well?

Yes, I'm working on a rewrite for sever side native call. Hopefully I can push it to the repo tomorrow.

oldnapalm commented 2 years ago

Great.

NativeCall seems to be working (error was caused by old CoopClient), the packet error now is with NativeResponse and CleanUpWorld.