CW-Jesse / valheim-betternetworking

Improve the multiplayer performance of Valheim!

Home Page:https://valheim.thunderstore.io/package/CW_Jesse/BetterNetworking_Valheim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2.1.2 doesn't work

CW-Jesse opened this issue · comments

commented

Reported by TGiFallen:

[Error : Unity Log] InvalidOperationException: Queue empty.
Stack trace:
System.Collections.Generic.Queue`1[T].Dequeue () (at <5a2009c85b134970925993880e2ecb2e>:0)
(wrapper dynamic-method) ZSteamSocket.DMD(ZSteamSocket)
ZSteamSocket.Update (System.Single dt) (at <617986ed2f06468487af280e8d8f7c04>:0)
ZSteamSocket.UpdateAllSockets (System.Single dt) (at <617986ed2f06468487af280e8d8f7c04>:0)
ZNet.Update () (at <617986ed2f06468487af280e8d8f7c04>:0)
commented

2.1.2 worked perfectly for me on Steamworks. I'll also try PlayFab, though the error indicates the problem is with Steamworks. Someone mentioned they went straight from 2.0.4 to 2.1.2. Maybe config file changes?

commented

I also added incompatibilities with Network and other networking plugins. Maybe the problem is BN is disabled for them and they're not noticing?

commented

I'll also try roughly disconnecting with 2.1.2 (#3). Maybe the problem was made worse, not better.

commented

Finally have an exception for 2.1.2, and it's not what was originally reported to me. At least I have something to work with once I have the time!

Exception in ZRpc::HandlePackage: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.Cryptography.CryptographicException: Bad PKCS7 padding. Invalid length 241.
  at Mono.Security.Cryptography.SymmetricTransform.ThrowBadPaddingException (System.Security.Cryptography.PaddingMode padding, System.Int32 length, System.Int32 position) [0x00056] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at Mono.Security.Cryptography.SymmetricTransform.FinalDecrypt (System.Byte[] inputBuffer, System.Int32 inputOffset, System.Int32 inputCount) [0x00146] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at Mono.Security.Cryptography.SymmetricTransform.TransformFinalBlock (System.Byte[] inputBuffer, System.Int32 inputOffset, System.Int32 inputCount) [0x0002e] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Security.Cryptography.CryptoStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x002e3] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.IO.Stream.InternalCopyTo (System.IO.Stream destination, System.Int32 bufferSize) [0x00012] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.IO.Stream.CopyTo (System.IO.Stream destination) [0x00084] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at (wrapper remoting-invoke-with-check) System.IO.Stream.CopyTo(System.IO.Stream)
  at ServerCharacters.ServerSide+PatchZNetOnNewConnection.VerifySignature (System.Byte[] profileData, System.Byte[] signature) [0x0005b] in <6ad9b5860f284f748b2f77eb8b2f0bca>:0 
  at ServerCharacters.ServerSide+PatchZNetOnNewConnection.onReceivedSignature (ZRpc peerRpc, System.Byte[] signedProfile) [0x00013] in <6ad9b5860f284f748b2f77eb8b2f0bca>:0 
  at ServerCharacters.Shared+<>c__DisplayClass4_0.<receiveCompressedFromPeer>b__0 (ZRpc sender, ZPackage package) [0x0015c] in <6ad9b5860f284f748b2f77eb8b2f0bca>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <695d1cc93cca45069c528c15c9fdd749>:0 

   --- End of inner exception stack trace ---

  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at ZRpc+RpcMethod`1[T].Invoke (ZRpc rpc, ZPackage pkg) [0x0001d] in <617986ed2f06468487af280e8d8f7c04>:0 
  at (wrapper dynamic-method) ZRpc.DMD<ZRpc::HandlePackage>(ZRpc,ZPackage)
  at ZRpc.Update (System.Single dt) [0x0003e] in <617986ed2f06468487af280e8d8f7c04>:0 
commented

At first glance, it looks as though Valheim was trying to decompress BN-compressed data instead of BN.

commented

I'm not running into any errors like that, so I'll try with the ServerCharacters mod when I can, since that's what's throwing the error.

commented

For the original reported error, I have no idea how it's possible.

My code replaces the m_sendQueue with a queue of the same size, and then the original code dequeues it one by one while the queue's count > 0. It seems simple, considering this part of the code shouldn't be multithreaded. Then again, I'm super sleepy.

commented

2.1.2 worked fine for me for a month with no issues.