Skip to content

Client-Server synchronization on Client's shutdown #42753

@modern-nm

Description

@modern-nm

Hi, I am trying to make some feature and i have a problem that I cant solve for a long time. I cant make client to send a custom NetMessage to server for some post processing AFTER user hit "Close" button of ss14 window. I trying to send NetMessage on public override void Shutdown() of Content.Client\Entry\EntryPoint.cs. It is the most early point after "[INFO] game: Shutting down! Reason: Main window closed" i found to inject my code. So I call method _netManager.ClientSendMessage(msg); on Client side.
After that i expect that server capture my message OnSyncMessage(MyNetMessage msg) and process it, but i got [WARN] net: [::1]:59298: Received data message, but not connected. only (if server started in debug mode/ otherwise i dont recieve even that).
But.. if I place such bloody shit like System.Threading.Thread.Sleep(100); right after _netManager.ClientSendMessage(msg); magic is happened and my message delivered and processed. As i think, message is not delivered because client net status is Disconnected already. I cant find way to make netManager send it and dont die while message is flying to server

Help me, im under water

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: UntriagedStatus: Indicates an item has not been triaged and doesn't have appropriate labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions