fix: correctly send new public key on regen

This commit is contained in:
Anna 2021-02-05 15:55:16 -05:00
parent 0f50c8b589
commit 8109c6ca80
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
2 changed files with 7 additions and 2 deletions

View File

@ -113,6 +113,7 @@ namespace XIVChatPlugin {
if (WithWhiteText(() => ImGui.Button("Regenerate"))) {
this.Plugin.Server.RegenerateKeyPair();
this.Plugin.Relay?.ResendPublicKey();
}
ImGui.SameLine();

View File

@ -74,9 +74,13 @@ namespace XIVChatPlugin {
return;
}
var pk = keys.PublicKey.ToHexString();
var msg = new RelayRegister {
AuthToken = "",
PublicKey = keys.PublicKey,
};
var bytes = MessagePackSerializer.Serialize((IToRelay) msg);
this.Connection.Send(pk);
this.Connection.Send(bytes);
}
internal void DisconnectClient(IEnumerable<byte> pk) {