Solved World.AirdropAt

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
Try to use this code and I get random errors

Python:
import clr
import sys
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Advertise:
    def On_PluginInit(self):
        Plugin.CreateTimer("testtimer", 10000).Start()

    def testtimerCallback(self, timer):
        Server.BroadcastFrom("TEST", "RANDOM ERROR???")
        World.AirdropAt(5000, 400, 5000)
        timer.Kill()
        Plugin.CreateTimer("testtimer", 10000).Start()
And it causes this spam in console

Imagen 6.jpg

The error occurs randomly each time the timer is run
I've tried doing it in C# and so does the same thing.
Maybe the error is here? - https://github.com/Notulp/Fougerite/blob/master/Fougerite/Fougerite/World.cs#L71-L119
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,463
284
83
Australia
Code looks fine,
But you don't need to kill the timer and create it again.
It will go off every x seconds you pick.
 
Last edited:

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
Code looks fine,
But you don't need to kill the timer and create it again.
It will go off every x seconds you pick.
Python:
import clr
import sys
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Advertise:
    def On_PluginInit(self):
        Plugin.CreateTimer("testtimer", 10000).Start()

    def testtimerCallback(self, timer):
        Server.BroadcastFrom("TEST", "RANDOM ERROR???")
        World.AirdropAt(5000, 400, 5000)
I do not think .... It's still happening.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
3,956
1,129
113
At your house.
github.com
Code looks fine,
But you don't need to kill the timer and create it again.
It will go off every x seconds you pick.
Not true.

For some reason the C# timers die after a given time, so it is really recommended to recreate the timer.


Python:
import clr
import sys
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Advertise:
    def On_PluginInit(self):
        Plugin.CreateTimer("testtimer", 10000).Start()

    def testtimerCallback(self, timer):
        Server.BroadcastFrom("TEST", "RANDOM ERROR???")
        World.AirdropAt(5000, 400, 5000)
I do not think .... It's still happening.
Thanks for the report, I will look into It. btw the original code is okay, be sure to recreate the timer
 
  • Like
Reactions: salva

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
Not true.

For some reason the C# timers die after a given time, so it is really recommended to recreate the timer.



Thanks for the report, I will look into It. btw the original code is okay, be sure to recreate the timer
It would be incredible to repair this error, and thus to be able to play a little more with airdrops xd, if solved let me know, I have plugins waiting for a solution ... thanks
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
I've done it anyway, with different timer methods, in Python and in C # .. and this random error always occurs ...
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
He tried with:

C#:
Vector3 pos = new Vector3(5000, 400, -5000);
            SupplyDropZone.CallAirDropAt(pos);
Still giving Random errors

Client Error Log:

Exception: Trying to read past the buffer size when calling RPC Method SupplyDropPlane:GetNetworkUpdate - likely caused by mismatching send parameters, different size or order.
at #=qQB5ODMzkFveAQbdO9M7JO3iQNzSFRwop5_3doWwCK38=.#=qGMP0P8EuYd_X7F9PRWBL5g== (uLink.BitStream #=qCVNyGFe$gydnaZcyMdNONA==, System.Object #=qzSRyfGqly1LHlg30FzDi$Q==, #=qaL2AMBCaBLCj4lGSCwjcBVYUs_5vzeQVgu44HVklVYQ= #=qF0LixpnARxoY9B2O6_AJXQ==) [0x00000] in <filename unknown>:0

at #=q$NUWz6aT_ypN3cz7K6ce2gVWapiYAlnLPGzKjIUfT2w=.#=qS9ntZNSJqwnPkZv_HZvsug== (uLink.BitStream #=qXGAAwsb5CJJ8S2Ehp7Xk1g==, System.Object #=qUQ_5Y1Yee0zHw5xz3RJs3Q==) [0x00000] in <filename unknown>:0

at uLink.NetworkView.OnRPC (System.String rpcName, uLink.BitStream stream, uLink.NetworkMessageInfo info) [0x00000] in <filename unknown>:0

at uLink.NetworkViewBase.#=qpJfiNEhSKsosBj54zW21Bw== (System.String #=q$Jt5MurGgHKDHfFpZi59PA==, uLink.BitStream #=qKVMsbknO$bvRuqZ08STSRA==, uLink.NetworkMessageInfo #=qrmJ6YoTIr0SFnQvRFRz6$w==) [0x00000] in <filename unknown>:0

at #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=.#=qlGEZiB55BOeKhe33IbTgs3lVmx7rHXWsIFfTvKtNlrQ= (.#=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0= #=q78dFOyJP5gEJQ7xl3hAFIQ==) [0x00000] in <filename unknown>:0

at #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=.#=qIPn628V9gmXGKu9CDwAT4Q== (.#=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0= #=qRwJrOAyIe5SeN4SKl$FtkA==) [0x00000] in <filename unknown>:0

at #=qZti1eKpmgEiH8RyJbFvrtbtjuOoTgnfxK4EfJn_O0Rw=.#=qbuIDweKOGqCKZ7R1$YWXFvPkygcsdrvEtAZ4Px9OwQQ= (.#=qDyYck6jY0p_qh6doTcsvIbN8t3TKJHLMicx6djrzRdg= #=q5t3WkthVpvyAjzUM2c_1yw==, #=qBQZKBBBvB7$YPJYYJ6uGmZupKsyCo6fust8CQG8ZrYc= #=qguMZxn1$ymoUh2X6TRZqfw==) [0x00000] in <filename unknown>:0

at #=qZti1eKpmgEiH8RyJbFvrtbtjuOoTgnfxK4EfJn_O0Rw=.#=qBJbY7Rvju_MJxDnWLOQuYufOeJyKrm7ov2fiKefxxhc= () [0x00000] in <filename unknown>:0

at #=qZti1eKpmgEiH8RyJbFvrtbtjuOoTgnfxK4EfJn_O0Rw=.#=queaDNRLAGdOgw3nB9XdoFA== () [0x00000] in <filename unknown>:0

at #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=.#=qqJfJJIU5OocEzCry9eP0ew== () [0x00000] in <filename unknown>:0

at #=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=.#=qK4rBLHQlJi1c$9ISNO6Z6w== () [0x00000] in <filename unknown>:0

at uLink.InternalHelper.LateUpdate () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Server Error Log:

Code:
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: viewID
Can't subscribe uLinkNetworkView "SupplyCrate(Clone)" (ViewID 60291) since there
already exists one with ViewID 60291 at uLinkNetworkView "C130(Clone)" (ViewID
60291)
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: viewID
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: viewID
 
Last edited:

xandeturf

Moderator
Moderator
Nov 4, 2015
132
24
18
28
Show all your code, there is something wrong with your code because it worked correctly here.
I put it drop every 10 seconds.
 

Attachments

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
3,956
1,129
113
At your house.
github.com
He tried with:

C#:
Vector3 pos = new Vector3(5000, 400, -5000);
            SupplyDropZone.CallAirDropAt(pos);
Still giving Random errors

Client Error Log:

Exception: Trying to read past the buffer size when calling RPC Method SupplyDropPlane:GetNetworkUpdate - likely caused by mismatching send parameters, different size or order.
at #=qQB5ODMzkFveAQbdO9M7JO3iQNzSFRwop5_3doWwCK38=.#=qGMP0P8EuYd_X7F9PRWBL5g== (uLink.BitStream #=qCVNyGFe$gydnaZcyMdNONA==, System.Object #=qzSRyfGqly1LHlg30FzDi$Q==, #=qaL2AMBCaBLCj4lGSCwjcBVYUs_5vzeQVgu44HVklVYQ= #=qF0LixpnARxoY9B2O6_AJXQ==) [0x00000] in <filename unknown>:0

at #=q$NUWz6aT_ypN3cz7K6ce2gVWapiYAlnLPGzKjIUfT2w=.#=qS9ntZNSJqwnPkZv_HZvsug== (uLink.BitStream #=qXGAAwsb5CJJ8S2Ehp7Xk1g==, System.Object #=qUQ_5Y1Yee0zHw5xz3RJs3Q==) [0x00000] in <filename unknown>:0

at uLink.NetworkView.OnRPC (System.String rpcName, uLink.BitStream stream, uLink.NetworkMessageInfo info) [0x00000] in <filename unknown>:0

at uLink.NetworkViewBase.#=qpJfiNEhSKsosBj54zW21Bw== (System.String #=q$Jt5MurGgHKDHfFpZi59PA==, uLink.BitStream #=qKVMsbknO$bvRuqZ08STSRA==, uLink.NetworkMessageInfo #=qrmJ6YoTIr0SFnQvRFRz6$w==) [0x00000] in <filename unknown>:0

at #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=.#=qlGEZiB55BOeKhe33IbTgs3lVmx7rHXWsIFfTvKtNlrQ= (.#=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0= #=q78dFOyJP5gEJQ7xl3hAFIQ==) [0x00000] in <filename unknown>:0

at #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=.#=qIPn628V9gmXGKu9CDwAT4Q== (.#=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0= #=qRwJrOAyIe5SeN4SKl$FtkA==) [0x00000] in <filename unknown>:0

at #=qZti1eKpmgEiH8RyJbFvrtbtjuOoTgnfxK4EfJn_O0Rw=.#=qbuIDweKOGqCKZ7R1$YWXFvPkygcsdrvEtAZ4Px9OwQQ= (.#=qDyYck6jY0p_qh6doTcsvIbN8t3TKJHLMicx6djrzRdg= #=q5t3WkthVpvyAjzUM2c_1yw==, #=qBQZKBBBvB7$YPJYYJ6uGmZupKsyCo6fust8CQG8ZrYc= #=qguMZxn1$ymoUh2X6TRZqfw==) [0x00000] in <filename unknown>:0

at #=qZti1eKpmgEiH8RyJbFvrtbtjuOoTgnfxK4EfJn_O0Rw=.#=qBJbY7Rvju_MJxDnWLOQuYufOeJyKrm7ov2fiKefxxhc= () [0x00000] in <filename unknown>:0

at #=qZti1eKpmgEiH8RyJbFvrtbtjuOoTgnfxK4EfJn_O0Rw=.#=queaDNRLAGdOgw3nB9XdoFA== () [0x00000] in <filename unknown>:0

at #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=.#=qqJfJJIU5OocEzCry9eP0ew== () [0x00000] in <filename unknown>:0

at #=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=.#=qK4rBLHQlJi1c$9ISNO6Z6w== () [0x00000] in <filename unknown>:0

at uLink.InternalHelper.LateUpdate () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Server Error Log:

Code:
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: viewID
Can't subscribe uLinkNetworkView "SupplyCrate(Clone)" (ViewID 60291) since there
already exists one with ViewID 60291 at uLinkNetworkView "C130(Clone)" (ViewID
60291)
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: viewID
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: viewID
I think you are not using the prepatched ulink.dll, but it should work without that.
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43

xandeturf

Moderator
Moderator
Nov 4, 2015
132
24
18
28
i not use python. But try this.
If it does not work remove the ("World.AirdropAt (5000, 400, 5000)") and verify that the timer is working correctly.

Python:
import clr
import sys
import System
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Advertise:
    def On_PluginInit(self):
        Plugin.CreateTimer("TestTimer", 10000).Start()

    def TestTimerCallback(self, ATimedEvent):
        ATimedEvent.Kill()
        Server.BroadcastFrom("TEST", "RANDOM ERROR???")
        World.AirdropAt(5000, 400, 5000)
 

xandeturf

Moderator
Moderator
Nov 4, 2015
132
24
18
28
@DreTaX I noticed that the Hook OnAirdropCalled does not detect SupplyDrop is there any other way to detect the SupplyDrop? If the answer is not, would it be possible to update?
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
i not use python. But try this.
If it does not work remove the ("World.AirdropAt (5000, 400, 5000)") and verify that the timer is working correctly.

Python:
import clr
import sys
import System
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Advertise:
    def On_PluginInit(self):
        Plugin.CreateTimer("TestTimer", 10000).Start()

    def TestTimerCallback(self, ATimedEvent):
        ATimedEvent.Kill()
        Server.BroadcastFrom("TEST", "RANDOM ERROR???")
        World.AirdropAt(5000, 400, 5000)
Dude, the timer is not relevant to that error, the problem comes from World.AirdropAt ...

It is a random error, it does not happen every time the timer runs ....
When it happens, there is a plane paralyzed in the air and the rest of the planes are still normal ...
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
@DreTaX I noticed that the Hook OnAirdropCalled does not detect SupplyDrop is there any other way to detect the SupplyDrop? If the answer is not, would it be possible to update?
Are you using the Facepunch.ID reference to do that SupplyDropZone.CallAirDropAt(pos);?

And what do you try to call an airdrop when an airdrop is already called?, That's scary !!! Xd
 

xandeturf

Moderator
Moderator
Nov 4, 2015
132
24
18
28
i not use python D: , my test was in C#.
try World.CallAirDropAt(pos) or World.SupplyDropZone.CallAirDropAt(pos)
pos Should not it be a Vector3?
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
3,956
1,129
113
At your house.
github.com
SupplyDropZone.CallAirDropAt(target);

is a native method so its pretty weird. this error has been around for a time, i guess its a rust fuckup.
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
576
164
43
recovering this conversation yesterday in Discord with @gintaras ... It occurred to me that maybe it could be that when calling an airdrop inside a timer, maybe ... I should use Loom to keep it in the main thread and BUM !!!! .... no longer gives errors, therefore it is solved ....then ... @DreTaX


Python:
import clr
import sys
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class AirdropTest:
    def On_PluginInit(self):
        Plugin.CreateTimer("testtimer", 10000).Start()

    def testtimerCallback(self, timer):
        timer.Kill()
        Server.BroadcastFrom("TEST", "RANDOM ERROR???")
        Loom.QueueOnMainThread(lambda:
        World.AirdropAt(5000, 700, -5000)
        )
        Plugin.CreateTimer("testtimer", 10000).Start()
 
  • Like
Reactions: DreTaX