wesleywh / EasyMultiplayer-Invector

Where to submit issues for "Easy Multiplayer - Invector" suite of packages that is available via GumRoad or the Unity Asset Store. GUMROAD: https://cyberbulletgames.gumroad.com/ ASSET STORE: https://assetstore.unity.com/publishers/34070
0 stars 0 forks source link

When using chatbox with shooterMelee Template with Dedicated Server, Client is disconnected. #14

Closed MattW1958 closed 2 years ago

MattW1958 commented 2 years ago

When you press a key to enter the chatbox the server immediately closes connection to client whilst in Dedicated Server Mode.

To Reproduce

Open MAIN_ShooterMelee from CBGames Shooter Add a Chatbox prefab in Main_ShooterMelee Hierarchy add the chat box player input control component your MP_vShooterMeleeController Player In EMI_Network Manager change Player Prefab to ChatBox_ClientConnection Setup build window CBGames/EasyMultiplayer-Invector/Shooter/Scenes/MAIN_ShooterMelee CBGames/EasyMultiplayer-Invector/Shooter/Scenes/ExampleScenes/MP_Invector_ShooterMelee Build and run server, connect client and press V key to open chat window.

The following happens Disconnecting connId=-321519593 to prevent exploits from an Exception in MessageHandler: StackOverflowException The requested operation caused a stack overflow. ' (A full console report supplied in the text attachment)

(Note this does not occur when building with the Main_ChatboxExample and MP_BasicLocomotion and running a client ahd dedicated server)

Versions

Additional context ServerConsoleLog.zip

wesleywh commented 2 years ago

I believe I have this fixed. This fix will be available in the future patch v0.4.1 of UI.

NOTE: I also accounted for Inventory based characters working with the chatbox.

wesleywh commented 2 years ago

I guess I should give more context on what was happening. Your immediate issue is because on a dedicated server it starts really really fast. Faster than I can perform checks. I didn't account for this. So I account for the fact that if the server was already active before being able to register the callbacks I would just execute the handler installation automatically. That solves it for the dedicated server.

The other issue was pressing the "i" button with the chatbox open would open the inventory screen. Added a couple of new unity events along with some documentation on what to register to prevent stopped that.

Finally while moving, then opening the chatbox, the player would continue to move on the server. While would cause reconcilation to happen client side causing clients to "snap" to new positions. I added a new Command and ClientRpc function and that fixed that.

All of this will be available for you in the next release. Too much to just post here so just be patient for the next release.

MattW1958 commented 2 years ago

Thats great work thanks,..Yes I had to relocate the "i" Inventory key along with "g" for Grenade and I think "u" key was affected too. I'm very patient so it's not a problem!

wesleywh commented 2 years ago

I just fixed the "g" for grenade throw and will be updating the docs on how to do this. Plan on releasing this tonight if I can.

wesleywh commented 2 years ago

Here is the docs for when I release this: https://cyberbulletgames.com/easy-multiplayer-invector-ui-docs/Prefabs/ChatBox/PlayerInteraction/

MattW1958 commented 2 years ago

Thank you!