protected override void OnDisconnected() { Console.WriteLine($"Id {connectionID} disconnected!"); ServerMessage ssm = new ServerMessage(NATPMethod.ClientDisconnectionResponse); ssm.WriteUInt(NATPAttribute.ConnectionID, (uint)connectionID); var buffer = ssm.WriteRequest(); //Console.WriteLine("size: " + buffer.Length); clientToHost.EncryptSend(buffer); }
private void ResponseCreateRoom(bool success) { ServerMessage ssm = new ServerMessage(NATPMethod.CreateRoomResponse); if (success) { ssm.WriteEmpty(NATPAttribute.Success); } else { ssm.WriteEmpty(NATPAttribute.Failed); } sender.EncryptSend(ssm.WriteRequest()); }